diff options
author | Michael Jurka <mikejurka@google.com> | 2011-01-28 15:20:01 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-01-29 18:26:09 -0800 |
commit | cf6125c2d30ce02d8ab6cbe8e37a20f6a831e216 (patch) | |
tree | f1d846a828c1221ddc9300f0348b3614b51c8a64 /src/com/android/launcher2/CachedViewGroup.java | |
parent | e1dc51bce0764ba5a567145b0f4c78aa5b24fe67 (diff) | |
download | android_packages_apps_Trebuchet-cf6125c2d30ce02d8ab6cbe8e37a20f6a831e216.tar.gz android_packages_apps_Trebuchet-cf6125c2d30ce02d8ab6cbe8e37a20f6a831e216.tar.bz2 android_packages_apps_Trebuchet-cf6125c2d30ce02d8ab6cbe8e37a20f6a831e216.zip |
Improving performance of state transitions
- Caching CellLayouts to bitmaps when they're small again
- Enabling hardware layers on customize tray/all apps during transition
Change-Id: Ia4f5f7b608a9d013ed48b990551fd1b9de503b32
Diffstat (limited to 'src/com/android/launcher2/CachedViewGroup.java')
-rw-r--r-- | src/com/android/launcher2/CachedViewGroup.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/com/android/launcher2/CachedViewGroup.java b/src/com/android/launcher2/CachedViewGroup.java index b5cfd6062..f314b32c6 100644 --- a/src/com/android/launcher2/CachedViewGroup.java +++ b/src/com/android/launcher2/CachedViewGroup.java @@ -26,6 +26,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Bitmap.Config; import android.graphics.PorterDuff.Mode; +import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -52,6 +53,15 @@ public class CachedViewGroup extends ViewGroup implements VisibilityChangedListe public CachedViewGroup(Context context) { super(context); + init(); + } + + public CachedViewGroup(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + init(); + } + + private void init() { mBackgroundRect = new Rect(); mCacheRect = new Rect(); final Resources res = getResources(); @@ -124,14 +134,13 @@ public class CachedViewGroup extends ViewGroup implements VisibilityChangedListe float alpha = getAlpha(); setAlpha(1.0f); isUpdatingCache = true; - draw(mCacheCanvas); + drawChildren(mCacheCanvas); isUpdatingCache = false; setAlpha(alpha); mIsCacheDirty = false; } - public void drawChildren(Canvas canvas) { super.dispatchDraw(canvas); } @@ -148,11 +157,6 @@ public class CachedViewGroup extends ViewGroup implements VisibilityChangedListe invalidateCache(); } - public void removeViewWithoutMarkingCells(View view) { - super.removeView(view); - invalidateCache(); - } - @Override public void removeView(View view) { super.removeView(view); |