Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

More Android UIs

549 Aufrufe

Veröffentlicht am

Guide for more android ui implementation

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

More Android UIs

  1. 1. More UI of Android
  2. 2. Try this on~
  3. 3. List ● To show items in vertical scrolling list ● Use ListView component ● Item format can be customized, and most of apps are doing this way.
  4. 4. ListView ● Add ListView component ● Default list only contains string ● Item format can be customized, and most of apps are doing this way.
  5. 5. ArrayAdapter ● Set list items threw ArrayAdapter. ● android.R.layout.simple_list_item_1 -> Default list format provided by Android
  6. 6. ListView ● setOnItemClickListener -> Set onItemClickListener for list items ● ...ClickListener -> Usually used to get response after click certain item
  7. 7. Fragment ● Piece of an application's user interface that can be placed in an Activity. ● Single Acvitity contains single/multiple fragment, and each of it can be used like Activity ● Used for dynamic & multi-pane UI
  8. 8. Start Fragment ● onCreateView -> Creating view layout of fragment ● inflate.inflate? -> Create View instance with defined resource o In this case, set View with R.layout.fragment_main resource file
  9. 9. Start Fragment ● FragmentManager -> Interface for interacting with Fragment ● FragmentTransaction -> Add a fragment to the activity state o In code above, use FragmentTransaction.replace to input layout to target fragment
  10. 10. Start Fragment ● Try this~ ● Refer: http://examples.javacodeg eeks.com/android/core/app /fragment/android- fragments-example/
  11. 11. DrawerLayout ● Container for window content that allows for interactive "drawer" views to be pulled out from the edge of the window.
  12. 12. DrawerLayout ● FrameLayout: Layout for setting main view ● ListView: List which will be setting on drawer ● DrawerLayout is included on Android v4 Support Library package ● For more, look on http://developer.android.com /tools/support- library/features.html#v4
  13. 13. DrawerLayout - onCreate ● Set default fragment on onCreate ● DrawerLayout.setDrawerListener: Set event action on drawer ● Change fragment when list item on list view has been clicked, and close with DrawerLayout.closeDrawer

×