diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-12-19 21:41:09 +0000 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-19 21:41:09 +0000 |
commit | 62d0f2dc6df3fb1acbe154e5fb1d369585290368 (patch) | |
tree | 38594d3f5d209528cffb3f67da8472f3f61eb1bc | |
parent | c6383d8946a76a94b1714d92fd9abb9bb0b34102 (diff) | |
download | packages_apps_trebuchet-62d0f2dc6df3fb1acbe154e5fb1d369585290368.zip packages_apps_trebuchet-62d0f2dc6df3fb1acbe154e5fb1d369585290368.tar.gz packages_apps_trebuchet-62d0f2dc6df3fb1acbe154e5fb1d369585290368.tar.bz2 |
Workspace: Wallpaper Size
Change-Id: I5bb894de9647e6acd8a82fae508bd251d9263137
-rw-r--r-- | res/values/strings.xml | 2 | ||||
-rw-r--r-- | res/xml/preferences_homescreen.xml | 6 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/PagedView.java | 2 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Workspace.java | 14 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java | 3 |
5 files changed, 24 insertions, 3 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 2223fe3..b795b49 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -329,6 +329,8 @@ s --> <string name="preferences_interface_homescreen_scrolling_scroll_wallpaper_summary">Scroll wallpaper when scrolling homescreens</string> <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_title">Wallpaper quick render</string> <string name="preferences_interface_homescreen_scrolling_wallpaper_hack_summary">Use wallpaper hack that increases smoothness on static image wallpapers</string> + <string name="preferences_interface_homescreen_scrolling_wallpaper_size_title">Wallapaper size</string> + <string name="preferences_interface_homescreen_scrolling_wallpaper_size_summary">How many screens wide the wallpaper should be</string> <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_title">Fade side screens</string> <string name="preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary">Fade the side screens when scrolling homescreens</string> <string name="preferences_interface_homescreen_scrolling_show_outlines_title">Show outlines</string> diff --git a/res/xml/preferences_homescreen.xml b/res/xml/preferences_homescreen.xml index c1996bc..785a564 100644 --- a/res/xml/preferences_homescreen.xml +++ b/res/xml/preferences_homescreen.xml @@ -72,6 +72,12 @@ android:title="@string/preferences_interface_homescreen_scrolling_wallpaper_hack_title" android:summary="@string/preferences_interface_homescreen_scrolling_wallpaper_hack_summary" android:defaultValue="false" /> + <com.cyanogenmod.trebuchet.preference.NumberPickerPreference android:key="ui_homescreen_scrolling_wallpaper_size" + android:title="@string/preferences_interface_homescreen_scrolling_wallpaper_size_title" + android:summary="@string/preferences_interface_homescreen_scrolling_wallpaper_size_summary" + android:defaultValue="2" + launcher:max="5" + launcher:min="2" /> <CheckBoxPreference android:key="ui_homescreen_scrolling_fade_adjacent_screens" android:title="@string/preferences_interface_homescreen_scrolling_fade_adjacent_screens_title" android:summary="@string/preferences_interface_homescreen_scrolling_fade_adjacent_screens_summary" diff --git a/src/com/cyanogenmod/trebuchet/PagedView.java b/src/com/cyanogenmod/trebuchet/PagedView.java index 50c0ff2..0bc1e1b 100644 --- a/src/com/cyanogenmod/trebuchet/PagedView.java +++ b/src/com/cyanogenmod/trebuchet/PagedView.java @@ -468,8 +468,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc || getScrollY() != mScroller.getCurrY() || mOverScrollX != mScroller.getCurrX()) { scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); + invalidate(); } - invalidate(); return true; } else if (mNextPage != INVALID_PAGE) { mCurrentPage = Math.max(0, Math.min(mNextPage, getPageCount() - 1)); diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java index a6a440b..b08c8d8 100644 --- a/src/com/cyanogenmod/trebuchet/Workspace.java +++ b/src/com/cyanogenmod/trebuchet/Workspace.java @@ -317,6 +317,7 @@ public class Workspace extends SmoothPagedView private boolean mResizeAnyWidget; private boolean mHideIconLabels; private boolean mScrollWallpaper; + private int mWallpaperSize; private boolean mShowScrollingIndicator; private boolean mFadeScrollingIndicator; private int mScrollingIndicatorPosition; @@ -407,6 +408,7 @@ public class Workspace extends SmoothPagedView res.getString(R.string.config_workspaceDefaultTransitionEffect)); mScrollWallpaper = PreferencesProvider.Interface.Homescreen.Scrolling.getScrollWallpaper(); mWallpaperHack = PreferencesProvider.Interface.Homescreen.Scrolling.getWallpaperHack(); + mWallpaperSize = PreferencesProvider.Interface.Homescreen.Scrolling.getWallpaperSize(); mShowOutlines = PreferencesProvider.Interface.Homescreen.Scrolling.getShowOutlines( res.getBoolean(R.bool.config_workspaceDefaultShowOutlines)); mFadeInAdjacentScreens = PreferencesProvider.Interface.Homescreen.Scrolling.getFadeInAdjacentScreens( @@ -1046,12 +1048,14 @@ public class Workspace extends SmoothPagedView mWallpaperWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim)); mWallpaperHeight = maxDim; } else { - mWallpaperWidth = Math.max((int) (minDim * DEFAULT_WALLPAPER_SCREENS_SPAN), maxDim); + int screens = mWallpaperSize; + mWallpaperWidth = Math.max((int) (minDim * screens), maxDim); mWallpaperHeight = maxDim; } new Thread("setWallpaperDimension") { public void run() { mWallpaperManager.suggestDesiredDimensions(mWallpaperWidth, mWallpaperHeight); + checkWallpaper(); } }.start(); } @@ -1205,6 +1209,13 @@ public class Workspace extends SmoothPagedView mIsMovingFast = false; return false; } + + // Don't have any lag between workspace and wallpaper on non-large devices + if (!LauncherApplication.isScreenLarge()) { + mHorizontalWallpaperOffset = mFinalHorizontalWallpaperOffset; + return true; + } + boolean isLandscape = mDisplaySize.x > mDisplaySize.y; long currentTime = System.currentTimeMillis(); @@ -1233,7 +1244,6 @@ public class Workspace extends SmoothPagedView float hOffsetDelta = mFinalHorizontalWallpaperOffset - mHorizontalWallpaperOffset; boolean jumpToFinalValue = Math.abs(hOffsetDelta) < UPDATE_THRESHOLD; - // Don't have any lag between workspace and wallpaper on non-large devices if (!LauncherApplication.isScreenLarge() || jumpToFinalValue) { mHorizontalWallpaperOffset = mFinalHorizontalWallpaperOffset; } else { diff --git a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java index cf989f0..be9d5f3 100644 --- a/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java +++ b/src/com/cyanogenmod/trebuchet/preference/PreferencesProvider.java @@ -111,6 +111,9 @@ public final class PreferencesProvider { public static boolean getWallpaperHack() { return getBoolean("ui_homescreen_scrolling_wallpaper_hack", false); } + public static int getWallpaperSize() { + return getInt("ui_homescreen_scrolling_wallpaper_size", 2); + } public static boolean getFadeInAdjacentScreens(boolean def) { return getBoolean("ui_homescreen_scrolling_fade_adjacent_screens", def); } |