summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-05-14 16:29:55 -0700
committerMichael Jurka <mikejurka@google.com>2012-05-14 16:42:51 -0700
commit920d7f433e5be7b928fe52312c2e65d278b13ee5 (patch)
tree884d4d2d2adb17ef93b558c5164fc87f75410eff /src
parenta5a771ca1fd2fea7c898ad6d1eb616df4e2f38f5 (diff)
downloadandroid_packages_apps_Trebuchet-920d7f433e5be7b928fe52312c2e65d278b13ee5.tar.gz
android_packages_apps_Trebuchet-920d7f433e5be7b928fe52312c2e65d278b13ee5.tar.bz2
android_packages_apps_Trebuchet-920d7f433e5be7b928fe52312c2e65d278b13ee5.zip
Preventing drawing pages in Workspace if possible
Bug: 6427601 Change-Id: I259554557a5856aa17a532c656032c4d6d5826bd
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/PagedView.java6
-rw-r--r--src/com/android/launcher2/Workspace.java7
2 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index a3080a846..ac71b1cb2 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -747,6 +747,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
}
+ protected boolean shouldDrawChild(View child) {
+ return child.getAlpha() > 0;
+ }
+
@Override
protected void dispatchDraw(Canvas canvas) {
int halfScreenSize = getMeasuredWidth() / 2;
@@ -783,7 +787,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// View.INVISIBLE, preventing re-drawing of their hardware layer
for (int i = getChildCount() - 1; i >= 0; i--) {
final View v = getPageAt(i);
- if (leftScreen <= i && i <= rightScreen && v.getAlpha() > 0) {
+ if (leftScreen <= i && i <= rightScreen && shouldDrawChild(v)) {
v.setVisibility(VISIBLE);
drawChild(canvas, v, drawingTime);
} else {
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 3910c45cf..b0dda3b93 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -450,6 +450,13 @@ public class Workspace extends SmoothPagedView
public void onChildViewRemoved(View parent, View child) {
}
+ protected boolean shouldDrawChild(View child) {
+ final CellLayout cl = (CellLayout) child;
+ return super.shouldDrawChild(child) &&
+ (cl.getShortcutsAndWidgets().getAlpha() > 0 ||
+ cl.getBackgroundAlpha() > 0);
+ }
+
/**
* @return The open folder on the current screen, or null if there is none
*/