View Elements
- Button
- ToggleButton
- Checkbox
- RatingBar
- AutoCompleteTextView
- Button
- ToggleButton
- Checkbox
- RatingBar
- AutoCompleteTextView
ViewGroups
- RadioGroup
- TimePicker
- DatePicker
- WebView
- MapView
- Gallery
- Spinner
- RadioGroup
- TimePicker
- DatePicker
- WebView
- MapView
- Gallery
- Spinner
Adapters & AdapterViews
- AdapterView are Views managed by an Adapter, who manage the data and provides data views
- AdapterView display the View
- ListView manage by ListAdapter
- Spinner manage by SpinnerAdapter
- AdapterView are Views managed by an Adapter, who manage the data and provides data views
- AdapterView display the View
- ListView manage by ListAdapter
- Spinner manage by SpinnerAdapter
Layouts
match_parent - Occupy all the available space. Deprecated starting in API Level 8
fill_parent - Same asd match_parent but for API Level 8
- LinearLayout
- Arrange all the child elements in one line
- RelativeLayout
- TableLayout
- GridView
- Arrange all the child elements in one line
Menus
- Is defined in a resource XMLfile res/menu/file.xml
- Use it on method OnCreate...Menu(), using the menu inflater
- Use method on...ItemSelection() to handle the item selection
Types
- Options
- When user press a button
- In the method onCreateOptionsMenu() add the code to add the menu defined in res/menu/file.xml
getMenuInflater().inflate(R.menu.menu, menu);
- Context
- When user touches and holds a view
- Submenu
- When user touches a visible menu item
- ActionBar
- This line show the menu as ActionBar, showing the text only is space available
- android:showAsAction="ifRoom|withText"
- ActionBar (Tab)
Dialog
- Show a pop-up with the options like Yes/No
TIPS
- To add predifined icons use
- android:icon="@android:drawable/ic_menu_directions"
- To include in the Layout another element use the tag <include>
- Where @layout/first is the second layout file named first.xml
<include
android:id="@+id/include2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
layout="@layout/first" >
</include>
Comentarios
Publicar un comentario