Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8551a940 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by The Android Automerger
Browse files

Fix MainKeyboardView visibility must be aligned with main keyboard frame

Bug: 18105755
Change-Id: Ifdcaded538d0eac3b100486ddf27ae4314293792
parent 99be8fc2
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -238,8 +238,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();
    }
@@ -249,6 +253,10 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
    public void setEmojiKeyboard() {
        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);
+2 −2
Original line number Diff line number Diff line
@@ -1192,7 +1192,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;
@@ -1202,7 +1202,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;