diff options
Diffstat (limited to 'src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java')
-rw-r--r-- | src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java index 102c703..980450c 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java +++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java @@ -61,6 +61,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment private static final String KEY_INPUT_METHOD_SELECTOR = "input_method_selector"; 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"; // false: on ICS or later private static final boolean SHOW_INPUT_METHOD_SWITCHER_SETTINGS = false; @@ -91,6 +92,7 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment @SuppressWarnings("unused") private SettingsObserver mSettingsObserver; private Intent mIntentWaitingForResult; + private ListPreference mVolumeKeyCursorControl; @Override public void onCreate(Bundle icicle) { @@ -190,6 +192,14 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment scp.setFragmentIntent(this, intent); } + mVolumeKeyCursorControl = (ListPreference) findPreference(VOLUME_KEY_CURSOR_CONTROL); + if(mVolumeKeyCursorControl != null) { + mVolumeKeyCursorControl.setOnPreferenceChangeListener(this); + mVolumeKeyCursorControl.setValue(Integer.toString(Settings.System.getInt(getActivity() + .getContentResolver(), Settings.System.VOLUME_KEY_CURSOR_CONTROL, 0))); + mVolumeKeyCursorControl.setSummary(mVolumeKeyCursorControl.getEntry()); + } + mHandler = new Handler(); mSettingsObserver = new SettingsObserver(mHandler, getActivity()); } @@ -398,6 +408,15 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment } } } + if (preference == mVolumeKeyCursorControl) { + String volumeKeyCursorControl = (String) value; + int val = Integer.parseInt(volumeKeyCursorControl); + Settings.System.putInt(getActivity().getContentResolver(), + Settings.System.VOLUME_KEY_CURSOR_CONTROL, val); + int index = mVolumeKeyCursorControl.findIndexOfValue(volumeKeyCursorControl); + mVolumeKeyCursorControl.setSummary(mVolumeKeyCursorControl.getEntries()[index]); + return true; + } return false; } |