diff options
author | 2011-01-18 08:26:58 -0800 | |
---|---|---|
committer | 2011-01-18 08:26:58 -0800 | |
commit | fb3183efe049798b7dbecdfcbb049009d44b5a66 (patch) | |
tree | f586647143ff2df64dfb44e57533599f86e66d0a /java/src/com/android/inputmethod/voice/VoiceInput.java | |
parent | 934e3e5fbd31fa45a3e37a9a1b71dcf58b07d1e6 (diff) | |
parent | bbd651a00898dabf6b2ae0e715d99953ea81063f (diff) | |
download | latinime-fb3183efe049798b7dbecdfcbb049009d44b5a66.tar.gz latinime-fb3183efe049798b7dbecdfcbb049009d44b5a66.tar.xz latinime-fb3183efe049798b7dbecdfcbb049009d44b5a66.zip |
am bbd651a0: Change the UI of Voice IME to be more like Voice Search.
* commit 'bbd651a00898dabf6b2ae0e715d99953ea81063f':
Change the UI of Voice IME to be more like Voice Search.
Diffstat (limited to 'java/src/com/android/inputmethod/voice/VoiceInput.java')
-rw-r--r-- | java/src/com/android/inputmethod/voice/VoiceInput.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java index f77b4dd0d..ffa349fde 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInput.java +++ b/java/src/com/android/inputmethod/voice/VoiceInput.java @@ -22,6 +22,7 @@ import com.android.inputmethod.latin.R; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -129,12 +130,17 @@ public class VoiceInput implements OnClickListener { private final static int MSG_CLOSE_ERROR_DIALOG = 1; + private final static int MSG_RESET = 2; + private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { - if (msg.what == MSG_CLOSE_ERROR_DIALOG) { + if (msg.what == MSG_RESET || msg.what == MSG_CLOSE_ERROR_DIALOG) { mState = DEFAULT; mRecognitionView.finish(); + } + + if (msg.what == MSG_CLOSE_ERROR_DIALOG) { mUiListener.onCancelVoice(); } } @@ -277,8 +283,9 @@ public class VoiceInput implements OnClickListener { * The configuration of the IME changed and may have caused the views to be layed out * again. Restore the state of the recognition view. */ - public void onConfigurationChanged() { + public void onConfigurationChanged(Configuration configuration) { mRecognitionView.restoreState(); + mRecognitionView.getView().dispatchConfigurationChanged(configuration); } /** @@ -509,7 +516,7 @@ public class VoiceInput implements OnClickListener { mState = DEFAULT; // Remove all pending tasks (e.g., timers to cancel voice input) - mHandler.removeMessages(MSG_CLOSE_ERROR_DIALOG); + mHandler.removeMessages(MSG_RESET); mSpeechRecognizer.cancel(); mUiListener.onCancelVoice(); |