Dismiss more suggestions panel when suggestions strip is closed
This change fixes possible NPE as well. Bug: 6658028 Change-Id: I8706808d1002b7b0b95930fd9b08568f08645da6main
parent
5caaf1b9e9
commit
32f4ceb243
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -884,5 +884,6 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
mHandler.cancelAllMessages();
|
mHandler.cancelAllMessages();
|
||||||
hidePreview();
|
hidePreview();
|
||||||
|
dismissMoreSuggestions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue