From 69ed200530058afceedad1abe6c15da3b0c61909 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Wed, 27 Aug 2014 21:27:01 -0700 Subject: Fix regression which was causing requestLayout in layout pass -> This caused funky layout issues with views not appearing on devices prior to K in addition to log spam. issue 17282728 Change-Id: Id05856ba2ef3de3a8a636ba9b4b46ddef3eff75e --- src/com/android/launcher3/AppsCustomizeCellLayout.java | 2 +- src/com/android/launcher3/AppsCustomizePagedView.java | 10 ++++++++-- src/com/android/launcher3/PagedView.java | 2 -- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/com') diff --git a/src/com/android/launcher3/AppsCustomizeCellLayout.java b/src/com/android/launcher3/AppsCustomizeCellLayout.java index 76b81d2d1..a50fb6821 100644 --- a/src/com/android/launcher3/AppsCustomizeCellLayout.java +++ b/src/com/android/launcher3/AppsCustomizeCellLayout.java @@ -68,4 +68,4 @@ public class AppsCustomizeCellLayout extends CellLayout implements Page { children.getChildAt(j).setOnKeyListener(null); } } -} \ No newline at end of file +} diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java index 03e1e5642..558d8e99b 100644 --- a/src/com/android/launcher3/AppsCustomizePagedView.java +++ b/src/com/android/launcher3/AppsCustomizePagedView.java @@ -362,8 +362,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen if (!isDataReady()) { if ((LauncherAppState.isDisableAllApps() || !mApps.isEmpty()) && !mWidgets.isEmpty()) { - setDataIsReady(); - onDataReady(getMeasuredWidth(), getMeasuredHeight()); + post(new Runnable() { + // This code triggers requestLayout so must be posted outside of the + // layout pass. + public void run() { + setDataIsReady(); + onDataReady(getMeasuredWidth(), getMeasuredHeight()); + } + }); } } } diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 54aa24ef6..0434faff5 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -996,9 +996,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { - setHorizontalScrollBarEnabled(false); updateCurrentPageScroll(); - setHorizontalScrollBarEnabled(true); mFirstLayout = false; } -- cgit v1.2.3