aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-06-14 11:54:04 -0700
committerTadashi G. Takaoka <takaoka@google.com>2012-06-14 11:57:43 -0700
commit32f4ceb2434b6f204cf8152b406d0f9a642feb73 (patch)
treeeb6dbee76eba5fd9c631b445050d31df6393e9c3 /java
parent5caaf1b9e9720d0d3d461623a34dfe797a4095d0 (diff)
downloadlatinime-32f4ceb2434b6f204cf8152b406d0f9a642feb73.tar.gz
latinime-32f4ceb2434b6f204cf8152b406d0f9a642feb73.tar.xz
latinime-32f4ceb2434b6f204cf8152b406d0f9a642feb73.zip
Dismiss more suggestions panel when suggestions strip is closed
This change fixes possible NPE as well. Bug: 6658028 Change-Id: I8706808d1002b7b0b95930fd9b08568f08645da6
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java1
3 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
index b4fa86dd5..be7644fb5 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
@@ -159,7 +159,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
@Override
public boolean dismissMoreKeysPanel() {
- if (mIsDismissing) return false;
+ if (mIsDismissing || mController == null) return false;
mIsDismissing = true;
final boolean dismissed = mController.dismissMoreKeysPanel();
mIsDismissing = false;
diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
index 8a29dcc13..19287e3f3 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
@@ -167,7 +167,7 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
@Override
public boolean dismissMoreKeysPanel() {
- if (mIsDismissing) return false;
+ if (mIsDismissing || mController == null) return false;
mIsDismissing = true;
final boolean dismissed = mController.dismissMoreKeysPanel();
mIsDismissing = false;
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java
index 3d593aaa7..40e54a474 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java
@@ -884,5 +884,6 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
super.onDetachedFromWindow();
mHandler.cancelAllMessages();
hidePreview();
+ dismissMoreSuggestions();
}
}