diff options
author | 2012-04-13 16:41:24 +0900 | |
---|---|---|
committer | 2012-04-19 19:33:51 +0900 | |
commit | c27fe6253c1d8b3ad3c2f891a48ec5c54d77a3f1 (patch) | |
tree | 59cb7776ae6eb07336d54e801bf516ed2d05c7b6 /java/src/com/android/inputmethod/latin/Settings.java | |
parent | 344af156744c6866090fb70f151efd66668c1e20 (diff) | |
download | latinime-c27fe6253c1d8b3ad3c2f891a48ec5c54d77a3f1.tar.gz latinime-c27fe6253c1d8b3ad3c2f891a48ec5c54d77a3f1.tar.xz latinime-c27fe6253c1d8b3ad3c2f891a48ec5c54d77a3f1.zip |
Add custom subtype settings
Bug: 4460018
Change-Id: I4919d79516dcf574be2761bbaf9adcdc381b2ddc
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Settings.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Settings.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 29825df7d..13264f7e8 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -33,6 +33,7 @@ import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.view.LayoutInflater; import android.view.View; +import android.view.inputmethod.InputMethodSubtype; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; @@ -255,6 +256,7 @@ public class Settings extends InputMethodSettingsFragment } updateShowCorrectionSuggestionsSummary(); updateKeyPreviewPopupDelaySummary(); + updateCustomInputStylesSummary(); } @Override @@ -294,6 +296,21 @@ public class Settings extends InputMethodSettingsFragment mShowCorrectionSuggestionsPreference.getValue())]); } + private void updateCustomInputStylesSummary() { + final PreferenceScreen customInputStyles = + (PreferenceScreen)findPreference(PREF_CUSTOM_INPUT_STYLES); + final SharedPreferences prefs = getPreferenceManager().getSharedPreferences(); + final String prefSubtype = SettingsValues.getPrefAdditionalSubtypes(prefs, getResources()); + final InputMethodSubtype[] subtypes = + AdditionalSubtype.createAdditionalSubtypesArray(prefSubtype); + final StringBuilder styles = new StringBuilder(); + for (final InputMethodSubtype subtype : subtypes) { + if (styles.length() > 0) styles.append(", "); + styles.append(SubtypeLocale.getFullDisplayName(subtype)); + } + customInputStyles.setSummary(styles); + } + private void updateKeyPreviewPopupDelaySummary() { final ListPreference lp = mKeyPreviewPopupDismissDelay; lp.setSummary(lp.getEntries()[lp.findIndexOfValue(lp.getValue())]); |