From cb0d1c4c584f3f47da3f630441b7de1e741584e0 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 14 May 2013 15:05:40 +0900 Subject: [PATCH] Fix isSuggestionsStripVisible when keyboard hidden When the keyboard is hidden, the suggestion strip is never visible. Bug: 8954116 Change-Id: I9f242d07b49ad60b625a22429bb013251e814905 --- .../android/inputmethod/latin/LatinIME.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index fdd470cf1..5dd42bf02 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2102,16 +2102,25 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } private boolean isSuggestionsStripVisible() { - if (mSuggestionStripView == null) + final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView(); + if (null == mainKeyboardView || !mainKeyboardView.isShown()) { return false; - if (mSuggestionStripView.isShowingAddToDictionaryHint()) + } + if (mSuggestionStripView == null) { + return false; + } + if (mSuggestionStripView.isShowingAddToDictionaryHint()) { return true; - if (null == mSettings.getCurrent()) + } + if (null == mSettings.getCurrent()) { return false; - if (!mSettings.getCurrent().isSuggestionStripVisibleInOrientation(mDisplayOrientation)) + } + if (!mSettings.getCurrent().isSuggestionStripVisibleInOrientation(mDisplayOrientation)) { return false; - if (mSettings.getCurrent().isApplicationSpecifiedCompletionsOn()) + } + if (mSettings.getCurrent().isApplicationSpecifiedCompletionsOn()) { return true; + } return mSettings.getCurrent().isSuggestionsRequested(mDisplayOrientation); }