Preventing drawing pages in Workspace if possible

Bug: 6427601

Change-Id: I259554557a5856aa17a532c656032c4d6d5826bd
This commit is contained in:
Michael Jurka
2012-05-14 16:29:55 -07:00
parent a5a771ca1f
commit 920d7f433e
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 {