Android Support Library

2,980 views
2,558 views

Published on

Published in: Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,980
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
20
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Android Support Library

  1. 1. Android Support LibraryDecember 1st, 2012
  2. 2. Overview●Fragment●FragmentManager●FragmentTransaction●ListFragment●DialogFragment●LoaderManager●Loader●AsyncTaskLoader●CursorLoader1st release - March 2011Current (11) – November 2012 v4 & v13
  3. 3. Fragments
  4. 4. Fragments
  5. 5. Fragments in Fragments
  6. 6. Fragments in FragmentsFragment Fragment Fragment GetChildFragmentManager() getParentFragment()
  7. 7. FragmentTabHost
  8. 8. Loader Loader FragmentSource
  9. 9. Loader Loader Fragment Source%ClassName% implements LoaderCallbacks...getSupportLoaderManager().initLoader(...)
  10. 10. LruCache
  11. 11. Loading bitmaps 1024x768 1024x768BitmapFactory.decodeStream(inputStream, null, options);
  12. 12. Loading bitmaps with cache 1024x768 430x320BitmapFactory.Options options = new BitmapFactory.Options();opts.inJustDecodeBounds = true;BitmapFactory.decodeStream(inputStream, null, options);
  13. 13. outOfMemoryError
  14. 14. outOfMemoryErrorIntent intent = new Intent(CAN_YOU_USE_LESS_MEMORY);LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);lbm.sendBroadcast(intent);
  15. 15. ViewPager
  16. 16. PagerTitleStrip
  17. 17. PagerTabStrip
  18. 18. PageTransformerpublic class MyPageTransformer implements PageTransformer { @Override public void transformPage(View page, float position) { page.setRotationY(position*90); page.setBackgroundColor(Color.rgb(0, (int)((position+1)/2*255), 0)); }}
  19. 19. TaskStackBuilder UP fTaskStackBuilder tsb = TaskStackBuilder.create(context);tsb.addNextIntent(new Intent(this, FirstActivity.class)) .addNextIntent(new Intent(this, SecondActivity.class)) .startActivities();
  20. 20. NavUtils UPManifest: <activity android:name=".ChildActivity" > <meta-data android:name="android.support.PARENT_ACTIVITY" android:value=".ParentActivity"> </meta-data> </activity> setDisplayHomeAsUpEnabled(true); NavUtils.navigateUpFromSameTask(context);
  21. 21. Thank you!
  22. 22. About us Sergey Solodilov Android developer bit.ly/SolodilovSergeyAlexey UstenkoAndroid developerbit.ly/AlexeyUstenko

×