aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-01-24 13:29:44 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-24 13:29:44 -0800
commit426eac51c68f182a5a5e4c72e55562eb60a6b688 (patch)
treefe47e139f859f39830f01aa29732b653787233e6 /java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
parentb8d0931a18e76455a46f7a2780a0527e59203927 (diff)
parentf83ae3355c3da38f3a4e76e26fb450d2cc492301 (diff)
downloadlatinime-426eac51c68f182a5a5e4c72e55562eb60a6b688.tar.gz
latinime-426eac51c68f182a5a5e4c72e55562eb60a6b688.tar.xz
latinime-426eac51c68f182a5a5e4c72e55562eb60a6b688.zip
am f83ae335: am 85a6175f: Merge "Set minimum height for RecognitionView in the case that there is no keyboard view loaded." into honeycomb
* commit 'f83ae3355c3da38f3a4e76e26fb450d2cc492301': Set minimum height for RecognitionView in the case that there is no keyboard view loaded.
Diffstat (limited to 'java/src/com/android/inputmethod/voice/VoiceIMEConnector.java')
-rw-r--r--java/src/com/android/inputmethod/voice/VoiceIMEConnector.java13
1 files changed, 9 insertions, 4 deletions
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);