summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblack <blackzigong@gmail.com>2014-11-10 18:35:00 (GMT)
committerAdnan <adnan@cyngn.com>2014-11-19 23:53:57 (GMT)
commit5dc390cde4aa6efc41e145610bb993e4754fd440 (patch)
tree01532187f6d4a6029ce7819e8a11cb11158c400a
parent7360319a4322bc042a3cad30030070273a8d6c80 (diff)
downloadandroid_packages_apps_Trebuchet-5dc390cde4aa6efc41e145610bb993e4754fd440.zip
android_packages_apps_Trebuchet-5dc390cde4aa6efc41e145610bb993e4754fd440.tar.gz
android_packages_apps_Trebuchet-5dc390cde4aa6efc41e145610bb993e4754fd440.tar.bz2
Trebuchet: Change icon labels option strings
Conflicts: src/com/android/launcher3/OverviewSettingsPanel.java Change-Id: I499ec846bf2c7b2dc1c0d39c2c62a2525412335c
-rw-r--r--res/values/cm_strings.xml6
-rw-r--r--src/com/android/launcher3/OverviewSettingsPanel.java28
-rw-r--r--src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java38
3 files changed, 54 insertions, 18 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index c8e14ab..ef1d3d0 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -105,8 +105,10 @@
<!-- Larger icons -->
<string name="larger_icons_text">Larger icons</string>
- <!-- Hide icon labels -->
- <string name="hide_icon_labels">Hide icon labels</string>
+ <!-- Icon labels -->
+ <string name="icon_labels">Icon labels</string>
+ <string name="icon_labels_show">Show</string>
+ <string name="icon_labels_hide">Hide</string>
<!-- Protected apps -->
<string name="protected_app_settings">Protected apps</string>
diff --git a/src/com/android/launcher3/OverviewSettingsPanel.java b/src/com/android/launcher3/OverviewSettingsPanel.java
index e104d20..9fe1d7e 100644
--- a/src/com/android/launcher3/OverviewSettingsPanel.java
+++ b/src/com/android/launcher3/OverviewSettingsPanel.java
@@ -40,15 +40,31 @@ public class OverviewSettingsPanel {
String[] headers = new String[] {
res.getString(R.string.home_screen_settings),
res.getString(R.string.drawer_settings)};
- String[] values = new String[] {
- res.getString(R.string.home_screen_search_text),
- res.getString(R.string.scroll_effect_text),
- res.getString(R.string.larger_icons_text),
- res.getString(R.string.hide_icon_labels)};
+
+ String[] values;
+ if(mLauncher.isGelIntegrationSupported()) {
+ values = new String[]{
+ res.getString(R.string.home_screen_search_text),
+ res.getString(R.string.search_screen_left_text),
+ res.getString(R.string.scroll_effect_text),
+ res.getString(R.string.larger_icons_text),
+ res.getString(R.string.icon_labels),
+ res.getString(R.string.scrolling_wallpaper)};
+ } else {
+ values = new String[]{
+ res.getString(R.string.home_screen_search_text),
+ res.getString(R.string.scroll_effect_text),
+ res.getString(R.string.larger_icons_text),
+ res.getString(R.string.icon_labels),
+ res.getString(R.string.scrolling_wallpaper)};
+ }
+
+ mValues = values;
+
String[] valuesDrawer = new String[] {
res.getString(R.string.scroll_effect_text),
res.getString(R.string.drawer_sorting_text),
- res.getString(R.string.hide_icon_labels),
+ res.getString(R.string.icon_labels),
res.getString(R.string.protected_app_settings)};
mSettingsAdapter = new SettingsPinnedHeaderAdapter(mLauncher);
diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
index 22bfb60..fe0567b 100644
--- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
+++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
@@ -101,15 +101,15 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.string.setting_state_off);
((TextView) v.findViewById(R.id.item_state)).setText(state);
} else if (title.equals(res
- .getString(R.string.hide_icon_labels)) &&
+ .getString(R.string.icon_labels)) &&
partition == OverviewSettingsPanel.HOME_SETTINGS_POSITION) {
boolean current = mLauncher.shouldHideWorkspaceIconLables();
String state = current ? res.getString(
- R.string.setting_state_on) : res.getString(
- R.string.setting_state_off);
+ R.string.icon_labels_hide) : res.getString(
+ R.string.icon_labels_show);
((TextView) v.findViewById(R.id.item_state)).setText(state);
} else if (title.equals(res
- .getString(R.string.hide_icon_labels)) &&
+ .getString(R.string.icon_labels)) &&
partition == OverviewSettingsPanel.DRAWER_SETTINGS_POSITION) {
boolean current = SettingsProvider
.getBoolean(
@@ -117,8 +117,8 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
SettingsProvider.SETTINGS_UI_DRAWER_HIDE_ICON_LABELS,
R.bool.preferences_interface_drawer_hide_icon_labels_default);
String state = current ? res.getString(
- R.string.setting_state_on) : res.getString(
- R.string.setting_state_off);
+ R.string.icon_labels_hide) : res.getString(
+ R.string.icon_labels_show);
((TextView) v.findViewById(R.id.item_state)).setText(state);
} else if (title.equals(res
.getString(R.string.search_screen_left_text))) {
@@ -232,17 +232,17 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.bool.preferences_interface_general_icons_large_default);
mLauncher.updateDynamicGrid();
} else if (value.equals(res
- .getString(R.string.hide_icon_labels)) &&
+ .getString(R.string.icon_labels)) &&
((Integer)v.getTag() == OverviewSettingsPanel.HOME_SETTINGS_POSITION)) {
- onSettingsBooleanChanged(
+ onIconLabelsBooleanChanged(
v,
SettingsProvider.SETTINGS_UI_HOMESCREEN_HIDE_ICON_LABELS,
R.bool.preferences_interface_homescreen_hide_icon_labels_default);
mLauncher.updateDynamicGrid();
} else if (value.equals(res
- .getString(R.string.hide_icon_labels)) &&
+ .getString(R.string.icon_labels)) &&
((Integer)v.getTag() == OverviewSettingsPanel.DRAWER_SETTINGS_POSITION)) {
- onSettingsBooleanChanged(
+ onIconLabelsBooleanChanged(
v,
SettingsProvider.SETTINGS_UI_DRAWER_HIDE_ICON_LABELS,
R.bool.preferences_interface_drawer_hide_icon_labels_default);
@@ -304,6 +304,24 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
((TextView) v.findViewById(R.id.item_state)).setText(state);
}
+ private void onIconLabelsBooleanChanged(View v, String key, int res) {
+ boolean current = SettingsProvider.getBoolean(
+ mContext, key, res);
+
+ // Set new state
+ SharedPreferences sharedPref = SettingsProvider
+ .get(mContext);
+ sharedPref.edit().putBoolean(key, !current).commit();
+ sharedPref.edit()
+ .putBoolean(SettingsProvider.SETTINGS_CHANGED, true)
+ .commit();
+
+ String state = current ? mLauncher.getResources().getString(
+ R.string.icon_labels_show) : mLauncher.getResources().getString(
+ R.string.icon_labels_hide);
+ ((TextView) v.findViewById(R.id.item_state)).setText(state);
+ }
+
private void onClickTransitionEffectButton() {
int sort = SettingsProvider.getIntCustomDefault(mLauncher,
SettingsProvider.SETTINGS_UI_DRAWER_SORT_MODE, 0);