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.main
commit
f83ae3355c
|
@ -26,7 +26,7 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/popup_layout"
|
android:id="@+id/popup_layout"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="0dip"
|
android:layout_height="371dip"
|
||||||
android:layout_width="500dip"
|
android:layout_width="500dip"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:background="@drawable/vs_dialog_red">
|
android:background="@drawable/vs_dialog_red">
|
||||||
|
|
|
@ -435,7 +435,7 @@ public class SubtypeSwitcher {
|
||||||
mVoiceInput = vi;
|
mVoiceInput = vi;
|
||||||
if (isVoiceMode()) {
|
if (isVoiceMode()) {
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Log.d(TAG, "Set and call voice input.");
|
Log.d(TAG, "Set and call voice input.: " + getInputLocaleStr());
|
||||||
}
|
}
|
||||||
triggerVoiceIME();
|
triggerVoiceIME();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -78,6 +78,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
|
||||||
// given text field. For instance this is specified by the search dialog when the
|
// given text field. For instance this is specified by the search dialog when the
|
||||||
// dialog is already showing a voice search button.
|
// dialog is already showing a voice search button.
|
||||||
private static final String IME_OPTION_NO_MICROPHONE = "nm";
|
private static final String IME_OPTION_NO_MICROPHONE = "nm";
|
||||||
|
private static final int RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO = 6;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private static final String TAG = "VoiceIMEConnector";
|
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
|
// 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).
|
// thus we may end up with few pixels extra (or less).
|
||||||
if (keyboardView != null) {
|
if (keyboardView != null) {
|
||||||
int h = keyboardView.getHeight();
|
View popupLayout = v.findViewById(R.id.popup_layout);
|
||||||
if (h > 0) {
|
final int displayHeight =
|
||||||
View popupLayout = v.findViewById(R.id.popup_layout);
|
mService.getResources().getDisplayMetrics().heightPixels;
|
||||||
popupLayout.getLayoutParams().height = h;
|
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);
|
mService.setInputView(v);
|
||||||
|
|
Loading…
Reference in New Issue