am 67ef1c40: Merge "Fix regression which was causing requestLayout in layout pass" into ub-now-porkchop

* commit '67ef1c406cb8a288c5bcdb825a26e6020e0a6cac':
  Fix regression which was causing requestLayout in layout pass
This commit is contained in:
Adam Cohen
2014-08-28 23:05:42 +00:00
committed by Android Git Automerger
3 changed files with 9 additions and 5 deletions
@@ -68,4 +68,4 @@ public class AppsCustomizeCellLayout extends CellLayout implements Page {
children.getChildAt(j).setOnKeyListener(null); children.getChildAt(j).setOnKeyListener(null);
} }
} }
} }
@@ -362,8 +362,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
if (!isDataReady()) { if (!isDataReady()) {
if ((LauncherAppState.isDisableAllApps() || !mApps.isEmpty()) && !mWidgets.isEmpty()) { if ((LauncherAppState.isDisableAllApps() || !mApps.isEmpty()) && !mWidgets.isEmpty()) {
setDataIsReady(); post(new Runnable() {
onDataReady(getMeasuredWidth(), getMeasuredHeight()); // This code triggers requestLayout so must be posted outside of the
// layout pass.
public void run() {
setDataIsReady();
onDataReady(getMeasuredWidth(), getMeasuredHeight());
}
});
} }
} }
} }
-2
View File
@@ -996,9 +996,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
} }
if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) { if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
setHorizontalScrollBarEnabled(false);
updateCurrentPageScroll(); updateCurrentPageScroll();
setHorizontalScrollBarEnabled(true);
mFirstLayout = false; mFirstLayout = false;
} }