diff options
author | 2014-11-04 07:28:22 +0000 | |
---|---|---|
committer | 2014-11-04 07:28:23 +0000 | |
commit | b9ba5fc778468c200727f77163ef81e378b5b70e (patch) | |
tree | b4f35947c00c8aab3ba4793d716fae2496868a49 /java | |
parent | d071545df9fb255bf86c03998563dfc2154c5f8c (diff) | |
parent | 98dfa6e3346b95f3da8869048715e2e18f85d65e (diff) | |
download | latinime-b9ba5fc778468c200727f77163ef81e378b5b70e.tar.gz latinime-b9ba5fc778468c200727f77163ef81e378b5b70e.tar.xz latinime-b9ba5fc778468c200727f77163ef81e378b5b70e.zip |
Merge "Fix MainKeyboardView visibility must be aligned with main keyboard frame"
Diffstat (limited to 'java')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java | 12 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index af24ac48c..c2862f59d 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -258,8 +258,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } private void setMainKeyboardFrame(final SettingsValues settingsValues) { - mMainKeyboardFrame.setVisibility( - settingsValues.mHasHardwareKeyboard ? View.GONE : View.VISIBLE); + final int visibility = settingsValues.mHasHardwareKeyboard ? View.GONE : View.VISIBLE; + mKeyboardView.setVisibility(visibility); + // The visibility of {@link #mKeyboardView} must be aligned with {@link #MainKeyboardFrame}. + // @see #getVisibleKeyboardView() and + // @see LatinIME#onComputeInset(android.inputmethodservice.InputMethodService.Insets) + mMainKeyboardFrame.setVisibility(visibility); mEmojiPalettesView.setVisibility(View.GONE); mEmojiPalettesView.stopEmojiPalettes(); } @@ -272,6 +276,10 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } final Keyboard keyboard = mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET); mMainKeyboardFrame.setVisibility(View.GONE); + // The visibility of {@link #mKeyboardView} must be aligned with {@link #MainKeyboardFrame}. + // @see #getVisibleKeyboardView() and + // @see LatinIME#onComputeInset(android.inputmethodservice.InputMethodService.Insets) + mKeyboardView.setVisibility(View.GONE); mEmojiPalettesView.startEmojiPalettes( mKeyboardTextsSet.getText(KeyboardTextsSet.SWITCH_TO_ALPHA_KEY_LABEL), mKeyboardView.getKeyVisualAttribute(), keyboard.mIconsSet); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index cd09bf6c7..c86d2b849 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1194,7 +1194,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (hasHardwareKeyboard && visibleKeyboardView.getVisibility() == View.GONE) { // If there is a hardware keyboard and a visible software keyboard view has been hidden, // no visual element will be shown on the screen. - outInsets.touchableInsets = inputHeight; + outInsets.contentTopInsets = inputHeight; outInsets.visibleTopInsets = inputHeight; mInsetsUpdater.setInsets(outInsets); return; @@ -1204,7 +1204,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen ? mSuggestionStripView.getHeight() : 0; final int visibleTopY = inputHeight - visibleKeyboardView.getHeight() - suggestionsHeight; mSuggestionStripView.setMoreSuggestionsHeight(visibleTopY); - // Need to set touchable region only if a keyboard view is being shown. + // Need to set expanded touchable region only if a keyboard view is being shown. if (visibleKeyboardView.isShown()) { final int touchLeft = 0; final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY; |