diff options
author | Michael Jurka <mikejurka@google.com> | 2013-10-03 01:05:14 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2013-10-03 16:19:06 -0700 |
commit | fe0ace3583bc57adbaaec730b1b1757032e90c41 (patch) | |
tree | a0376c1f2db0e3e50e928f8a73eea1d19b71c374 /src/com/android/launcher3/PagedView.java | |
parent | f0481bf3c9571dd7f6ec734f400706ea6439766c (diff) | |
download | android_packages_apps_Trebuchet-fe0ace3583bc57adbaaec730b1b1757032e90c41.tar.gz android_packages_apps_Trebuchet-fe0ace3583bc57adbaaec730b1b1757032e90c41.tar.bz2 android_packages_apps_Trebuchet-fe0ace3583bc57adbaaec730b1b1757032e90c41.zip |
Fix RTL bugs with wallpaper parallax
Bug: 10901046
Change-Id: Id4277173b0c13d25eb0507bd6fa9fa1309946510
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index fcc1aff8a..c8e34dda1 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -265,6 +265,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc protected final Rect mInsets = new Rect(); + protected int mFirstChildLeft; + public interface PageSwitchListener { void onPageSwitch(View newPage, int newPageIndex); } @@ -857,6 +859,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc requestLayout(); } + protected int getFirstChildLeft() { + return mFirstChildLeft; + } + @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { if (!mIsDataReady || getChildCount() == 0) { @@ -881,8 +887,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc final int delta = isRtl ? -1 : 1; int verticalPadding = getPaddingTop() + getPaddingBottom(); - int childLeft = offsetX + (screenWidth - getChildWidth(startIndex)) / 2; + int childLeft = mFirstChildLeft = offsetX + (screenWidth - getChildWidth(startIndex)) / 2; if (mPageScrolls == null || getChildCount() != mChildCountOnLastLayout) { mPageScrolls = new int[getChildCount()]; } |