aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Settings.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-01-14 14:02:46 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-01-14 14:21:12 +0900
commit41f7fb51b0966d76a70e8b927ab4f0f21b70107b (patch)
tree5ce3c1c30f15a970e4587154bc82255a583efc26 /java/src/com/android/inputmethod/latin/Settings.java
parenteead8c83119ac3941a759e02ec98f7bc56b7a19a (diff)
downloadlatinime-41f7fb51b0966d76a70e8b927ab4f0f21b70107b.tar.gz
latinime-41f7fb51b0966d76a70e8b927ab4f0f21b70107b.tar.xz
latinime-41f7fb51b0966d76a70e8b927ab4f0f21b70107b.zip
Make input language selection settings work
This change also tweaks the padding of candidate strip for phone. Change-Id: Iefe4dfeb7015e11d5b2d1566121f719d60b1377e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Settings.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Settings.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 3f604a381..4a8b34ce4 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -23,13 +23,17 @@ import android.app.AlertDialog;
import android.app.Dialog;
import android.app.backup.BackupManager;
import android.content.DialogInterface;
+import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Vibrator;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
import android.speech.SpeechRecognizer;
import android.text.AutoText;
import android.text.TextUtils;
@@ -41,7 +45,7 @@ import java.util.Locale;
public class Settings extends PreferenceActivity
implements SharedPreferences.OnSharedPreferenceChangeListener,
- DialogInterface.OnDismissListener {
+ DialogInterface.OnDismissListener, OnPreferenceClickListener {
private static final String TAG = "Settings";
public static final String PREF_VIBRATE_ON = "vibrate_on";
@@ -64,6 +68,7 @@ public class Settings extends PreferenceActivity
// Dialog ids
private static final int VOICE_INPUT_CONFIRM_DIALOG = 0;
+ private PreferenceScreen mInputLanguageSelection;
private CheckBoxPreference mQuickFixes;
private ListPreference mVoicePreference;
private ListPreference mSettingsKeyPreference;
@@ -84,10 +89,13 @@ public class Settings extends PreferenceActivity
final String currentSetting = mAutoCorrectionThreshold.getValue();
mBigramSuggestion.setEnabled(!currentSetting.equals(autoCorrectionOff));
}
+
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.prefs);
+ mInputLanguageSelection = (PreferenceScreen) findPreference(PREF_SUBTYPES);
+ mInputLanguageSelection.setOnPreferenceClickListener(this);
mQuickFixes = (CheckBoxPreference) findPreference(PREF_QUICK_FIXES);
mVoicePreference = (ListPreference) findPreference(PREF_VOICE_SETTINGS_KEY);
mSettingsKeyPreference = (ListPreference) findPreference(PREF_SETTINGS_KEY);
@@ -169,6 +177,21 @@ public class Settings extends PreferenceActivity
updateSettingsKeySummary();
}
+ @Override
+ public boolean onPreferenceClick(Preference pref) {
+ if (pref == mInputLanguageSelection) {
+ final String action;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
+ action = "android.settings.INPUT_METHOD_AND_SUBTYPE_ENABLER";
+ } else {
+ action = "com.android.inputmethod.latin.INPUT_LANGUAGE_SELECTION";
+ }
+ startActivity(new Intent(action));
+ return true;
+ }
+ return false;
+ }
+
private void updateSettingsKeySummary() {
mSettingsKeyPreference.setSummary(
getResources().getStringArray(R.array.settings_key_modes)