diff options
author | 2012-04-11 18:21:10 +0900 | |
---|---|---|
committer | 2012-04-13 18:36:26 +0900 | |
commit | f6972561fcb45310f18230ce217f0c6bb57e7eee (patch) | |
tree | 85d9a39c849a394c1d7f04a8aa2415ebdcee02cb /java/src/com/android/inputmethod/latin/SettingsValues.java | |
parent | f338f8b50d276cfed2bafe6856792c675087ad15 (diff) | |
download | latinime-f6972561fcb45310f18230ce217f0c6bb57e7eee.tar.gz latinime-f6972561fcb45310f18230ce217f0c6bb57e7eee.tar.xz latinime-f6972561fcb45310f18230ce217f0c6bb57e7eee.zip |
Utilize InputMethodSubtype and additional subtype
* Remove de_QY and fr_CH from supported subtypes
* Add de-qwerty and fr-qwertz predefined additional subtypes instead.
Change-Id: I49e8ba0299529302f2b91b4d018b07304cdd6897
Diffstat (limited to 'java/src/com/android/inputmethod/latin/SettingsValues.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SettingsValues.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 526acf128..8ff644fc5 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -21,12 +21,14 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.util.Log; import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.keyboard.internal.KeySpecParser; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import java.util.ArrayList; import java.util.Arrays; +import java.util.Locale; /** * When you call the constructor of this class, you may want to change the current system locale by @@ -69,6 +71,7 @@ public class SettingsValues { private final int mVibrationDurationSettingsRawValue; @SuppressWarnings("unused") // TODO: Use this private final float mKeypressSoundVolumeRawValue; + private final InputMethodSubtype[] mPredefinedAdditionalSubtypes; // Deduced settings public final int mKeypressVibrationDuration; @@ -145,6 +148,16 @@ public class SettingsValues { mAutoCorrectionThresholdRawValue); mVoiceKeyEnabled = mVoiceMode != null && !mVoiceMode.equals(voiceModeOff); mVoiceKeyOnMain = mVoiceMode != null && mVoiceMode.equals(voiceModeMain); + + // Predefined additional subtypes + final InputMethodSubtype DE_QWERTY = AdditionalSubtype.createAddtionalSubtype( + Locale.GERMAN, AdditionalSubtype.QWERTY); + final InputMethodSubtype FR_QWERTZ = AdditionalSubtype.createAddtionalSubtype( + Locale.FRENCH, AdditionalSubtype.QWERTZ); + mPredefinedAdditionalSubtypes = new InputMethodSubtype[] { + DE_QWERTY, + FR_QWERTZ, + }; } // Helper functions to create member values. @@ -304,6 +317,11 @@ public class SettingsValues { return res.getBoolean(R.bool.config_use_fullscreen_mode); } + // TODO: Should be able to add/remove/edit. + public InputMethodSubtype[] getPrefefinedAdditionalSubtypes() { + return mPredefinedAdditionalSubtypes; + } + // Accessed from the settings interface, hence public public static float getCurrentKeypressSoundVolume(final SharedPreferences sp, final Resources res) { |