你好,游客 登录 注册 搜索
背景:
阅读新闻

Launcher2主菜单应用图标显示于整体布局中之说明

[日期:2013-07-04] 来源:Linux社区  作者:cbk861110 [字体:大 中 小]

1.Launcher.xml中:
<include layout="@layout/apps_customize_pane"
Android:id="@+id/apps_customize_pane"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />

2.apps_customize_pane.xml中:
<com.android.launcher2.AppsCustomizeTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#FF000000">
<LinearLayout
android:id="@+id/apps_customize_content"
....
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.android.launcher2.AppsCustomizePagedView
android:id="@+id/apps_customize_pane_content"
....


3.Launcher.java 中setupViews()
{
// Setup AppsCustomize
mAppsCustomizeTabHost = (AppsCustomizeTabHost)
findViewById(R.id.apps_customize_pane);
mAppsCustomizeContent = (AppsCustomizePagedView)
mAppsCustomizeTabHost.findViewById(R.id.apps_customize_pane_content);
mAppsCustomizeContent.setup(this, dragController);
} 

4.mtk_apps_customize_application.xml中
<com.android.launcher2.MTKAppIcon
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/application_icon"

....
<com.android.launcher2.PagedViewIcon
style="@style/WorkspaceIcon.Landscape.AppsCustomize"
android:id="@+id/app_customize_application_icon"
.... 

5.AppsCustomizePagedView.java 中syncAppsPageItems()
{
ApplicationInfo info = mApps.get(i);
MTKAppIcon icon = (MTKAppIcon) mLayoutInflater.inflate(
R.layout.mtk_apps_customize_application, layout, false);
}


6.MTKAppIcon.java 中onFinishInflate()
{
mAppIcon = (PagedViewIcon)findViewById(R.id.app_customize_application_icon);
} 

7.PagedViewIcon.java为Launcher2.apk中应用程序图标的显示类。 

 更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11

linux
相关资讯       Launcher2 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款