summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2015-02-02 16:23:15 -0500
committerAdnan Begovic <adnan@cyngn.com>2015-10-29 17:36:30 -0700
commit925ea3a6a395e5c3e69be053c8a47c3f546c2889 (patch)
tree1e50564d7c88e35f2bc1dc2fd36effddda7c8b81 /src/com/android/settings/inputmethod
parent376cb194f5ecb8e26e80aa93d02236941d7aa369 (diff)
downloadpackages_apps_Settings-925ea3a6a395e5c3e69be053c8a47c3f546c2889.zip
packages_apps_Settings-925ea3a6a395e5c3e69be053c8a47c3f546c2889.tar.gz
packages_apps_Settings-925ea3a6a395e5c3e69be053c8a47c3f546c2889.tar.bz2
settings: Add option to toggle the pointer icon when using stylus(1/3)
Forward port from CM-11.0 Change-Id: I43ce881b91f2a7d58acaa3225818997c4e4e364f
Diffstat (limited to 'src/com/android/settings/inputmethod')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 6288fb2..bc50d4f 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -90,11 +90,14 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
private static final String KEY_TRACKPAD_SETTINGS = "gesture_pad_settings";
private static final String KEY_HIGH_TOUCH_SENSITIVITY = "high_touch_sensitivity";
private static final String KEY_STYLUS_GESTURES = "stylus_gestures";
+ private static final String KEY_STYLUS_ICON_ENABLED = "stylus_icon_enabled";
+
// false: on ICS or later
private static final boolean SHOW_INPUT_METHOD_SWITCHER_SETTINGS = false;
private int mDefaultInputMethodSelectorVisibility = 0;
private ListPreference mShowInputMethodSelectorPref;
+ private SwitchPreference mStylusIconEnabled;
private SwitchPreference mHighTouchSensitivity;
private PreferenceCategory mKeyboardSettingsCategory;
private PreferenceCategory mHardKeyboardCategory;
@@ -178,11 +181,13 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
findPreference(KEY_POINTER_SETTINGS_CATEGORY);
mStylusGestures = (PreferenceScreen) findPreference(KEY_STYLUS_GESTURES);
+ mStylusIconEnabled = (SwitchPreference) findPreference(KEY_STYLUS_ICON_ENABLED);
mHighTouchSensitivity = (SwitchPreference) findPreference(KEY_HIGH_TOUCH_SENSITIVITY);
if (pointerSettingsCategory != null) {
if (!getResources().getBoolean(com.android.internal.R.bool.config_stylusGestures)) {
pointerSettingsCategory.removePreference(mStylusGestures);
+ pointerSettingsCategory.removePreference(mStylusIconEnabled);
}
if (!isHighTouchSensitivitySupported()) {
@@ -304,6 +309,11 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
}
}
+ if (mStylusIconEnabled != null) {
+ mStylusIconEnabled.setChecked(Settings.System.getInt(getActivity().getContentResolver(),
+ Settings.System.STYLUS_ICON_ENABLED, 0) == 1);
+ }
+
if (!mShowsOnlyFullImeAndKeyboardList) {
if (mLanguagePref != null) {
String localeName = getLocaleName(getActivity());
@@ -361,7 +371,10 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
if (Utils.isMonkeyRunning()) {
return false;
}
- if (preference instanceof PreferenceScreen) {
+ if (preference == mStylusIconEnabled) {
+ Settings.System.putInt(getActivity().getContentResolver(),
+ Settings.System.STYLUS_ICON_ENABLED, mStylusIconEnabled.isChecked() ? 1 : 0);
+ } else if (preference instanceof PreferenceScreen) {
if (preference.getFragment() != null) {
// Fragment will be handled correctly by the super class.
} else if (KEY_CURRENT_INPUT_METHOD.equals(preference.getKey())) {