diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-06-01 14:08:21 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-06-06 16:41:57 -0700 |
commit | 7c786f75d131addf849551a8cbc084c7c4ed0730 (patch) | |
tree | 7885e20d12cd97eb05d6eeab4ccfef097fb94576 /src/com/android/launcher3/PagedView.java | |
parent | 074290b873811365a0ce8be78bc2c3d9335756d4 (diff) | |
download | android_packages_apps_Trebuchet-7c786f75d131addf849551a8cbc084c7c4ed0730.tar.gz android_packages_apps_Trebuchet-7c786f75d131addf849551a8cbc084c7c4ed0730.tar.bz2 android_packages_apps_Trebuchet-7c786f75d131addf849551a8cbc084c7c4ed0730.zip |
Allowing the first screen to expand to the screen edge
This allows the QSB to extend all the way to the edge
Change-Id: I43c6e21e44fef7fffe6fb12b7afb95549b68679f
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 4af53d279..bf9a421b1 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -647,6 +647,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc public static class LayoutParams extends ViewGroup.LayoutParams { public boolean isFullScreenPage = false; + // If true, the start edge of the page snaps to the start edge of the viewport. + public boolean matchStartEdge = false; + /** * {@inheritDoc} */ @@ -778,6 +781,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc childWidth = getViewportWidth() - horizontalPadding - mInsets.left - mInsets.right; + + if (lp.matchStartEdge) { + childWidth += getPaddingStart(); + } childHeight = getViewportHeight() - verticalPadding - mInsets.top - mInsets.bottom; mNormalChildHeight = childHeight; @@ -827,7 +834,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc LayoutParams lp = (LayoutParams) getChildAt(startIndex).getLayoutParams(); LayoutParams nextLp; - int childLeft = offsetX + (lp.isFullScreenPage ? 0 : getPaddingLeft()); + int childLeft = offsetX + + ((lp.isFullScreenPage || (!mIsRtl && lp.matchStartEdge)) ? 0 : getPaddingLeft()); if (mPageScrolls == null || childCount != mChildCountOnLastLayout) { mPageScrolls = new int[childCount]; } @@ -851,7 +859,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc child.layout(childLeft, childTop, childLeft + child.getMeasuredWidth(), childTop + childHeight); - int scrollOffsetLeft = lp.isFullScreenPage ? 0 : getPaddingLeft(); + int scrollOffsetLeft = (lp.isFullScreenPage || (!mIsRtl & lp.matchStartEdge)) ? + 0 : getPaddingLeft(); mPageScrolls[i] = childLeft - scrollOffsetLeft - offsetX; int pageGap = mPageSpacing; |