Android 2.3.3
1:分别注释以下代码
tony@tony-desktop:~/win/pc1013/packages/apps/Launcher2/res/layout-land$ vim launcher.xml
tony@tony-desktop:~/win/pc1013/packages/apps/Launcher2/res/layout-port$ vim launcher.xml
<!--
<com.android.launcher2.HandleView
style="@style/HotseatButton"
android:id="@+id/all_apps_button"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/all_apps_button"
launcher:direction="vertical"
/>
<ImageView
android:id="@+id/hotseat_left"
style="@style/HotseatButton.Left"
android:layout_below="@id/all_apps_button"
android:src="@drawable/hotseat_phone"
android:onClick="launchHotSeat"
/>
<ImageView
android:id="@+id/hotseat_right"
style="@style/HotseatButton.Right"
android:layout_above="@id/all_apps_button"
android:src="@drawable/hotseat_browser"
android:onClick="launchHotSeat"
/>
-->
2:注释以下代码
tony@tony-desktop:~/win/pc1013/packages/apps/Launcher2/src/com/android/launcher2$ vim Launcher.java
744 /*wgx
745 mHandleView = (HandleView) findViewById(R.id.all_apps_button);
746 mHandleView.setLauncher(this);
747 mHandleView.setOnClickListener(this);
748 mHandleView.setOnLongClickListener(this);
749
750 ImageView hotseatLeft = (ImageView) findViewById(R.id.hotseat_left);
751 hotseatLeft.setContentDescription(mHotseatLabels[0]);
752 hotseatLeft.setImageDrawable(mHotseatIcons[0]);
753 ImageView hotseatRight = (ImageView) findViewById(R.id.hotseat_right);
754 hotseatRight.setContentDescription(mHotseatLabels[1]);
755 hotseatRight.setImageDrawable(mHotseatIcons[1]);
756 */
1595 /*wgx
1596 case R.id.all_apps_button:
1597 if (!isAllAppsVisible()) {
1598 mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PR ESS,
1599 HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
1600 showPreviews(v);
1601 }
1602 return true;
1603 */
本文档展示了如何注释Android 2.3.3系统中Launcher2应用的UI元素代码,包括布局文件中的HandleView及ImageView配置,以及Java源文件中对应的组件初始化和事件绑定代码。
1583

被折叠的 条评论
为什么被折叠?



