Ensure that setting a wallpaper snaps to a page.
Previously it was possible to end in a sort of limbo state between pages if the
user free scrolled in the overview before entering the wallpaper picker.
Bug: 23829077
Change-Id: I2837fb46f092efac3b3274043378431963e6eabc
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 35d08ba..7722f6e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -704,6 +704,9 @@
return;
} else if (requestCode == REQUEST_PICK_WALLPAPER) {
if (resultCode == RESULT_OK && mWorkspace.isInOverviewMode()) {
+ // User could have free-scrolled between pages before picking a wallpaper; make sure
+ // we move to the closest one now.
+ mWorkspace.setCurrentPage(mWorkspace.getPageNearestToCenterOfScreen());
showWorkspace(false);
}
return;