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


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中应用程序图标的显示类。 

 

相关内容

    暂无相关文章