From 9ccafbff26f5835ab9725d876d1bf7ccd08ccf84 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 26 Oct 2016 13:06:08 -0700 Subject: Removing custom dispatchDraw logic and letting the system handle selecting appropriate children for drawing. > System already skips children which are outside the bounds. Originally this logic was added because workspace layout is larger than the screen, and we need to selectivly skip more children. But over time we have added many special conditions and at present workspace actually draws more children than needed at any given time. > Fixing bug, where onBeginPageMoving was getting called during folder open Bug: 12116740 Change-Id: Idee18ee9cd9d348ebc4dfd82f4ff6df14e0d22d2 --- src/com/android/launcher3/PinchAnimationManager.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/com/android/launcher3/PinchAnimationManager.java') diff --git a/src/com/android/launcher3/PinchAnimationManager.java b/src/com/android/launcher3/PinchAnimationManager.java index 84ef12e16..3cc0f7d3f 100644 --- a/src/com/android/launcher3/PinchAnimationManager.java +++ b/src/com/android/launcher3/PinchAnimationManager.java @@ -60,7 +60,6 @@ public class PinchAnimationManager { private final Animator[] mAnimators = new Animator[4]; - private final int[] mVisiblePageRange = new int[2]; private Launcher mLauncher; private Workspace mWorkspace; @@ -181,17 +180,13 @@ public class PinchAnimationManager { } private void setOverviewPanelsAlpha(float alpha, int duration) { - mWorkspace.getVisiblePages(mVisiblePageRange); - for (int i = mVisiblePageRange[0]; i <= mVisiblePageRange[1]; i++) { - View page = mWorkspace.getPageAt(i); - if (!mWorkspace.shouldDrawChild(page)) { - continue; - } + int childCount = mWorkspace.getChildCount(); + for (int i = 0; i < childCount; i++) { + final CellLayout cl = (CellLayout) mWorkspace.getChildAt(i); if (duration == 0) { - ((CellLayout) page).setBackgroundAlpha(alpha); + cl.setBackgroundAlpha(alpha); } else { - ObjectAnimator.ofFloat(page, "backgroundAlpha", alpha) - .setDuration(duration).start(); + ObjectAnimator.ofFloat(cl, "backgroundAlpha", alpha).setDuration(duration).start(); } } } -- cgit v1.2.3