diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/values-ca/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-en-rCA/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-eu/strings.xml | 4 | ||||
-rw-r--r-- | java/res/values-in/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-my/strings-emoji-descriptions.xml | 2 | ||||
-rw-r--r-- | java/res/values-sw/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-te/strings.xml | 2 | ||||
-rw-r--r-- | java/res/values-zh-rHK/strings-emoji-descriptions.xml | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java | 17 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 39 |
10 files changed, 52 insertions, 22 deletions
diff --git a/java/res/values-ca/strings.xml b/java/res/values-ca/strings.xml index 88c923163..877389f7b 100644 --- a/java/res/values-ca/strings.xml +++ b/java/res/values-ca/strings.xml @@ -31,7 +31,7 @@ <string name="settings_screen_appearance" msgid="7358046399111611615">"Aparença i disposició"</string> <string name="settings_screen_gesture" msgid="8826372746901183556">"Escriptura gestual"</string> <string name="settings_screen_correction" msgid="1616818407747682955">"Correcció de textos"</string> - <string name="settings_screen_advanced" msgid="7472408607625972994">"Avançada"</string> + <string name="settings_screen_advanced" msgid="7472408607625972994">"Configuració avançada"</string> <string name="settings_screen_theme" msgid="2137262503543943871">"Tema"</string> <string name="enable_split_keyboard" msgid="4177264923999493614">"Activa el teclat partit"</string> <string name="cloud_sync_title" msgid="8579271074443847055">"Sincronitz. del Teclat de Google"</string> diff --git a/java/res/values-en-rCA/strings.xml b/java/res/values-en-rCA/strings.xml index 95ed54a7f..74b7e1fc4 100644 --- a/java/res/values-en-rCA/strings.xml +++ b/java/res/values-en-rCA/strings.xml @@ -44,7 +44,7 @@ <string name="clear_sync_data_ok" msgid="613104067705915132">"Delete"</string> <string name="cloud_sync_cancel" msgid="5877481252150919037">"Cancel"</string> <string name="cloud_sync_opt_in_text" msgid="9176039655776298248">"Your personal dictionary will be synced and backed up to Google servers. The statistical information of word frequency may be collected to help improve our products. The collection and usage of all the information will be compliant with "<a href="https://www.google.com/policies/privacy">"Google\'s Privacy Policy"</a>"."</string> - <string name="add_account_to_enable_sync" msgid="7836932571852055265">"Please add a Google Account to this device to enable this feature"</string> + <string name="add_account_to_enable_sync" msgid="7836932571852055265">"Please add a Google account to this device to enable this feature"</string> <string name="cloud_sync_summary_disabled_work_profile" msgid="1381770407303129164">"Sync is not available for devices with Google Apps for Business accounts"</string> <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Switch to other input methods"</string> <string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Language switch key also covers other input methods"</string> diff --git a/java/res/values-eu/strings.xml b/java/res/values-eu/strings.xml index 4e47110fa..878969396 100644 --- a/java/res/values-eu/strings.xml +++ b/java/res/values-eu/strings.xml @@ -31,10 +31,10 @@ <string name="settings_screen_appearance" msgid="7358046399111611615">"Itxura eta diseinuak"</string> <string name="settings_screen_gesture" msgid="8826372746901183556">"Idazketa lerrakorra"</string> <string name="settings_screen_correction" msgid="1616818407747682955">"Testu-zuzenketa"</string> - <string name="settings_screen_advanced" msgid="7472408607625972994">"Ezarpen aurreratuak"</string> + <string name="settings_screen_advanced" msgid="7472408607625972994">"Aurreratuak"</string> <string name="settings_screen_theme" msgid="2137262503543943871">"Gaia"</string> <string name="enable_split_keyboard" msgid="4177264923999493614">"Gaitu teklatu banatua"</string> - <string name="cloud_sync_title" msgid="8579271074443847055">"Google teklatuaren sinkronizazioa"</string> + <string name="cloud_sync_title" msgid="8579271074443847055">"Google-ren teklatuaren sinkronizazioa"</string> <string name="cloud_sync_summary" msgid="7684887161145650857">"Sinkronizazioa aktibatuta dago"</string> <string name="cloud_sync_summary_disabled" msgid="4553338970382825796">"Izan hiztegi pertsonala sinkronizatuta gailu guztietan"</string> <string name="sync_now_title" msgid="3088838136743277721">"Sinkronizatu"</string> diff --git a/java/res/values-in/strings.xml b/java/res/values-in/strings.xml index aff4060fa..ca22fa179 100644 --- a/java/res/values-in/strings.xml +++ b/java/res/values-in/strings.xml @@ -43,7 +43,7 @@ <string name="clear_sync_data_confirmation" msgid="2811931135574727678">"Data yang disinkronkan akan dihapus dari awan. Anda yakin?"</string> <string name="clear_sync_data_ok" msgid="613104067705915132">"Hapus"</string> <string name="cloud_sync_cancel" msgid="5877481252150919037">"Batal"</string> - <string name="cloud_sync_opt_in_text" msgid="9176039655776298248">"Kamus pribadi akan disinkronkan dan di-backup ke server Google. Informasi statistik tentang frekuensi kata dapat dikumpulkan untuk membantu menyempurnakan produk kami. Pengumpulan dan penggunaan data tunduk pada "<a href="https://www.google.com/policies/privacy">"Kebijakan Privasi Google"</a>"."</string> + <string name="cloud_sync_opt_in_text" msgid="9176039655776298248">"Kamus pribadi akan disinkronkan dan dicadangkan ke server Google. Informasi statistik tentang frekuensi kata dapat dikumpulkan untuk membantu menyempurnakan produk kami. Pengumpulan dan penggunaan data tunduk pada "<a href="https://www.google.com/policies/privacy">"Kebijakan Privasi Google"</a>"."</string> <string name="add_account_to_enable_sync" msgid="7836932571852055265">"Tambahkan akun Google ke perangkat ini untuk mengaktifkan fitur ini"</string> <string name="cloud_sync_summary_disabled_work_profile" msgid="1381770407303129164">"Sinkronisasi tidak tersedia untuk perangkat yang memiliki akun Google Apps for Business"</string> <string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Beralih ke metode masukan lain"</string> diff --git a/java/res/values-my/strings-emoji-descriptions.xml b/java/res/values-my/strings-emoji-descriptions.xml index 44fae887f..a5ea35fb1 100644 --- a/java/res/values-my/strings-emoji-descriptions.xml +++ b/java/res/values-my/strings-emoji-descriptions.xml @@ -845,7 +845,7 @@ <string name="spoken_emoji_1F509" msgid="3948050077992370791">"အသံလှိုင်းတစ်ခုနှင့် စပီကာ"</string> <string name="spoken_emoji_1F50A" msgid="5818194948677277197">"အသံလှိုင်းသုံးခုနှင့် စပီကာ"</string> <string name="spoken_emoji_1F50B" msgid="8083470451266295876">"ဘက်ထရီ"</string> - <string name="spoken_emoji_1F50C" msgid="7793219132036431680">"လျှစ်စစ် ပလပ်"</string> + <string name="spoken_emoji_1F50C" msgid="7793219132036431680">"လျှစ်စစ် ပလတ်"</string> <string name="spoken_emoji_1F50D" msgid="8140244710637926780">"ဘယ်ဘက်သို့ညွှန်နေသည့် မှန်ဘီလူး"</string> <string name="spoken_emoji_1F50E" msgid="4751821352839693365">"ညာဘက်သို့ညွှန်နေသည့် မှန်ဘီလူး"</string> <string name="spoken_emoji_1F50F" msgid="915079280472199605">"မှင်ဘောပင်ဖြင့် သော့ခတ်"</string> diff --git a/java/res/values-sw/strings.xml b/java/res/values-sw/strings.xml index 16cfa80c5..94ac52a8f 100644 --- a/java/res/values-sw/strings.xml +++ b/java/res/values-sw/strings.xml @@ -132,7 +132,7 @@ <string name="keyboard_layout_set" msgid="4309233698194565609">"Mpangilio"</string> <string name="custom_input_style_note_message" msgid="8826731320846363423">"Mtindo wa ingizo lako maalum unahitaji kuwa umewezeshwa kabla uanze kulitumia. Unataka kuuwesha sasa?"</string> <string name="enable" msgid="5031294444630523247">"Washa"</string> - <string name="not_now" msgid="6172462888202790482">"Sio sasa"</string> + <string name="not_now" msgid="6172462888202790482">"Si sasa"</string> <string name="custom_input_style_already_exists" msgid="8008728952215449707">"Mfumo sawa wa maingizo tayari upo: <xliff:g id="INPUT_STYLE_NAME">%s</xliff:g>"</string> <string name="prefs_keypress_vibration_duration_settings" msgid="7918341459947439226">"Bonyeza kitufe cha muda wa kutetema"</string> <string name="prefs_keypress_sound_volume_settings" msgid="6027007337036891623">"Bonyeza kitufe cha kiwango cha sauti"</string> diff --git a/java/res/values-te/strings.xml b/java/res/values-te/strings.xml index b84624719..0e859eef2 100644 --- a/java/res/values-te/strings.xml +++ b/java/res/values-te/strings.xml @@ -37,7 +37,7 @@ <string name="cloud_sync_title" msgid="8579271074443847055">"Google కీబోర్డ్ సమకాలీకరణ"</string> <string name="cloud_sync_summary" msgid="7684887161145650857">"సమకాలీకరణ ఆన్ చేయబడింది"</string> <string name="cloud_sync_summary_disabled" msgid="4553338970382825796">"పరికరాల్లో మీ వ్యక్తిగత నిఘంటువును సమకాలీకరించండి"</string> - <string name="sync_now_title" msgid="3088838136743277721">"ఇప్పుడే సమకాలీకరించు"</string> + <string name="sync_now_title" msgid="3088838136743277721">"ఇప్పుడే సింక్ చేయి"</string> <string name="clear_sync_data_title" msgid="8582001557037069154">"cloud డేటాను తొలగించండి"</string> <string name="clear_sync_data_summary" msgid="993477139012576584">"మీ సమకాలీకృత డేటాను Google నుండి తొలగిస్తుంది"</string> <string name="clear_sync_data_confirmation" msgid="2811931135574727678">"cloud నుండి మీ సమ. డేటా తొలగించబడుతుంది. మీరు చేయాలనుకుంటున్నారా?"</string> diff --git a/java/res/values-zh-rHK/strings-emoji-descriptions.xml b/java/res/values-zh-rHK/strings-emoji-descriptions.xml index a743e38c8..8d92d6cb1 100644 --- a/java/res/values-zh-rHK/strings-emoji-descriptions.xml +++ b/java/res/values-zh-rHK/strings-emoji-descriptions.xml @@ -205,7 +205,7 @@ <skip /> <string name="spoken_emoji_2728" msgid="5650330815808691881">"三個火花"</string> <string name="spoken_emoji_2733" msgid="8915809595141157327">"八角星號"</string> - <string name="spoken_emoji_2734" msgid="4846583547980754332">"黑色八角星形"</string> + <string name="spoken_emoji_2734" msgid="4846583547980754332">"八角實色星形"</string> <string name="spoken_emoji_2744" msgid="4350636647760161042">"雪花"</string> <string name="spoken_emoji_2747" msgid="3718282973916474455">"火花"</string> <string name="spoken_emoji_274C" msgid="2752145886733295314">"打叉符號"</string> diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 4d337b6f3..91295c772 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -24,6 +24,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.inputmethod.EditorInfo; +import androidx.annotation.NonNull; + import com.android.inputmethod.compat.InputMethodServiceCompatUtils; import com.android.inputmethod.event.Event; import com.android.inputmethod.keyboard.KeyboardLayoutSet.KeyboardLayoutSetException; @@ -88,17 +90,19 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { InputMethodServiceCompatUtils.enableHardwareAcceleration(mLatinIME); } - public void updateKeyboardTheme() { + public void updateKeyboardTheme(@NonNull Context displayContext) { final boolean themeUpdated = updateKeyboardThemeAndContextThemeWrapper( - mLatinIME, KeyboardTheme.getKeyboardTheme(mLatinIME /* context */)); + displayContext, KeyboardTheme.getKeyboardTheme(displayContext /* context */)); if (themeUpdated && mKeyboardView != null) { - mLatinIME.setInputView(onCreateInputView(mIsHardwareAcceleratedDrawingEnabled)); + mLatinIME.setInputView( + onCreateInputView(displayContext, mIsHardwareAcceleratedDrawingEnabled)); } } private boolean updateKeyboardThemeAndContextThemeWrapper(final Context context, final KeyboardTheme keyboardTheme) { - if (mThemeContext == null || !keyboardTheme.equals(mKeyboardTheme)) { + if (mThemeContext == null || !keyboardTheme.equals(mKeyboardTheme) + || !mThemeContext.getResources().equals(context.getResources())) { mKeyboardTheme = keyboardTheme; mThemeContext = new ContextThemeWrapper(context, keyboardTheme.mStyleId); KeyboardLayoutSet.onKeyboardThemeChanged(); @@ -454,13 +458,14 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } } - public View onCreateInputView(final boolean isHardwareAcceleratedDrawingEnabled) { + public View onCreateInputView(@NonNull Context displayContext, + final boolean isHardwareAcceleratedDrawingEnabled) { if (mKeyboardView != null) { mKeyboardView.closing(); } updateKeyboardThemeAndContextThemeWrapper( - mLatinIME, KeyboardTheme.getKeyboardTheme(mLatinIME /* context */)); + displayContext, KeyboardTheme.getKeyboardTheme(displayContext /* context */)); mCurrentInputView = (InputView)LayoutInflater.from(mThemeContext).inflate( R.layout.input_view, null); mMainKeyboardFrame = mCurrentInputView.findViewById(R.id.main_keyboard_frame); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 4b6ab7e27..737bd0d3e 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -16,6 +16,8 @@ package com.android.inputmethod.latin; +import static android.view.Display.INVALID_DISPLAY; + import static com.android.inputmethod.latin.common.Constants.ImeOption.FORCE_ASCII; import static com.android.inputmethod.latin.common.Constants.ImeOption.NO_MICROPHONE; import static com.android.inputmethod.latin.common.Constants.ImeOption.NO_MICROPHONE_COMPAT; @@ -107,6 +109,7 @@ import java.util.Locale; import java.util.concurrent.TimeUnit; import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** * Input method implementation for Qwerty'ish keyboard. @@ -118,7 +121,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen static final String TAG = LatinIME.class.getSimpleName(); private static final boolean TRACE = false; - private static final int EXTENDED_TOUCHABLE_REGION_HEIGHT = 100; private static final int PERIOD_FOR_AUDIO_AND_HAPTIC_FEEDBACK_IN_KEY_REPEAT = 2; private static final int PENDING_IMS_CALLBACK_DURATION_MILLIS = 800; static final long DELAY_WAIT_FOR_DICTIONARY_LOAD_MILLIS = TimeUnit.SECONDS.toMillis(2); @@ -166,6 +168,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // {@link #onEvaluateInputViewShown()}. private boolean mIsExecutingStartShowingInputView; + // Used for re-initialize keyboard layout after onConfigurationChange. + @Nullable private Context mDisplayContext; + private int mCurDisplayId = INVALID_DISPLAY; + // Object for reacting to adding/removing a dictionary pack. private final BroadcastReceiver mDictionaryPackInstallReceiver = new DictionaryPackInstallBroadcastReceiver(this); @@ -594,10 +600,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen DebugFlags.init(PreferenceManager.getDefaultSharedPreferences(this)); RichInputMethodManager.init(this); mRichImm = RichInputMethodManager.getInstance(); - KeyboardSwitcher.init(this); AudioAndHapticFeedbackManager.init(this); AccessibilityUtils.init(this); mStatsUtilsManager.onCreate(this /* context */, mDictionaryFacilitator); + final WindowManager wm = getSystemService(WindowManager.class); + mDisplayContext = createDisplayContext(wm.getDefaultDisplay()); + mCurDisplayId = wm.getDefaultDisplay().getDisplayId(); + KeyboardSwitcher.init(this); super.onCreate(); mHandler.onCreate(); @@ -785,9 +794,27 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } @Override + public void onInitializeInterface() { + // TODO (b/133825283): Non-activity components Resources / DisplayMetrics update when + // moving to external display. + // An issue in Q that non-activity components Resources / DisplayMetrics in + // Context doesn't well updated when moving to external display. + // Currently we do a workaround is to check if IME is moving to new display, if so, + // create new display context and re-init keyboard layout with this context. + final WindowManager wm = getSystemService(WindowManager.class); + final int newDisplayId = wm.getDefaultDisplay().getDisplayId(); + if (mCurDisplayId != newDisplayId) { + mCurDisplayId = newDisplayId; + mDisplayContext = createDisplayContext(wm.getDefaultDisplay()); + mKeyboardSwitcher.updateKeyboardTheme(mDisplayContext); + } + } + + @Override public View onCreateInputView() { StatsUtils.onCreateInputView(); - return mKeyboardSwitcher.onCreateInputView(mIsHardwareAcceleratedDrawingEnabled); + return mKeyboardSwitcher.onCreateInputView(mDisplayContext, + mIsHardwareAcceleratedDrawingEnabled); } @Override @@ -870,7 +897,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mGestureConsumer = GestureConsumer.NULL_GESTURE_CONSUMER; mRichImm.refreshSubtypeCaches(); final KeyboardSwitcher switcher = mKeyboardSwitcher; - switcher.updateKeyboardTheme(); + switcher.updateKeyboardTheme(mDisplayContext); final MainKeyboardView mainKeyboardView = switcher.getMainKeyboardView(); // If we are starting input in a different text field from before, we'll have to reload // settings, so currentSettingsValues can't be final. @@ -1212,9 +1239,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final int touchLeft = 0; final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY; final int touchRight = visibleKeyboardView.getWidth(); - final int touchBottom = inputHeight - // Extend touchable region below the keyboard. - + EXTENDED_TOUCHABLE_REGION_HEIGHT; + final int touchBottom = inputHeight; outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION; outInsets.touchableRegion.set(touchLeft, touchTop, touchRight, touchBottom); } |