aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android
diff options
context:
space:
mode:
authorLuca Zanolin <zano@google.com>2011-01-24 10:36:15 +0000
committerLuca Zanolin <zano@google.com>2011-01-24 10:36:15 +0000
commit2c5ec3a50dc9c20cb89fd6219f84600e65dddc6e (patch)
tree471f8620e7155db8b436e3a73054f682447f4a9f /java/src/com/android
parent603e72baa26813d47e32b9c274268384e30d7317 (diff)
downloadlatinime-2c5ec3a50dc9c20cb89fd6219f84600e65dddc6e.tar.gz
latinime-2c5ec3a50dc9c20cb89fd6219f84600e65dddc6e.tar.xz
latinime-2c5ec3a50dc9c20cb89fd6219f84600e65dddc6e.zip
Always display the VoiceIME language in the Speak Now pop-up
Change-Id: I1b01458aff98447b7b3d5459b765968bed5515cb
Diffstat (limited to 'java/src/com/android')
-rw-r--r--java/src/com/android/inputmethod/voice/RecognitionView.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/voice/RecognitionView.java b/java/src/com/android/inputmethod/voice/RecognitionView.java
index 98db9365f..95a79f463 100644
--- a/java/src/com/android/inputmethod/voice/RecognitionView.java
+++ b/java/src/com/android/inputmethod/voice/RecognitionView.java
@@ -16,6 +16,9 @@
package com.android.inputmethod.voice;
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.SubtypeSwitcher;
+
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
@@ -35,13 +38,11 @@ import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
-import com.android.inputmethod.latin.R;
-
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ShortBuffer;
-import java.util.List;
+import java.util.Locale;
/**
* The user interface for the "Speak now" and "working" states.
@@ -60,6 +61,7 @@ public class RecognitionView {
private ImageView mImage;
private View mProgress;
private SoundIndicator mSoundIndicator;
+ private TextView mLanguage;
private Button mButton;
private Drawable mInitializing;
@@ -105,6 +107,7 @@ public class RecognitionView {
mButton = (Button) mView.findViewById(R.id.button);
mButton.setOnClickListener(clickListener);
mText = (TextView) mView.findViewById(R.id.text);
+ mLanguage = (TextView) mView.findViewById(R.id.language);
mContext = context;
}
@@ -184,9 +187,14 @@ public class RecognitionView {
private void prepareDialog(CharSequence text, Drawable image,
CharSequence btnTxt) {
+
+ /*
+ * The mic of INIT and of LISTENING has to be displayed in the same position. To accomplish
+ * that, some text visibility are not set as GONE but as INVISIBLE.
+ */
switch (mState) {
case INIT:
- mText.setVisibility(View.GONE);
+ mText.setVisibility(View.INVISIBLE);
mProgress.setVisibility(View.GONE);
@@ -196,6 +204,8 @@ public class RecognitionView {
mSoundIndicator.setVisibility(View.GONE);
mSoundIndicator.stop();
+ mLanguage.setVisibility(View.INVISIBLE);
+
mPopupLayout.setBackgroundDrawable(mListeningBorder);
break;
case LISTENING:
@@ -209,6 +219,11 @@ public class RecognitionView {
mSoundIndicator.setVisibility(View.VISIBLE);
mSoundIndicator.start();
+ Locale locale = SubtypeSwitcher.getInstance().getInputLocale();
+
+ mLanguage.setVisibility(View.VISIBLE);
+ mLanguage.setText(SubtypeSwitcher.getFullDisplayName(locale, true));
+
mPopupLayout.setBackgroundDrawable(mListeningBorder);
break;
case WORKING:
@@ -223,6 +238,8 @@ public class RecognitionView {
mSoundIndicator.setVisibility(View.GONE);
mSoundIndicator.stop();
+ mLanguage.setVisibility(View.GONE);
+
mPopupLayout.setBackgroundDrawable(mWorkingBorder);
break;
case READY:
@@ -237,6 +254,8 @@ public class RecognitionView {
mSoundIndicator.setVisibility(View.GONE);
mSoundIndicator.stop();
+ mLanguage.setVisibility(View.GONE);
+
mPopupLayout.setBackgroundDrawable(mErrorBorder);
break;
default: