android view架构,Android Launcher View构架浅析

1. 先来看一下launcher activity view的架构图(hierarchyviewer.bat工具获取):

accbb7dfbe83934253bb6ce887b442fa.png

2. 再来看layout/launcher.xml, layout-port/launcher.xml,  layout-land/launcher.xml

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">

android:id="@+id/workspace"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

launcher:defaultScreen="1">

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">

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" />

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:drawSelectorOnTop="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" />

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" />

3. 呈现界面:()

cf2b1a8478d17cfc0d1acc67da3ac448.png

其中Workspace可增加到任意多个cell,如7个:

launcher:defaultScreen="3">

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值