aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-10-11 05:10:19 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-11 05:10:19 -0700
commiteb7fa4dc6d1bd629a34adcf6423c534352d0b00c (patch)
tree1eb06eca8d420904a7701d8b3ecfaa9579f7f7fe /java/src
parent7abdab1c6fe693f11cc5ee385b2ff4d5a84cfaf4 (diff)
parent405062733cfe066c4b9af719bfc36a9a516c9dd3 (diff)
downloadlatinime-eb7fa4dc6d1bd629a34adcf6423c534352d0b00c.tar.gz
latinime-eb7fa4dc6d1bd629a34adcf6423c534352d0b00c.tar.xz
latinime-eb7fa4dc6d1bd629a34adcf6423c534352d0b00c.zip
am 40506273: am ac6d0c65: am 6d915037: Merge "Fix a bug where emojis would remove the suggestion strip." into klp-dev
* commit '405062733cfe066c4b9af719bfc36a9a516c9dd3': Fix a bug where emojis would remove the suggestion strip.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java18
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java6
2 files changed, 15 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 97609837e..b7521b998 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -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();
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 46b75121a..de8e26049 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -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;
}