Reducing memory impact of hardware layers in Launcher

- Disabling hardware layers in customize tray
- Destroying hardware layers for pages in All Apps that are not visible
- Re-adding CachedTextView for icons in customize tray (to regain some of the lost performance there)
This commit is contained in:
Michael Jurka
2011-02-03 16:47:14 -08:00
parent 7924f2592f
commit c0759f5090
6 changed files with 54 additions and 4 deletions
@@ -47,6 +47,7 @@ public class CachedTextView extends TextView {
private float mPaddingH = 0;
private float mPaddingV = 0;
private CharSequence mText;
private boolean mEnabled = true;
public CachedTextView(Context context) {
super(context);
@@ -73,6 +74,10 @@ public class CachedTextView extends TextView {
return 0;
}
public void disableCache() {
mEnabled = false;
}
public void setText(CharSequence text, BufferType type) {
super.setText(text, type);
mIsTextCacheDirty = true;
@@ -138,7 +143,7 @@ public class CachedTextView extends TextView {
}
public void draw(Canvas canvas) {
if (mIsTextCacheDirty && !mIsBuildingCache) {
if (mEnabled && mIsTextCacheDirty && !mIsBuildingCache) {
buildAndUpdateCache();
mIsTextCacheDirty = false;
}