summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-12-09 21:42:42 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-12-16 22:32:35 (GMT)
commita7aa8b824b18b1ca16fa484b7a771bd028b13cbd (patch)
treee229543c4982c31bb4243958a453414727d633e8
parent6d6e0a35e44c3a0da999f93290d0d28107f4d9cc (diff)
downloadandroid_packages_apps_Trebuchet-a7aa8b824b18b1ca16fa484b7a771bd028b13cbd.zip
android_packages_apps_Trebuchet-a7aa8b824b18b1ca16fa484b7a771bd028b13cbd.tar.gz
android_packages_apps_Trebuchet-a7aa8b824b18b1ca16fa484b7a771bd028b13cbd.tar.bz2
Trebuchet: Fix Scrolling Wallpaper toggle
Change-Id: I8c2cc294e1f3a9638023616d80f891ec9b98f3c4
-rw-r--r--src/com/android/launcher3/Workspace.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 3fc6f63..9d1aac2 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -340,9 +340,6 @@ public class Workspace extends SmoothPagedView
mShowOutlines = SettingsProvider.getBoolean(context,
SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_PAGE_OUTLINES,
R.bool.preferences_interface_homescreen_scrolling_page_outlines_default);
- mScrollWallpaper = SettingsProvider.getBoolean(context,
- SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL,
- R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default);
mHideIconLabels = SettingsProvider.getBoolean(context,
SettingsProvider.SETTINGS_UI_HOMESCREEN_HIDE_ICON_LABELS,
R.bool.preferences_interface_homescreen_hide_icon_labels_default);
@@ -1532,7 +1529,11 @@ public class Workspace extends SmoothPagedView
@Override
public void computeScroll() {
super.computeScroll();
- mWallpaperOffset.syncWithScroll();
+ if (mScrollWallpaper) mWallpaperOffset.syncWithScroll();
+
+ if (isInOverviewMode() && !isReordering(true)) {
+ updateDefaultScreenButton();
+ }
}
@Override
@@ -1810,6 +1811,16 @@ public class Workspace extends SmoothPagedView
getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
sAccessibilityEnabled = am.isEnabled();
+ mScrollWallpaper = SettingsProvider.getBoolean(mLauncher,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL,
+ R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default);
+
+ if (!mScrollWallpaper) {
+ if (mWindowToken != null) mWallpaperManager.setWallpaperOffsets(mWindowToken, 0f, 0.5f);
+ } else {
+ mWallpaperOffset.syncWithScroll();
+ }
+
// Update wallpaper dimensions if they were changed since last onResume
// (we also always set the wallpaper dimensions in the constructor)
if (LauncherAppState.getInstance().hasWallpaperChangedSinceLastCheck()) {
@@ -1823,7 +1834,8 @@ public class Workspace extends SmoothPagedView
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
+ if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()
+ && mScrollWallpaper) {
mWallpaperOffset.syncWithScroll();
mWallpaperOffset.jumpToFinal();
}