diff options
| author | Menny Even Danan <menny@evendanan.net> | 2015-11-04 18:20:06 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2015-11-04 18:21:40 +0000 |
| commit | 3ea7f2790e19903406227c7ab488dca49dfb1611 (patch) | |
| tree | 594e1584df68f677cde16cb9b13847982cdefe6e /src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java | |
| parent | 8bde34742ca1164c19df0b5dd8c93e5524977618 (diff) | |
| download | AnySoftKeyboard-3ea7f2790e19903406227c7ab488dca49dfb1611.tar.gz AnySoftKeyboard-3ea7f2790e19903406227c7ab488dca49dfb1611.tar.bz2 | |
delaying dictionaries close. This should help in quick Editor restarts
Diffstat (limited to 'src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java')
| -rw-r--r-- | src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java b/src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java index 03d3d3da4..6c37ba643 100644 --- a/src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java +++ b/src/main/java/com/anysoftkeyboard/KeyboardUIStateHandler.java @@ -17,6 +17,7 @@ final class KeyboardUIStateHandler extends Handler { public static final int MSG_UPDATE_SUGGESTIONS = R.id.keyboard_ui_handler_MSG_UPDATE_SUGGESTIONS; public static final int MSG_RESTART_NEW_WORD_SUGGESTIONS = R.id.keyboard_ui_handler_MSG_RESTART_NEW_WORD_SUGGESTIONS; public static final int MSG_REMOVE_CLOSE_SUGGESTIONS_HINT = R.id.keyboard_ui_handler_MSG_REMOVE_CLOSE_SUGGESTIONS_HINT; + public static final int MSG_CLOSE_DICTIONARIES = R.id.keyboard_ui_handler_MSG_CLOSE_DICTIONARIES; private static final class CloseTextAnimationListener implements Animation.AnimationListener { private View closeText; @@ -44,6 +45,13 @@ final class KeyboardUIStateHandler extends Handler { mKeyboard = new WeakReference<>(keyboard); } + public void removeAllMessages() { + removeMessages(MSG_UPDATE_SUGGESTIONS); + removeMessages(MSG_RESTART_NEW_WORD_SUGGESTIONS); + removeMessages(MSG_REMOVE_CLOSE_SUGGESTIONS_HINT); + removeMessages(MSG_CLOSE_DICTIONARIES); + } + @Override public void handleMessage(Message msg) { AnySoftKeyboard ask = mKeyboard.get(); @@ -66,6 +74,10 @@ final class KeyboardUIStateHandler extends Handler { gone.setAnimationListener(mCloseTextAnimationListener); closeText.startAnimation(gone); } + break; + case MSG_CLOSE_DICTIONARIES: + ask.closeDictionaries(); + break; default: super.handleMessage(msg); } |
