Fix a bug where emojis would remove the suggestion strip.
Bug: 11163495 Change-Id: I23d12c430125cc2a66a6e00715a4c609bb9e2bb1
This commit is contained in:
parent
2d74136e57
commit
6fc15b9fc4
2 changed files with 15 additions and 9 deletions
|
@ -155,7 +155,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
}
|
||||
|
||||
public void saveKeyboardState() {
|
||||
if (getKeyboard() != null || isShowingEmojiKeyboard()) {
|
||||
if (getKeyboard() != null || isShowingEmojiPalettes()) {
|
||||
mState.onSaveKeyboardState();
|
||||
}
|
||||
}
|
||||
|
@ -316,19 +316,23 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
|
||||
}
|
||||
|
||||
public boolean isShowingEmojiKeyboard() {
|
||||
return mEmojiPalettesView != null && mEmojiPalettesView.getVisibility() == View.VISIBLE;
|
||||
private boolean isShowingMainKeyboard() {
|
||||
return null != mKeyboardView && mKeyboardView.isShown();
|
||||
}
|
||||
|
||||
public boolean isShowingEmojiPalettes() {
|
||||
return mEmojiPalettesView != null && mEmojiPalettesView.isShown();
|
||||
}
|
||||
|
||||
public boolean isShowingMoreKeysPanel() {
|
||||
if (isShowingEmojiKeyboard()) {
|
||||
if (isShowingEmojiPalettes()) {
|
||||
return false;
|
||||
}
|
||||
return mKeyboardView.isShowingMoreKeysPanel();
|
||||
}
|
||||
|
||||
public View getVisibleKeyboardView() {
|
||||
if (isShowingEmojiKeyboard()) {
|
||||
if (isShowingEmojiPalettes()) {
|
||||
return mEmojiPalettesView;
|
||||
}
|
||||
return mKeyboardView;
|
||||
|
@ -348,6 +352,10 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isShowingMainKeyboardOrEmojiPalettes() {
|
||||
return isShowingMainKeyboard() || isShowingEmojiPalettes();
|
||||
}
|
||||
|
||||
public View onCreateInputView(final boolean isHardwareAcceleratedDrawingEnabled) {
|
||||
if (mKeyboardView != null) {
|
||||
mKeyboardView.closing();
|
||||
|
|
|
@ -1261,9 +1261,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
final boolean needsInputViewShown) {
|
||||
// TODO: Modify this if we support suggestions with hard keyboard
|
||||
if (onEvaluateInputViewShown() && mSuggestionStripView != null) {
|
||||
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
||||
final boolean inputViewShown = (mainKeyboardView != null)
|
||||
? mainKeyboardView.isShown() : false;
|
||||
final boolean inputViewShown = mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
|
||||
final boolean shouldShowSuggestions = shown
|
||||
&& (needsInputViewShown ? inputViewShown : true);
|
||||
if (isFullscreenMode()) {
|
||||
|
@ -1329,7 +1327,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
|||
if (visibleKeyboardView.isShown()) {
|
||||
// Note that the height of Emoji layout is the same as the height of the main keyboard
|
||||
// and the suggestion strip
|
||||
if (mKeyboardSwitcher.isShowingEmojiKeyboard()
|
||||
if (mKeyboardSwitcher.isShowingEmojiPalettes()
|
||||
|| mSuggestionStripView.getVisibility() == View.VISIBLE) {
|
||||
visibleTopY -= suggestionsHeight;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue