aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/values/dimens.xml2
-rw-r--r--java/res/xml-xlarge/kbd_number.xml12
-rw-r--r--java/res/xml-xlarge/kbd_phone.xml12
-rw-r--r--java/res/xml-xlarge/kbd_phone_symbols.xml12
-rw-r--r--java/res/xml-xlarge/kbd_qwerty_row4.xml10
-rw-r--r--java/res/xml-xlarge/kbd_symbols.xml10
-rw-r--r--java/res/xml-xlarge/kbd_symbols_shift.xml10
-rw-r--r--java/res/xml/prefs.xml7
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
-rw-r--r--java/src/com/android/inputmethod/latin/Settings.java26
10 files changed, 78 insertions, 28 deletions
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 504e007e0..7f00cdba3 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -51,7 +51,7 @@
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
<dimen name="candidate_strip_padding">0dip</dimen>
<dimen name="candidate_min_width">0.3in</dimen>
- <dimen name="candidate_padding">0dip</dimen>
+ <dimen name="candidate_padding">6dip</dimen>
<dimen name="candidate_text_size">18dip</dimen>
<dimen name="spacebar_vertical_correction">4dip</dimen>
<!-- If the screen height in landscape is larger than the below value, then the keyboard
diff --git a/java/res/xml-xlarge/kbd_number.xml b/java/res/xml-xlarge/kbd_number.xml
index 93bc1363a..c2cbb31c4 100644
--- a/java/res/xml-xlarge/kbd_number.xml
+++ b/java/res/xml-xlarge/kbd_number.xml
@@ -132,9 +132,15 @@
latin:keyLabel="0" />
<Key
latin:keyLabel="#" />
- <Key
- latin:keyStyle="micKeyStyle"
- latin:keyWidth="8.042%p" />
+ <switch>
+ <case
+ latin:voiceKeyEnabled="true"
+ >
+ <Key
+ latin:keyStyle="micKeyStyle"
+ latin:keyWidth="8.042%p" />
+ </case>
+ </switch>
<!-- There is an empty area bellow the "Enter" key and right of the "#" key. To ignore
the touch event on the area, "#" is intentionally not marked as a right edge key. -->
</Row>
diff --git a/java/res/xml-xlarge/kbd_phone.xml b/java/res/xml-xlarge/kbd_phone.xml
index 45c298362..c320ebbbc 100644
--- a/java/res/xml-xlarge/kbd_phone.xml
+++ b/java/res/xml-xlarge/kbd_phone.xml
@@ -140,9 +140,15 @@
latin:keyStyle="num0KeyStyle" />
<Key
latin:keyStyle="numPoundKeyStyle" />
- <Key
- latin:keyStyle="micKeyStyle"
- latin:keyWidth="8.042%p" />
+ <switch>
+ <case
+ latin:voiceKeyEnabled="true"
+ >
+ <Key
+ latin:keyStyle="micKeyStyle"
+ latin:keyWidth="8.042%p" />
+ </case>
+ </switch>
<!-- There is an empty area bellow the "Enter" key and right of the "#" key. To ignore
the touch event on the area, "#" is intentionally not marked as a right edge key. -->
</Row>
diff --git a/java/res/xml-xlarge/kbd_phone_symbols.xml b/java/res/xml-xlarge/kbd_phone_symbols.xml
index 891ceacbe..da15b5ad0 100644
--- a/java/res/xml-xlarge/kbd_phone_symbols.xml
+++ b/java/res/xml-xlarge/kbd_phone_symbols.xml
@@ -152,9 +152,15 @@
latin:keyStyle="num0KeyStyle" />
<Key
latin:keyStyle="numPoundKeyStyle" />
- <Key
- latin:keyStyle="micKeyStyle"
- latin:keyWidth="8.042%p" />
+ <switch>
+ <case
+ latin:voiceKeyEnabled="true"
+ >
+ <Key
+ latin:keyStyle="micKeyStyle"
+ latin:keyWidth="8.042%p" />
+ </case>
+ </switch>
<!-- There is an empty area bellow the "Enter" key and right of the "#" key. To ignore
the touch event on the area, "#" is intentionally not marked as a right edge key. -->
</Row>
diff --git a/java/res/xml-xlarge/kbd_qwerty_row4.xml b/java/res/xml-xlarge/kbd_qwerty_row4.xml
index e222a6bb0..98acfc162 100644
--- a/java/res/xml-xlarge/kbd_qwerty_row4.xml
+++ b/java/res/xml-xlarge/kbd_qwerty_row4.xml
@@ -114,7 +114,13 @@
latin:popupCharacters="_" />
</default>
</switch>
- <Key
- latin:keyStyle="micKeyStyle" />
+ <switch>
+ <case
+ latin:voiceKeyEnabled="true"
+ >
+ <Key
+ latin:keyStyle="micKeyStyle" />
+ </case>
+ </switch>
</Row>
</merge>
diff --git a/java/res/xml-xlarge/kbd_symbols.xml b/java/res/xml-xlarge/kbd_symbols.xml
index 50b8e5307..d804f7909 100644
--- a/java/res/xml-xlarge/kbd_symbols.xml
+++ b/java/res/xml-xlarge/kbd_symbols.xml
@@ -162,7 +162,13 @@
latin:popupCharacters="“,”,«,»,˝" />
<Key
latin:keyLabel="_" />
- <Key
- latin:keyStyle="micKeyStyle" />
+ <switch>
+ <case
+ latin:voiceKeyEnabled="true"
+ >
+ <Key
+ latin:keyStyle="micKeyStyle" />
+ </case>
+ </switch>
</Row>
</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_symbols_shift.xml b/java/res/xml-xlarge/kbd_symbols_shift.xml
index f586b1a28..db33aaaca 100644
--- a/java/res/xml-xlarge/kbd_symbols_shift.xml
+++ b/java/res/xml-xlarge/kbd_symbols_shift.xml
@@ -139,7 +139,13 @@
<Key
latin:keyStyle="spaceKeyStyle"
latin:keyWidth="37.454%p" />
- <Key
- latin:keyStyle="micKeyStyle" />
+ <switch>
+ <case
+ latin:voiceKeyEnabled="true"
+ >
+ <Key
+ latin:keyStyle="micKeyStyle" />
+ </case>
+ </switch>
</Row>
</Keyboard>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index 3b20298d2..9c780cb2d 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -70,15 +70,10 @@
android:defaultValue="@string/voice_mode_main"
/>
- <!-- TODO: Filter subtypes by IME in SubtypeEnabler -->
- <!-- TODO: Maybe use this only for phone? -->
<PreferenceScreen
android:key="subtype_settings"
android:title="@string/language_selection_title"
- android:summary="@string/language_selection_summary">
- <intent
- android:action="android.settings.INPUT_METHOD_AND_SUBTYPE_ENABLER"/>
- </PreferenceScreen>
+ android:summary="@string/language_selection_summary" />
<PreferenceCategory
android:title="@string/prediction_category"
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index addc6c782..5e701c1f0 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -25,9 +25,6 @@ import com.android.inputmethod.keyboard.LatinKeyboardView;
import com.android.inputmethod.latin.Utils.RingCharBuffer;
import com.android.inputmethod.voice.VoiceIMEConnector;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -37,7 +34,6 @@ import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.content.res.XmlResourceParser;
import android.inputmethodservice.InputMethodService;
import android.media.AudioManager;
import android.os.Debug;
@@ -74,7 +70,6 @@ import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import java.io.FileDescriptor;
-import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 3f604a381..8efeeda35 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,22 @@ 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 */ 10) {
+ 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)