1. First, let's take a look at the structural diagram of the launcher activity view (obtained by hierarchyviewer. BAT ):
2. Let's take a look at layout/launcher. XML, layout-Port/launcher. XML, and layout-land/launcher. xml.
<Com. Android. launcher. draglayer
Xmlns: Android = "http://schemas.android.com/apk/res/android"
Xmlns: launcher = "http://schemas.android.com/apk/res/com.android.Launcher"
Android: Id = "@ + ID/drag_layer"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: Background = "# fff">
<! -- The workspace contains 3 screens of cells -->
<Com. Android. launcher. Workspace
Android: Id = "@ + ID/workspace"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Launcher: defaultscreen = "1">
<Include Android: Id = "@ + ID/cell1" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell2" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell3" layout = "@ layout/workspace_screen"/>
</COM. Android. launcher. workspace>
<Slidingdrawer
Android: Id = "@ + ID/drawer"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: Orientation = "horizontal"
Android: bottomoffset = "4dip"
Android: handle = "@ + ID/all_apps"
Android: content = "@ + ID/content">
<Com. Android. launcher. handleview
Android: Id = "@ ID/all_apps"
Android: layout_width = "56dip"
Android: layout_height = "56dip"
Android: Background = "@ drawable/handle"
Android: focusable = "true"
Android: clickable = "true"
Android: scaletype = "center"
Android: src = "@ drawable/handle_icon"
Launcher: Direction = "vertical"/>
<Com. Android. launcher. all1_gridview
Android: Id = "@ ID/content"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Launcher: texture = "@ drawable/pattern_carbon_fiber_dark"
Android: scrollbarstyle = "outsideinset"
Android: drawselectid Top = "false"
Android: listselector = "@ drawable/grid_selector"
Android: nextfocusleft = "@ ID/all_apps"
Android: nextfocusdown = "@ ID/content"
Android: nextfocusup = "@ ID/content"
Android: nextfocusright = "@ ID/content"
Android: verticalspacing = "10dip"
Android: numcolumns = "5"/>
</Slidingdrawer>
<Com. Android. launcher. deletezone
Android: Id = "@ + ID/delete_zone"
Android: layout_width = "49dip"
Android: layout_height = "wrap_content"
Android: scaletype = "center"
Android: src = "@ drawable/ic_delete"
Android: Background = "@ drawable/delete_zone_selector"
Android: layout_marginbottom = "-25dip"
Android: layout_gravity = "right | center_vertical"
Android: visibility = "gone"
Launcher: Direction = "vertical"/>
</COM. Android. launcher. draglayer>
3. Presentation Interface :()
The workspace can be added to any number of cells, for example, 7:
Launcher: defaultscreen = "3">
<Include Android: Id = "@ + ID/cell1" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell2" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell3" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell4" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell5" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell6" layout = "@ layout/workspace_screen"/>
<Include Android: Id = "@ + ID/cell7" layout = "@ layout/workspace_screen"/>
Reprinted Please note: http://blog.csdn.net/ccwwff/archive/2011/01/05/6118618.aspx