summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
diff options
context:
space:
mode:
authorfuzz <fuzzzzzzzzzzzzzzzzzz@gmail.com>2013-04-13 14:30:49 +0900
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-04-13 06:22:16 -0700
commitde0b076e849e7a3f0e57ab3ff6fe5f2128dd5087 (patch)
treedcc68c7acff6d804a2ff45f7edd8fcfd451e8052 /src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
parent4c51b45355b9d6fed973f946738bf455a8b7c9ea (diff)
downloadpackages_apps_settings-de0b076e849e7a3f0e57ab3ff6fe5f2128dd5087.zip
packages_apps_settings-de0b076e849e7a3f0e57ab3ff6fe5f2128dd5087.tar.gz
packages_apps_settings-de0b076e849e7a3f0e57ab3ff6fe5f2128dd5087.tar.bz2
inputmethod: Fixup remove stylus preference for non stylus devices
This commit included following changes * Move show stylus icon checkbox to Pointer Settings Category * Fixup issues stylus preference doesn't remove if not supported * Improve the code remove stylus preference if not supported * Remove an unnecessary variable introduced on http://review.cyanogenmod.org/#/c/33774/ Change-Id: I0f2e1b5cda00033915bb25902ce970f9eda52048
Diffstat (limited to 'src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index dcbe1d3..3b70708 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -39,6 +39,7 @@ import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceCategory;
+import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.provider.Settings.System;
@@ -62,8 +63,8 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
private static final String KEY_USER_DICTIONARY_SETTINGS = "key_user_dictionary_settings";
private static final String KEY_IME_SWITCHER = "status_bar_ime_switcher";
private static final String KEY_VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control";
+ private static final String KEY_POINTER_SETTINGS_CATEGORY = "pointer_settings_category";
private static final String KEY_STYLUS_ICON_ENABLED = "stylus_icon_enabled";
- private static final String VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control";
private static final String KEY_STYLUS_GESTURES = "stylus_gestures";
// false: on ICS or later
@@ -85,6 +86,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
private PreferenceCategory mHardKeyboardCategory;
private PreferenceCategory mGameControllerCategory;
private Preference mLanguagePref;
+ private PreferenceScreen mStylusGestures;
private final ArrayList<InputMethodPreference> mInputMethodPreferenceList =
new ArrayList<InputMethodPreference>();
private final ArrayList<PreferenceScreen> mHardKeyboardPreferenceList =
@@ -188,11 +190,14 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
}
}
+ mStylusGestures = (PreferenceScreen) findPreference(KEY_STYLUS_GESTURES);
mStylusIconEnabled = (CheckBoxPreference) findPreference(KEY_STYLUS_ICON_ENABLED);
// remove stylus preference for non stylus devices
if (!getResources().getBoolean(com.android.internal.R.bool.config_stylusGestures)) {
- getPreferenceScreen().removePreference(findPreference(KEY_STYLUS_GESTURES));
- mStylusIconEnabled = null;
+ PreferenceGroup pointerSettingsCategory = (PreferenceGroup)
+ findPreference(KEY_POINTER_SETTINGS_CATEGORY);
+ pointerSettingsCategory.removePreference(mStylusGestures);
+ pointerSettingsCategory.removePreference(mStylusIconEnabled);
}
// Spell Checker