summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-11-10 18:35:00 (GMT)
committerAdnan <adnan@cyngn.com>2014-11-19 23:53:57 (GMT)
commit707d1538836e2a65c0a1bb0157617e44f3ec81a2 (patch)
treec6ca9d6e1244680e9e409f45358e8771b1cf0c05
parent4c1a4c359ff31552a66453287ecee32940661352 (diff)
downloadandroid_packages_apps_Trebuchet-707d1538836e2a65c0a1bb0157617e44f3ec81a2.zip
android_packages_apps_Trebuchet-707d1538836e2a65c0a1bb0157617e44f3ec81a2.tar.gz
android_packages_apps_Trebuchet-707d1538836e2a65c0a1bb0157617e44f3ec81a2.tar.bz2
Move Scrolling Wallpaper to new Trebuchet Settings
Conflicts: src/com/android/launcher3/OverviewSettingsPanel.java src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java Change-Id: I57961ae9b6f0df334ddd2c4563ddfd7e2939f01e
-rw-r--r--res/values/cm_strings.xml3
-rw-r--r--src/com/android/launcher3/Workspace.java10
-rw-r--r--src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java37
3 files changed, 50 insertions, 0 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 23077db..dec9d7e 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -117,7 +117,10 @@
<!-- Settings states -->
<string name="setting_state_on">ON</string>
<string name="setting_state_off">OFF</string>
+ <!-- Themes button -->
<string name="themes_button_text">Themes</string>
+ <!-- Wallpaper scroll effect -->
+ <string name="scrolling_wallpaper">Scroll wallpaper</string>
<!-- Hidden states -->
<string name="hidden_folder">locked</string>
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 0820457..f2388ce 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -5290,6 +5290,16 @@ public class Workspace extends SmoothPagedView
TransitionEffect.setFromString(this, SettingsProvider.getString(mLauncher,
SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_TRANSITION_EFFECT,
R.string.preferences_interface_homescreen_scrolling_transition_effect));
+
+ 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();
+ }
}
public boolean getShowSearchBar() {
diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
index a762aca..6c0b09b 100644
--- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
+++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
@@ -130,6 +130,16 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.string.setting_state_on) : res.getString(
R.string.setting_state_off);
((TextView) v.findViewById(R.id.item_state)).setText(state);
+ } else if (title.equals(res.getString(R.string.scrolling_wallpaper))) {
+ boolean current = SettingsProvider
+ .getBoolean(
+ mContext,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL,
+ R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default);
+ String state = current ? res.getString(
+ R.string.setting_state_on) : res.getString(
+ R.string.setting_state_off);
+ ((TextView) v.findViewById(R.id.item_state)).setText(state);
} else {
((TextView) v.findViewById(R.id.item_state)).setText("");
}
@@ -241,6 +251,33 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
intent.setClassName(OverviewSettingsPanel.ANDROID_SETTINGS,
OverviewSettingsPanel.ANDROID_PROTECTED_APPS);
mLauncher.startActivity(intent);
+ } else if (value.equals(res
+ .getString(R.string.scrolling_wallpaper))) {
+ onSettingsBooleanChanged(
+ v,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_WALLPAPER_SCROLL,
+ R.bool.preferences_interface_homescreen_scrolling_wallpaper_scroll_default);
+ mLauncher.updateDynamicGrid();
+ } else if (value.equals(res
+ .getString(R.string.search_screen_left_text)) &&
+ ((Integer)v.getTag() == OverviewSettingsPanel.HOME_SETTINGS_POSITION)) {
+
+ boolean current = SettingsProvider.getBoolean(mContext,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH_SCREEN_LEFT,
+ R.bool.preferences_interface_homescreen_search_screen_left_default);
+
+ // If GEL integration is not supported, do not allow the user to turn it on.
+ if(!current && !mLauncher.isGelIntegrationSupported()) {
+ Toast.makeText(mLauncher.getApplicationContext(),
+ res.getString(R.string.preferences_search_screen_left_unsupported_toast),
+ Toast.LENGTH_SHORT).show();
+ } else {
+ onSettingsBooleanChanged(
+ v,
+ SettingsProvider.SETTINGS_UI_HOMESCREEN_SEARCH_SCREEN_LEFT,
+ R.bool.preferences_interface_homescreen_search_screen_left_default);
+ mLauncher.updateDynamicGrid();
+ }
}
View defaultHome = mLauncher.findViewById(R.id.default_home_screen_panel);