Merge "Preventing drawing pages in Workspace if possible" into jb-dev

This commit is contained in:
Michael Jurka
2012-05-14 17:14:22 -07:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 1 deletions
+5 -1
View File
@@ -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 {
+7
View File
@@ -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
*/