summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllApps2D.java
diff options
context:
space:
mode:
authorPatrick Dubroy <dubroy@google.com>2010-07-23 16:48:11 -0700
committerPatrick Dubroy <dubroy@google.com>2010-07-26 11:44:33 -0700
commit558654c6ec6eefa260e5a1c1c44fc6e13ec20473 (patch)
tree4ed4ab99fccf8dd1a68c91f186d815c030c86a81 /src/com/android/launcher2/AllApps2D.java
parent401d892f4cfde9285ae3e48dd6079d281454dcbb (diff)
downloadandroid_packages_apps_Trebuchet-558654c6ec6eefa260e5a1c1c44fc6e13ec20473.tar.gz
android_packages_apps_Trebuchet-558654c6ec6eefa260e5a1c1c44fc6e13ec20473.tar.bz2
android_packages_apps_Trebuchet-558654c6ec6eefa260e5a1c1c44fc6e13ec20473.zip
Switched to tabbed version of AllApps2D on xlarge screens.
- add a temporary new zoom animation for all apps - modify AllApps2D to allow it to be transparent - other changes to dismiss the customization drawer when appropriate Change-Id: I5660ab77f256ded299c1721c589983a1b30d56a4
Diffstat (limited to 'src/com/android/launcher2/AllApps2D.java')
-rw-r--r--src/com/android/launcher2/AllApps2D.java35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java
index b18fc1af7..b993364bf 100644
--- a/src/com/android/launcher2/AllApps2D.java
+++ b/src/com/android/launcher2/AllApps2D.java
@@ -16,15 +16,15 @@
package com.android.launcher2;
-import java.util.ArrayList;
-import java.util.Collections;
+import com.android.launcher.R;
import android.content.ComponentName;
import android.content.Context;
import android.content.res.Resources;
-import android.graphics.drawable.BitmapDrawable;
import android.graphics.Bitmap;
-import android.graphics.Color;
+import android.graphics.PixelFormat;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
@@ -39,7 +39,8 @@ import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
-import com.android.launcher.R;
+import java.util.ArrayList;
+import java.util.Collections;
public class AllApps2D
extends RelativeLayout
@@ -67,6 +68,8 @@ public class AllApps2D
private AppsAdapter mAppsAdapter;
+ private boolean mIsViewOpaque;
+
// ------------------------------------------------------------
public static class HomeButton extends ImageButton {
@@ -125,24 +128,24 @@ public class AllApps2D
@Override
protected void onFinishInflate() {
- setBackgroundColor(Color.BLACK);
+ mIsViewOpaque = super.isOpaque();
try {
mGrid = (GridView)findViewWithTag("all_apps_2d_grid");
if (mGrid == null) throw new Resources.NotFoundException();
mGrid.setOnItemClickListener(this);
mGrid.setOnItemLongClickListener(this);
- mGrid.setBackgroundColor(Color.BLACK);
- mGrid.setCacheColorHint(Color.BLACK);
+ // The home button is optional; some layouts might not use it
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);
- }
- });
+ if (homeButton != null) {
+ 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");
}
@@ -251,7 +254,7 @@ public class AllApps2D
@Override
public boolean isOpaque() {
- return mZoom > 0.999f;
+ return mIsViewOpaque && mZoom > 0.999f;
}
public void setApps(ArrayList<ApplicationInfo> list) {