Merge "Preventing drawing pages in Workspace if possible" into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2d441b9d1a
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user