Preventing drawing pages in Workspace if possible

Bug: 6427601

Change-Id: I259554557a5856aa17a532c656032c4d6d5826bd
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index a3080a8..ac71b1c 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -747,6 +747,10 @@
         }
     }
 
+    protected boolean shouldDrawChild(View child) {
+        return child.getAlpha() > 0;
+    }
+
     @Override
     protected void dispatchDraw(Canvas canvas) {
         int halfScreenSize = getMeasuredWidth() / 2;
@@ -783,7 +787,7 @@
                 // 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 {