am b9ba5fc7
: Merge "Fix MainKeyboardView visibility must be aligned with main keyboard frame"
* commit 'b9ba5fc778468c200727f77163ef81e378b5b70e': Fix MainKeyboardView visibility must be aligned with main keyboard frame
This commit is contained in:
commit
c133c35607
2 changed files with 12 additions and 4 deletions
|
@ -258,8 +258,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMainKeyboardFrame(final SettingsValues settingsValues) {
|
private void setMainKeyboardFrame(final SettingsValues settingsValues) {
|
||||||
mMainKeyboardFrame.setVisibility(
|
final int visibility = settingsValues.mHasHardwareKeyboard ? View.GONE : View.VISIBLE;
|
||||||
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.setVisibility(View.GONE);
|
||||||
mEmojiPalettesView.stopEmojiPalettes();
|
mEmojiPalettesView.stopEmojiPalettes();
|
||||||
}
|
}
|
||||||
|
@ -272,6 +276,10 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
}
|
}
|
||||||
final Keyboard keyboard = mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET);
|
final Keyboard keyboard = mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET);
|
||||||
mMainKeyboardFrame.setVisibility(View.GONE);
|
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(
|
mEmojiPalettesView.startEmojiPalettes(
|
||||||
mKeyboardTextsSet.getText(KeyboardTextsSet.SWITCH_TO_ALPHA_KEY_LABEL),
|
mKeyboardTextsSet.getText(KeyboardTextsSet.SWITCH_TO_ALPHA_KEY_LABEL),
|
||||||
mKeyboardView.getKeyVisualAttribute(), keyboard.mIconsSet);
|
mKeyboardView.getKeyVisualAttribute(), keyboard.mIconsSet);
|
||||||
|
|
|
@ -1194,7 +1194,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
if (hasHardwareKeyboard && visibleKeyboardView.getVisibility() == View.GONE) {
|
if (hasHardwareKeyboard && visibleKeyboardView.getVisibility() == View.GONE) {
|
||||||
// If there is a hardware keyboard and a visible software keyboard view has been hidden,
|
// If there is a hardware keyboard and a visible software keyboard view has been hidden,
|
||||||
// no visual element will be shown on the screen.
|
// no visual element will be shown on the screen.
|
||||||
outInsets.touchableInsets = inputHeight;
|
outInsets.contentTopInsets = inputHeight;
|
||||||
outInsets.visibleTopInsets = inputHeight;
|
outInsets.visibleTopInsets = inputHeight;
|
||||||
mInsetsUpdater.setInsets(outInsets);
|
mInsetsUpdater.setInsets(outInsets);
|
||||||
return;
|
return;
|
||||||
|
@ -1204,7 +1204,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
? mSuggestionStripView.getHeight() : 0;
|
? mSuggestionStripView.getHeight() : 0;
|
||||||
final int visibleTopY = inputHeight - visibleKeyboardView.getHeight() - suggestionsHeight;
|
final int visibleTopY = inputHeight - visibleKeyboardView.getHeight() - suggestionsHeight;
|
||||||
mSuggestionStripView.setMoreSuggestionsHeight(visibleTopY);
|
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()) {
|
if (visibleKeyboardView.isShown()) {
|
||||||
final int touchLeft = 0;
|
final int touchLeft = 0;
|
||||||
final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
|
final int touchTop = mKeyboardSwitcher.isShowingMoreKeysPanel() ? 0 : visibleTopY;
|
||||||
|
|
Loading…
Reference in a new issue