diff options
author | 2011-01-24 02:59:25 -0800 | |
---|---|---|
committer | 2011-01-24 02:59:25 -0800 | |
commit | f83ae3355c3da38f3a4e76e26fb450d2cc492301 (patch) | |
tree | fe47e139f859f39830f01aa29732b653787233e6 /java/src | |
parent | 8972b9ea1f08c4bb38b06e4c47332d102567a5b2 (diff) | |
parent | 85a6175f4925381fd6be9285520d270d0b6f5cd4 (diff) | |
download | latinime-f83ae3355c3da38f3a4e76e26fb450d2cc492301.tar.gz latinime-f83ae3355c3da38f3a4e76e26fb450d2cc492301.tar.xz latinime-f83ae3355c3da38f3a4e76e26fb450d2cc492301.zip |
am 85a6175f: Merge "Set minimum height for RecognitionView in the case that there is no keyboard view loaded." into honeycomb
* commit '85a6175f4925381fd6be9285520d270d0b6f5cd4':
Set minimum height for RecognitionView in the case that there is no keyboard view loaded.
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SubtypeSwitcher.java | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/voice/VoiceIMEConnector.java | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index ffce66e9b..d3aa70c28 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -435,7 +435,7 @@ public class SubtypeSwitcher { mVoiceInput = vi; if (isVoiceMode()) { if (DBG) { - Log.d(TAG, "Set and call voice input."); + Log.d(TAG, "Set and call voice input.: " + getInputLocaleStr()); } triggerVoiceIME(); return true; diff --git a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java index 6c9b7d527..a3a3ea88e 100644 --- a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java +++ b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java @@ -78,6 +78,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { // given text field. For instance this is specified by the search dialog when the // dialog is already showing a voice search button. private static final String IME_OPTION_NO_MICROPHONE = "nm"; + private static final int RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO = 6; @SuppressWarnings("unused") private static final String TAG = "VoiceIMEConnector"; @@ -543,10 +544,14 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { // As we add mm, we don't know how the rounding is going to work // thus we may end up with few pixels extra (or less). if (keyboardView != null) { - int h = keyboardView.getHeight(); - if (h > 0) { - View popupLayout = v.findViewById(R.id.popup_layout); - popupLayout.getLayoutParams().height = h; + View popupLayout = v.findViewById(R.id.popup_layout); + final int displayHeight = + mService.getResources().getDisplayMetrics().heightPixels; + final int currentHeight = popupLayout.getLayoutParams().height; + final int keyboardHeight = keyboardView.getHeight(); + if (keyboardHeight > currentHeight || keyboardHeight + > (displayHeight / RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO)) { + popupLayout.getLayoutParams().height = keyboardHeight; } } mService.setInputView(v); |