Hide the workspace when launching AllApps2D.
Boosts performance and squashes some weird focus issues.
(Also: fix builds with AllApps3D)
Change-Id: Id1c4628e119c950dced9d3383993674f3d6b9a1c
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java
index 4c7b28c..55eb217 100644
--- a/src/com/android/launcher2/AllApps2D.java
+++ b/src/com/android/launcher2/AllApps2D.java
@@ -134,19 +134,25 @@
protected void onFinishInflate() {
setBackgroundColor(0xFF000000);
- mGrid = (GridView)findViewById(R.id.all_apps_2d_grid);
- mGrid.setOnItemClickListener(this);
- mGrid.setOnItemLongClickListener(this);
-
- setOnKeyListener(this);
+ try {
+ mGrid = (GridView)findViewWithTag("all_apps_2d_grid");
+ if (mGrid == null) throw new Resources.NotFoundException();
+ mGrid.setOnItemClickListener(this);
+ mGrid.setOnItemLongClickListener(this);
+
+ ImageButton homeButton = (ImageButton) findViewWithTag("all_apps_2d_home");
+ if (homeButton == null) throw new Resources.NotFoundException();
+ homeButton.setOnClickListener(
+ new View.OnClickListener() {
+ public void onClick(View v) {
+ mLauncher.closeAllApps(true);
+ }
+ });
+ } catch (Resources.NotFoundException e) {
+ Log.e(TAG, "Can't find necessary layout elements for AllApps2D");
+ }
- ImageButton homeButton = (ImageButton) findViewById(R.id.all_apps_2d_home);
- homeButton.setOnClickListener(
- new View.OnClickListener() {
- public void onClick(View v) {
- mLauncher.closeAllApps(true);
- }
- });
+ setOnKeyListener(this);
}
public AllApps2D(Context context, AttributeSet attrs, int defStyle) {
@@ -235,6 +241,8 @@
} else {
mZoom = 1.0f;
}
+
+ mLauncher.zoomed(mZoom);
}
public boolean isVisible() {