summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-06-03 07:29:05 -0700
committerEspen Fjellvær Olsen <espen@mrfjo.org>2013-01-03 09:45:45 +0100
commite668e5eff5fd7430dafd380e128933f39c4b5470 (patch)
tree1c8a6f8b3be8fb63eb9984d10708dac7dd04b9f2
parent81833c27d20ceda3142256f59152477ba4992148 (diff)
downloadpackages_apps_settings-e668e5eff5fd7430dafd380e128933f39c4b5470.zip
packages_apps_settings-e668e5eff5fd7430dafd380e128933f39c4b5470.tar.gz
packages_apps_settings-e668e5eff5fd7430dafd380e128933f39c4b5470.tar.bz2
settings: Add option to toggle the pointer icon when using stylus
Change-Id: Ib9c22ecb05cc698ead5bfffa34d2a2ffa9c21e13
-rw-r--r--res/values/strings.xml4
-rw-r--r--res/xml/language_settings.xml6
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java12
3 files changed, 22 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8e2fb11..d1d876f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5088,5 +5088,9 @@
<string name="lock_clock_title">Clock widget</string>
<string name="lock_clock_summary">View or change how the \'Chronus\' Home and Lock screen widgets will display</string>
+ <!-- Stylus Icon -->
+ <string name="stylus_icon_enabled_title">Show icon when using stylus</string>
+ <string name="stylus_icon_enabled_summary">Show the pointer icon when hovering or drawing with the stylus</string>
+
<!-- **** CYANOGENMOD ADDITIONS END **** -->
</resources>
diff --git a/res/xml/language_settings.xml b/res/xml/language_settings.xml
index 46d16dc..fafca6d 100644
--- a/res/xml/language_settings.xml
+++ b/res/xml/language_settings.xml
@@ -107,6 +107,12 @@
android:dialogTitle="@string/pointer_speed" />
</PreferenceCategory>
+ <CheckBoxPreference android:key="stylus_icon_enabled"
+ android:title="@string/stylus_icon_enabled_title"
+ android:summary="@string/stylus_icon_enabled_summary"
+ android:defaultValue="false"
+ android:persistent="false" />
+
<PreferenceCategory android:key="game_controller_settings_category"
android:title="@string/game_controller_settings_category">
<CheckBoxPreference
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 980450c..5ce6644 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -62,6 +62,7 @@ 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 VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control";
+ 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;
@@ -73,6 +74,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
"auto_replace", "auto_caps", "auto_punctuate",
};
+ private CheckBoxPreference mStylusIconEnabled;
private CheckBoxPreference mStatusBarImeSwitcher;
private int mDefaultInputMethodSelectorVisibility = 0;
private ListPreference mShowInputMethodSelectorPref;
@@ -183,6 +185,8 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
}
}
+ mStylusIconEnabled = (CheckBoxPreference) findPreference(KEY_STYLUS_ICON_ENABLED);
+
// Spell Checker
final Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClass(getActivity(), SpellCheckersSettingsActivity.class);
@@ -284,6 +288,11 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
Settings.System.STATUS_BAR_IME_SWITCHER, 1) != 0);
}
+ if (mStylusIconEnabled != null) {
+ mStylusIconEnabled.setChecked(Settings.System.getInt(getActivity().getContentResolver(),
+ Settings.System.STYLUS_ICON_ENABLED, 0) == 1);
+ }
+
// Hard keyboard
if (!mHardKeyboardPreferenceList.isEmpty()) {
for (int i = 0; i < sHardKeyboardKeys.length; ++i) {
@@ -341,6 +350,9 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
Settings.System.putInt(getActivity().getContentResolver(),
Settings.System.STATUS_BAR_IME_SWITCHER, mStatusBarImeSwitcher.isChecked() ? 1 : 0);
return true;
+ } else 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.