diff options
Diffstat (limited to 'java')
9 files changed, 31 insertions, 211 deletions
diff --git a/java/res/drawable/btn_center.xml b/java/res/drawable/btn_center.xml index 9998b56e2..19b298f75 100644 --- a/java/res/drawable/btn_center.xml +++ b/java/res/drawable/btn_center.xml @@ -19,8 +19,7 @@ --> <selector - xmlns:android="http://schemas.android.com/apk/res/android" - android:exitFadeDuration="@android:integer/config_mediumAnimTime"> + xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:state_enabled="true" @@ -37,4 +36,4 @@ android:drawable="@drawable/btn_center_default" /> <item android:drawable="@drawable/btn_center_default" /> -</selector>
\ No newline at end of file +</selector> diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index 66dc7d71c..e19203e6c 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -31,7 +31,7 @@ <!-- Option to play back sound on keypress in soft keyboard --> <string name="sound_on_keypress">Sound on keypress</string> - <!-- Option to control whether or not to show a popup with a larger font on each key press. --> + <!-- Option to pop up the character with a larger font above soft keyboard --> <string name="popup_on_keypress">Popup on keypress</string> <!-- Category title for general settings for Android keyboard --> diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 1374338b4..a9883b118 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -29,195 +29,4 @@ <input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="com.android.inputmethod.latin.Settings" android:isDefault="@bool/im_is_default"> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_en_US_keyboard" - android:imeSubtypeLocale="en_US" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_en_voice" - android:imeSubtypeLocale="en" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_en_GB_keyboard" - android:imeSubtypeLocale="en_GB" - android:imeSubtypeMode="keyboard" - /> - <!-- The file for Arabic layout is an alpha version. It needs to be run through UX. --> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_ar_keyboard" - android:imeSubtypeLocale="ar" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_cs_keyboard" - android:imeSubtypeLocale="cs" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_cs_voice" - android:imeSubtypeLocale="cs" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_da_keyboard" - android:imeSubtypeLocale="da" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_de_keyboard" - android:imeSubtypeLocale="de" - android:imeSubtypeMode="keyboard" - android:imeSubtypeExtraValue="requiresGermanUmlautProcessing" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_de_voice" - android:imeSubtypeLocale="de" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_es_keyboard" - android:imeSubtypeLocale="es" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_es_voice" - android:imeSubtypeLocale="es" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_fr_keyboard" - android:imeSubtypeLocale="fr" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_fr_voice" - android:imeSubtypeLocale="fr" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_fr_CA_keyboard" - android:imeSubtypeLocale="fr_CA" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_fr_CH_keyboard" - android:imeSubtypeLocale="fr_CH" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_it_keyboard" - android:imeSubtypeLocale="it" - android:imeSubtypeMode="keyboard" - /> - <!-- Java uses the deprecated "iw" code instead of the standard "he" code for Hebrew. --> - <!-- The file for Hebrew layout is an alpha version. It needs to be run through UX. --> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_iw_keyboard" - android:imeSubtypeLocale="iw" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_it_voice" - android:imeSubtypeLocale="it" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_nb_keyboard" - android:imeSubtypeLocale="nb" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_nl_keyboard" - android:imeSubtypeLocale="nl" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_nl_voice" - android:imeSubtypeLocale="nl" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_ru_keyboard" - android:imeSubtypeLocale="ru" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_sr_keyboard" - android:imeSubtypeLocale="sr" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_keyboard" - android:label="@string/subtype_mode_sv_keyboard" - android:imeSubtypeLocale="sv" - android:imeSubtypeMode="keyboard" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_af_voice" - android:imeSubtypeLocale="af" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_ja_voice" - android:imeSubtypeLocale="ja" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_ko_voice" - android:imeSubtypeLocale="ko" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_pl_voice" - android:imeSubtypeLocale="pl" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_pt_voice" - android:imeSubtypeLocale="pt" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_ru_voice" - android:imeSubtypeLocale="ru" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_tr_voice" - android:imeSubtypeLocale="tr" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_yue_voice" - android:imeSubtypeLocale="yue" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_zh_voice" - android:imeSubtypeLocale="zh" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> - <subtype android:icon="@drawable/ic_subtype_mic" - android:label="@string/subtype_mode_zu_voice" - android:imeSubtypeLocale="zu" - android:imeSubtypeMode="voice" - android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" - /> </input-method> diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml index d031415d7..06fa02303 100644 --- a/java/res/xml/prefs.xml +++ b/java/res/xml/prefs.xml @@ -130,4 +130,11 @@ android:defaultValue="false" /> + <CheckBoxPreference + android:key="debug_mode" + android:title="Debug Mode" + android:persistent="true" + android:defaultValue="false" + /> + </PreferenceScreen> diff --git a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java index d1747ba5f..e0d54da3b 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java @@ -100,8 +100,7 @@ public class InputMethodManagerCompatWrapper { } public boolean switchToLastInputMethod(IBinder token) { - if (mImm == null) return false; - return mImm.switchToLastInputMethod(token); + return false; } public List<InputMethodInfoCompatWrapper> getEnabledInputMethodList() { diff --git a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java index e02aac704..88167ae74 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java @@ -20,7 +20,7 @@ import com.android.inputmethod.latin.SubtypeSwitcher; import android.inputmethodservice.InputMethodService; import android.view.View; -import android.view.inputmethod.InputMethodSubtype; +// import android.view.inputmethod.InputMethodSubtype; import android.widget.HorizontalScrollView; import java.lang.reflect.Field; @@ -38,7 +38,7 @@ public class InputMethodServiceCompatWrapper extends InputMethodService { // For the API level 11 or later, LatinIME should override onCurrentInputMethodSubtypeChanged(). // For the API level 10 or previous, we handle the "subtype changed" events by ourselves // without having support from framework -- onCurrentInputMethodSubtypeChanged(). - private static final boolean CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED = true; + private static final boolean CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED = false; private InputMethodManagerCompatWrapper mImm; @@ -76,17 +76,17 @@ public class InputMethodServiceCompatWrapper extends InputMethodService { ////////////////////////////////////// // Functions using API v11 or later // ////////////////////////////////////// - @Override + /*@Override public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype) { // Do nothing when the API level is 10 or previous if (!CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED) return; SubtypeSwitcher.getInstance().updateSubtype( new InputMethodSubtypeCompatWrapper(subtype)); - } + }*/ protected static void setTouchableRegionCompat(InputMethodService.Insets outInsets, int x, int y, int width, int height) { - outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION; - outInsets.touchableRegion.set(x, y, width, height); + //outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION; + //outInsets.touchableRegion.set(x, y, width, height); } } diff --git a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java index ce031eea5..90b7df949 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java @@ -27,6 +27,8 @@ import java.lang.reflect.Method; public final class InputMethodSubtypeCompatWrapper extends AbstractCompatWrapper { private static final boolean DBG = LatinImeLogger.sDBG; private static final String TAG = InputMethodSubtypeCompatWrapper.class.getSimpleName(); + private static final String DEFAULT_LOCALE = "en_US"; + private static final String DEFAULT_MODE = "keyboard"; public static final Class<?> CLASS_InputMethodSubtype = CompatUtils.getClass("android.view.inputmethod.InputMethodSubtype"); @@ -61,11 +63,15 @@ public final class InputMethodSubtypeCompatWrapper extends AbstractCompatWrapper } public String getLocale() { - return (String)CompatUtils.invoke(mObj, null, METHOD_getLocale); + final String s = (String)CompatUtils.invoke(mObj, null, METHOD_getLocale); + if (s == null) return DEFAULT_LOCALE; + return s; } public String getMode() { - return (String)CompatUtils.invoke(mObj, null, METHOD_getMode); + String s = (String)CompatUtils.invoke(mObj, null, METHOD_getMode); + if (s == null) return DEFAULT_MODE; + return s; } public String getExtraValue() { @@ -73,7 +79,7 @@ public final class InputMethodSubtypeCompatWrapper extends AbstractCompatWrapper } public boolean containsExtraValueKey(String key) { - return (Boolean)CompatUtils.invoke(mObj, null, METHOD_containsExtraValueKey, key); + return (Boolean)CompatUtils.invoke(mObj, false, METHOD_containsExtraValueKey, key); } public String getExtraValueOf(String key) { diff --git a/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java index 394193c9e..3f59ad099 100644 --- a/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java +++ b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java @@ -212,13 +212,13 @@ public class VoiceInputLogger { setHasLoggingInfo(true); Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED); i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, suggestionLength); - i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_REPLACED_LENGTH, replacedPhraseLength); + i.putExtra("length", replacedPhraseLength); i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE, LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_CHOOSE_SUGGESTION); i.putExtra(LoggingEvents.VoiceIme.EXTRA_N_BEST_CHOOSE_INDEX, index); - i.putExtra(LoggingEvents.VoiceIme.EXTRA_BEFORE_N_BEST_CHOOSE, before); - i.putExtra(LoggingEvents.VoiceIme.EXTRA_AFTER_N_BEST_CHOOSE, after); + i.putExtra("before", before); + i.putExtra("after", after); mContext.sendBroadcast(i); } @@ -257,7 +257,7 @@ public class VoiceInputLogger { // 2. type subject in subject field // 3. speak message in message field // 4. press send - UserHappinessSignals.setHasVoiceLoggingInfo(hasLoggingInfo); + // UserHappinessSignals.setHasVoiceLoggingInfo(hasLoggingInfo); } private boolean hasLoggingInfo(){ diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index bac84888d..6610a65ef 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -210,7 +210,7 @@ public class SubtypeSwitcher { final String newLocale; final String newMode; final String oldMode = getCurrentSubtypeMode(); - if (newSubtype == null) { + if (newSubtype == null || newSubtype.getOriginalObject() == null) { // Normally, newSubtype shouldn't be null. But just in case newSubtype was null, // fallback to the default locale. Log.w(TAG, "Couldn't get the current subtype."); |