diff options
author | Winson <winsonc@google.com> | 2016-07-28 12:24:55 -0700 |
---|---|---|
committer | Winson <winsonc@google.com> | 2016-07-28 16:21:20 -0700 |
commit | c7d2e83c15e85b2695e016213549d08e63c923b3 (patch) | |
tree | f0ca3675781bc9d6b9d3e4598271bd15c646a687 /src/com/android/launcher3/Launcher.java | |
parent | d96fa1336921cc8c8bb4d773b2229b62df86e6ea (diff) | |
download | android_packages_apps_Trebuchet-c7d2e83c15e85b2695e016213549d08e63c923b3.tar.gz android_packages_apps_Trebuchet-c7d2e83c15e85b2695e016213549d08e63c923b3.tar.bz2 android_packages_apps_Trebuchet-c7d2e83c15e85b2695e016213549d08e63c923b3.zip |
Working around incorrect wallpaper offsets being calculated in RTL.
- When launcher starts up, onCreate() triggers the launcher model loader
to start, which calls bindScreens() to add the workspace pages.
However, layout does not happen until the device is unlocked, which
means that even though the default screen index and children are there
the page scrolls are calculated incorrectly, and even in RTL, the
page scroll for the 0th screen is zero (it should be at the right
most edge of the workspace). This CL works around this by deferring
until the first layout after bindScreens() to unlock the wallpaper
offset from its default bounds. The workaround is only applied when
the launcher activity is first created.
Bug: 28795125
Change-Id: I33da0d7f934f5337d26e69f068f579a32897a837
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 3f12abfd4..aa6f62e94 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1372,6 +1372,9 @@ public class Launcher extends Activity mWorkspace.setHapticFeedbackEnabled(false); mWorkspace.setOnLongClickListener(this); mWorkspace.setup(mDragController); + // Until the workspace is bound, ensure that we keep the wallpaper offset locked to the + // default state, otherwise we will update to the wrong offsets in RTL + mWorkspace.lockWallpaperToDefaultPage(); mWorkspace.bindAndInitFirstWorkspaceScreen(null /* recycled qsb */); mDragController.addDragListener(mWorkspace); @@ -3667,6 +3670,11 @@ public class Launcher extends Activity mWorkspace.createCustomContentContainer(); populateCustomContentContainer(); } + + // After we have added all the screens, if the wallpaper was locked to the default state, + // then notify to indicate that it can be released and a proper wallpaper offset can be + // computed before the next layout + mWorkspace.unlockWallpaperFromDefaultPageOnNextLayout(); } private void bindAddScreens(ArrayList<Long> orderedScreenIds) { |