diff options
Diffstat (limited to 'src/com/android/launcher2/AllApps2D.java')
-rw-r--r-- | src/com/android/launcher2/AllApps2D.java | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/com/android/launcher2/AllApps2D.java b/src/com/android/launcher2/AllApps2D.java index 7ad5e4915..b993364bf 100644 --- a/src/com/android/launcher2/AllApps2D.java +++ b/src/com/android/launcher2/AllApps2D.java @@ -16,32 +16,32 @@ package com.android.launcher2; +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; -import android.view.ViewGroup; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.view.animation.AnimationUtils; -import android.view.ViewConfiguration; import android.widget.AdapterView; -import android.widget.ImageButton; -import android.widget.TextView; import android.widget.ArrayAdapter; import android.widget.GridView; +import android.widget.ImageButton; import android.widget.RelativeLayout; +import android.widget.TextView; import java.util.ArrayList; import java.util.Collections; -import com.android.launcher.R; - public class AllApps2D extends RelativeLayout implements AllAppsView, @@ -68,6 +68,8 @@ public class AllApps2D private AppsAdapter mAppsAdapter; + private boolean mIsViewOpaque; + // ------------------------------------------------------------ public static class HomeButton extends ImageButton { @@ -126,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"); } @@ -252,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) { |