diff options
author | Michael Jurka <mikejurka@google.com> | 2011-03-02 17:41:34 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-03-02 22:12:05 -0800 |
commit | 9c6fbed48783dacd9bc6b4ec5f2cc8e59ec7ee37 (patch) | |
tree | 8a980b3da908c42c774159d74c4f048d42737e76 /src/com/android/launcher2/AllAppsTabbed.java | |
parent | 3cba722d4745b29a47ebc6a472dd921e5c9d7367 (diff) | |
download | android_packages_apps_Trebuchet-9c6fbed48783dacd9bc6b4ec5f2cc8e59ec7ee37.tar.gz android_packages_apps_Trebuchet-9c6fbed48783dacd9bc6b4ec5f2cc8e59ec7ee37.tar.bz2 android_packages_apps_Trebuchet-9c6fbed48783dacd9bc6b4ec5f2cc8e59ec7ee37.zip |
Further improving performance of All Apps transition
Change-Id: Ie8a2af004acba4c13066dd636842a71793064688
Diffstat (limited to 'src/com/android/launcher2/AllAppsTabbed.java')
-rw-r--r-- | src/com/android/launcher2/AllAppsTabbed.java | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/com/android/launcher2/AllAppsTabbed.java b/src/com/android/launcher2/AllAppsTabbed.java index 36594dd34..66191503c 100644 --- a/src/com/android/launcher2/AllAppsTabbed.java +++ b/src/com/android/launcher2/AllAppsTabbed.java @@ -49,7 +49,8 @@ public class AllAppsTabbed extends TabHost implements AllAppsView, LauncherAnima private static final String TAG_DOWNLOADED = "DOWNLOADED"; private AllAppsPagedView mAllApps; - private View mTabBar; + private AllAppsBackground mBackground; + private Launcher mLauncher; private Context mContext; private final LayoutInflater mInflater; private boolean mFirstLayout = true; @@ -68,8 +69,8 @@ public class AllAppsTabbed extends TabHost implements AllAppsView, LauncherAnima try { mAllApps = (AllAppsPagedView) findViewById(R.id.all_apps_paged_view); if (mAllApps == null) throw new Resources.NotFoundException(); - mTabBar = findViewById(R.id.all_apps_tab_bar); - if (mTabBar == null) throw new Resources.NotFoundException(); + mBackground = (AllAppsBackground) findViewById(R.id.all_apps_background); + if (mBackground == null) throw new Resources.NotFoundException(); } catch (Resources.NotFoundException e) { Log.e(TAG, "Can't find necessary layout elements for AllAppsTabbed"); } @@ -126,6 +127,7 @@ public class AllAppsTabbed extends TabHost implements AllAppsView, LauncherAnima @Override public void setLauncher(Launcher launcher) { mAllApps.setLauncher(launcher); + mLauncher = launcher; } @Override @@ -170,25 +172,21 @@ public class AllAppsTabbed extends TabHost implements AllAppsView, LauncherAnima } @Override - public void setFastAlpha(float alpha) { - final ViewGroup allAppsParent = (ViewGroup) mAllApps.getParent(); - final ViewGroup tabBarParent = (ViewGroup) mAllApps.getParent(); - mAllApps.setFastAlpha(alpha); - allAppsParent.fastInvalidate(); - mTabBar.setFastAlpha(alpha); - tabBarParent.fastInvalidate(); - } - - @Override public void onLauncherAnimationStart() { - mTabBar.setLayerType(LAYER_TYPE_HARDWARE, null); - mAllApps.setLayerType(LAYER_TYPE_HARDWARE, null); + // Turn on hardware layers for performance + setLayerType(LAYER_TYPE_HARDWARE, null); + // Re-enable the rendering of the dimmed background in All Apps for performance reasons + mLauncher.getWorkspace().disableBackground(); + mBackground.setVisibility(VISIBLE); } @Override public void onLauncherAnimationEnd() { - mTabBar.setLayerType(LAYER_TYPE_NONE, null); - mAllApps.setLayerType(LAYER_TYPE_NONE, null); + setLayerType(LAYER_TYPE_NONE, null); + // Move the rendering of the dimmed background to workspace after the all apps animation + // is done, so that the background is not rendered *above* the mini workspace screens + mLauncher.getWorkspace().enableBackground(); + mBackground.setVisibility(GONE); } @Override |