summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewCellLayoutChildren.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-02-03 16:47:14 -0800
committerMichael Jurka <mikejurka@google.com>2011-02-03 16:56:22 -0800
commitc0759f5090d9539d82ddc944b9f2da767c36b251 (patch)
tree5c11a5b291c2e85a558e4aa33a425a1d3a94412a /src/com/android/launcher2/PagedViewCellLayoutChildren.java
parent7924f2592fefbb9bee279bcb7c2bf46b0009023d (diff)
downloadandroid_packages_apps_Trebuchet-c0759f5090d9539d82ddc944b9f2da767c36b251.tar.gz
android_packages_apps_Trebuchet-c0759f5090d9539d82ddc944b9f2da767c36b251.tar.bz2
android_packages_apps_Trebuchet-c0759f5090d9539d82ddc944b9f2da767c36b251.zip
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)
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayoutChildren.java')
-rw-r--r--src/com/android/launcher2/PagedViewCellLayoutChildren.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayoutChildren.java b/src/com/android/launcher2/PagedViewCellLayoutChildren.java
index 1359a43e7..27da02af5 100644
--- a/src/com/android/launcher2/PagedViewCellLayoutChildren.java
+++ b/src/com/android/launcher2/PagedViewCellLayoutChildren.java
@@ -18,7 +18,6 @@ package com.android.launcher2;
import android.content.Context;
import android.graphics.Rect;
-import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -39,7 +38,6 @@ public class PagedViewCellLayoutChildren extends ViewGroup {
public PagedViewCellLayoutChildren(Context context) {
super(context);
- setLayerType(LAYER_TYPE_HARDWARE, null);
}
@Override
@@ -140,6 +138,17 @@ public class PagedViewCellLayoutChildren extends ViewGroup {
}
}
+ void destroyHardwareLayer() {
+ if (getLayerType() == LAYER_TYPE_HARDWARE) {
+ setLayerType(LAYER_TYPE_NONE, null);
+ }
+ }
+ void createHardwareLayer() {
+ if (getLayerType() == LAYER_TYPE_NONE) {
+ setLayerType(LAYER_TYPE_HARDWARE, null);
+ }
+ }
+
public void enableCenteredContent(boolean enabled) {
mCenterContent = enabled;
}