Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
2c5ec3a5
Commit
2c5ec3a5
authored
14 years ago
by
Luca Zanolin
Browse files
Options
Downloads
Patches
Plain Diff
Always display the VoiceIME language in the Speak Now pop-up
Change-Id: I1b01458aff98447b7b3d5459b765968bed5515cb
parent
603e72ba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/layout/recognition_status.xml
+16
-0
16 additions, 0 deletions
java/res/layout/recognition_status.xml
java/src/com/android/inputmethod/voice/RecognitionView.java
+23
-4
23 additions, 4 deletions
java/src/com/android/inputmethod/voice/RecognitionView.java
with
39 additions
and
4 deletions
java/res/layout/recognition_status.xml
+
16
−
0
View file @
2c5ec3a5
...
...
@@ -70,6 +70,22 @@
android:layout_centerInParent=
"true"
android:visibility=
"gone"
/>
</RelativeLayout>
<!--
The text is set by the code. We specify a random text (voice_error), so the
text view does not have a zero height. This is necessary to keep the slash
mic and the recording mic is the same position
-->
<TextView
android:id=
"@+id/language"
android:text=
"@string/voice_error"
android:layout_height=
"wrap_content"
android:layout_width=
"wrap_content"
android:singleLine=
"true"
android:textSize=
"14sp"
android:layout_marginBottom=
"3dip"
android:layout_gravity=
"center"
android:textColor=
"#ffffff"
android:visibility=
"invisible"
/>
<Button
android:id=
"@+id/button"
android:layout_width=
"match_parent"
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/voice/RecognitionView.java
+
23
−
4
View file @
2c5ec3a5
...
...
@@ -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.L
ist
;
import
java.util.L
ocale
;
/**
* 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
.
GON
E
);
mText
.
setVisibility
(
View
.
INVISIBL
E
);
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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment