summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/CellLayout.java8
-rw-r--r--src/com/android/launcher3/Workspace.java21
2 files changed, 12 insertions, 17 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 81f9af2e1..72a6ce2e1 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -296,12 +296,8 @@ public class CellLayout extends ViewGroup {
addView(mShortcutsAndWidgets);
}
- public void enableHardwareLayers() {
- mShortcutsAndWidgets.setLayerType(LAYER_TYPE_HARDWARE, sPaint);
- }
-
- public void disableHardwareLayers() {
- mShortcutsAndWidgets.setLayerType(LAYER_TYPE_NONE, sPaint);
+ public void enableHardwareLayer(boolean hasLayer) {
+ mShortcutsAndWidgets.setLayerType(hasLayer ? LAYER_TYPE_HARDWARE : LAYER_TYPE_NONE, sPaint);
}
public void buildHardwareLayer() {
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index ea348ef8a..82b10fee8 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1046,7 +1046,7 @@ public class Workspace extends SmoothPagedView
mLauncher.updateVoiceButtonProxyVisible(false);
}
}
- };
+ }
protected void setWallpaperDimension() {
String spKey = WallpaperCropActivity.getSharedPreferencesKey();
@@ -1572,7 +1572,7 @@ public class Workspace extends SmoothPagedView
} else {
for (int i = 0; i < getPageCount(); i++) {
final CellLayout cl = (CellLayout) getChildAt(i);
- cl.disableHardwareLayers();
+ cl.enableHardwareLayer(false);
}
}
}
@@ -1592,17 +1592,16 @@ public class Workspace extends SmoothPagedView
leftScreen--;
}
}
+
+ final CellLayout customScreen = mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID);
for (int i = 0; i < screenCount; i++) {
final CellLayout layout = (CellLayout) getPageAt(i);
- if (!(leftScreen <= i && i <= rightScreen && shouldDrawChild(layout))) {
- layout.disableHardwareLayers();
- }
- }
- for (int i = 0; i < screenCount; i++) {
- final CellLayout layout = (CellLayout) getPageAt(i);
- if (leftScreen <= i && i <= rightScreen && shouldDrawChild(layout)) {
- layout.enableHardwareLayers();
- }
+
+ // enable layers between left and right screen inclusive, except for the
+ // customScreen, which may animate its content during transitions.
+ boolean enableLayer = layout != customScreen &&
+ leftScreen <= i && i <= rightScreen && shouldDrawChild(layout);
+ layout.enableHardwareLayer(enableLayer);
}
}
}