diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-03-01 01:07:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-03-01 01:07:39 +0000 |
commit | e670159cfe255693f829f3e2857bbd8c52731e9d (patch) | |
tree | 768c236acd48d8631c28686af4cbb37d18703903 /src/com/android/launcher3/PagedView.java | |
parent | 061380a04d067d06adf41c72b4a6892827777acc (diff) | |
parent | ee68816be8e4667548ac8925a14d014f1d66d460 (diff) | |
download | android_packages_apps_Trebuchet-e670159cfe255693f829f3e2857bbd8c52731e9d.tar.gz android_packages_apps_Trebuchet-e670159cfe255693f829f3e2857bbd8c52731e9d.tar.bz2 android_packages_apps_Trebuchet-e670159cfe255693f829f3e2857bbd8c52731e9d.zip |
Merge "Fixing homescreen getting blank when returning from the overlay" into ub-launcher3-calgary
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index a290f5fef..bc15338eb 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -1042,24 +1042,25 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } protected void getVisiblePages(int[] range) { - final int pageCount = getChildCount(); + final int count = getChildCount(); range[0] = -1; range[1] = -1; - if (pageCount > 0) { - int lastVisiblePageIndex = 0; + if (count > 0) { final int visibleLeft = -getLeft(); final int visibleRight = visibleLeft + getViewportWidth(); + final Matrix pageShiftMatrix = getPageShiftMatrix(); + int curScreen = 0; - for (int currPageIndex = 0; currPageIndex < pageCount; currPageIndex++) { - View currPage = getPageAt(currPageIndex); + for (int i = 0; i < count; i++) { + View currPage = getPageAt(i); // Verify if the page bounds are within the visible range. sTmpRectF.left = 0; sTmpRectF.right = currPage.getMeasuredWidth(); currPage.getMatrix().mapRect(sTmpRectF); sTmpRectF.offset(currPage.getLeft() - getScrollX(), 0); - getMatrix().mapRect(sTmpRectF); + pageShiftMatrix.mapRect(sTmpRectF); if (sTmpRectF.left > visibleRight || sTmpRectF.right < visibleLeft) { if (range[0] == -1) { @@ -1068,19 +1069,23 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc break; } } + curScreen = i; if (range[0] < 0) { - range[0] = currPageIndex; + range[0] = curScreen; } - lastVisiblePageIndex = currPageIndex; } - range[1] = lastVisiblePageIndex; + range[1] = curScreen; } else { range[0] = -1; range[1] = -1; } } + protected Matrix getPageShiftMatrix() { + return getMatrix(); + } + protected boolean shouldDrawChild(View child) { return child.getVisibility() == VISIBLE; } |