Dismiss more suggestions panel when suggestions strip is closed

This change fixes possible NPE as well.

Bug: 6658028
Change-Id: I8706808d1002b7b0b95930fd9b08568f08645da6
main
Tadashi G. Takaoka 2012-06-14 11:54:04 -07:00
parent 5caaf1b9e9
commit 32f4ceb243
3 changed files with 3 additions and 2 deletions

View File

@ -159,7 +159,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
@Override @Override
public boolean dismissMoreKeysPanel() { public boolean dismissMoreKeysPanel() {
if (mIsDismissing) return false; if (mIsDismissing || mController == null) return false;
mIsDismissing = true; mIsDismissing = true;
final boolean dismissed = mController.dismissMoreKeysPanel(); final boolean dismissed = mController.dismissMoreKeysPanel();
mIsDismissing = false; mIsDismissing = false;

View File

@ -167,7 +167,7 @@ public class MoreSuggestionsView extends KeyboardView implements MoreKeysPanel {
@Override @Override
public boolean dismissMoreKeysPanel() { public boolean dismissMoreKeysPanel() {
if (mIsDismissing) return false; if (mIsDismissing || mController == null) return false;
mIsDismissing = true; mIsDismissing = true;
final boolean dismissed = mController.dismissMoreKeysPanel(); final boolean dismissed = mController.dismissMoreKeysPanel();
mIsDismissing = false; mIsDismissing = false;

View File

@ -884,5 +884,6 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
super.onDetachedFromWindow(); super.onDetachedFromWindow();
mHandler.cancelAllMessages(); mHandler.cancelAllMessages();
hidePreview(); hidePreview();
dismissMoreSuggestions();
} }
} }