aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-01-24 17:38:49 +0900
committersatok <satok@google.com>2011-01-24 19:29:27 +0900
commit8cacb024cf400241f9885cccee782c286cbf1330 (patch)
tree2a1df007e4b78fb30edeab666ed618f7cf4657f2 /java
parent47e482157e3394c680e5b8a1a4d023b242cd307d (diff)
downloadlatinime-8cacb024cf400241f9885cccee782c286cbf1330.tar.gz
latinime-8cacb024cf400241f9885cccee782c286cbf1330.tar.xz
latinime-8cacb024cf400241f9885cccee782c286cbf1330.zip
Set minimum height for RecognitionView in the case that there is no keyboard view loaded.
Bug: 3352322 Change-Id: I9a7b2a745b47bdc62a96a5cd2c0d8ad717e1b406
Diffstat (limited to 'java')
-rw-r--r--java/res/layout/recognition_status.xml2
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java2
-rw-r--r--java/src/com/android/inputmethod/voice/VoiceIMEConnector.java13
3 files changed, 11 insertions, 6 deletions
diff --git a/java/res/layout/recognition_status.xml b/java/res/layout/recognition_status.xml
index b2c9f4a51..b00432f0c 100644
--- a/java/res/layout/recognition_status.xml
+++ b/java/res/layout/recognition_status.xml
@@ -26,7 +26,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/popup_layout"
android:orientation="vertical"
- android:layout_height="0dip"
+ android:layout_height="371dip"
android:layout_width="500dip"
android:layout_centerInParent="true"
android:background="@drawable/vs_dialog_red">
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);