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
ea6c2e33
Commit
ea6c2e33
authored
14 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Add "languageCode" attribute to "case" tag in Keyboard XML
bug: 3451586 Change-Id: I08ca80e48648ba18543e9b8ca7362c06bb61a826
parent
d9c52ba6
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/values/attrs.xml
+1
-0
1 addition, 0 deletions
java/res/values/attrs.xml
java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+12
-2
12 additions, 2 deletions
.../src/com/android/inputmethod/keyboard/KeyboardParser.java
with
13 additions
and
2 deletions
java/res/values/attrs.xml
+
1
−
0
View file @
ea6c2e33
...
...
@@ -182,6 +182,7 @@
<flag
name=
"actionDone"
value=
"6"
/>
<flag
name=
"actionPrevious"
value=
"7"
/>
</attr>
<attr
name=
"languageCode"
format=
"string"
/>
</declare-styleable>
<declare-styleable
name=
"Keyboard_KeyStyle"
>
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+
12
−
2
View file @
ea6c2e33
...
...
@@ -433,10 +433,13 @@ public class KeyboardParser {
// this attribute with id.mImeOptions as integer value is enough for our purpose.
final
boolean
imeActionMatched
=
matchInteger
(
a
,
R
.
styleable
.
Keyboard_Case_imeAction
,
id
.
mImeAction
);
final
boolean
languageCodeMatched
=
matchString
(
a
,
R
.
styleable
.
Keyboard_Case_languageCode
,
id
.
mLocale
.
getLanguage
());
final
boolean
selected
=
modeMatched
&&
settingsKeyMatched
&&
voiceEnabledMatched
&&
voiceKeyMatched
&&
colorSchemeMatched
&&
imeActionMatched
;
&&
voiceKeyMatched
&&
colorSchemeMatched
&&
imeActionMatched
&&
languageCodeMatched
;
if
(
DEBUG
)
Log
.
d
(
TAG
,
String
.
format
(
"<%s%s%s%s%s%s%s> %s"
,
TAG_CASE
,
if
(
DEBUG
)
Log
.
d
(
TAG
,
String
.
format
(
"<%s%s%s%s%s%s%s
%s
> %s"
,
TAG_CASE
,
textAttr
(
KeyboardId
.
modeName
(
a
.
getInt
(
R
.
styleable
.
Keyboard_Case_mode
,
-
1
)),
"mode"
),
textAttr
(
KeyboardId
.
colorSchemeName
(
...
...
@@ -446,6 +449,7 @@ public class KeyboardParser {
booleanAttr
(
a
,
R
.
styleable
.
Keyboard_Case_hasVoiceKey
,
"hasVoiceKey"
),
textAttr
(
KeyboardId
.
imeOptionsName
(
a
.
getInt
(
R
.
styleable
.
Keyboard_Case_imeAction
,
-
1
)),
"imeAction"
),
textAttr
(
a
.
getString
(
R
.
styleable
.
Keyboard_Case_languageCode
),
"languageCode"
),
Boolean
.
toString
(
selected
)));
return
selected
;
...
...
@@ -467,6 +471,12 @@ public class KeyboardParser {
return
!
a
.
hasValue
(
index
)
||
a
.
getBoolean
(
index
,
false
)
==
value
;
}
private
static
boolean
matchString
(
TypedArray
a
,
int
index
,
String
value
)
{
// If <case> does not have "index" attribute, that means this <case> is wild-card for the
// attribute.
return
!
a
.
hasValue
(
index
)
||
a
.
getString
(
index
).
equals
(
value
);
}
private
boolean
parseDefault
(
XmlResourceParser
parser
,
Row
row
,
List
<
Key
>
keys
)
throws
XmlPullParserException
,
IOException
{
if
(
DEBUG
)
Log
.
d
(
TAG
,
String
.
format
(
"<%s>"
,
TAG_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