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
1c8e069d
Commit
1c8e069d
authored
10 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Add isIconDefined predicate to Keyboard_Case attribute
Bug: 14259323 Change-Id: I9450a5125b1809b9fada6ee6e6b253cabfa2e2b4
parent
61ddac28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/internal/KeyboardBuilder.java
+17
-2
17 additions, 2 deletions
...ndroid/inputmethod/keyboard/internal/KeyboardBuilder.java
with
18 additions
and
2 deletions
java/res/values/attrs.xml
+
1
−
0
View file @
1c8e069d
...
...
@@ -431,6 +431,7 @@
<!-- This should be aligned with KeyboardId.IME_ACTION_* -->
<enum
name=
"actionCustomLabel"
value=
"0x100"
/>
</attr>
<attr
name=
"isIconDefined"
format=
"string"
/>
<attr
name=
"localeCode"
format=
"string"
/>
<attr
name=
"languageCode"
format=
"string"
/>
<attr
name=
"countryCode"
format=
"string"
/>
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
+
17
−
2
View file @
1c8e069d
...
...
@@ -664,6 +664,8 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
R
.
styleable
.
Keyboard_Case_isMultiLine
,
id
.
isMultiLine
());
final
boolean
imeActionMatched
=
matchInteger
(
caseAttr
,
R
.
styleable
.
Keyboard_Case_imeAction
,
id
.
imeAction
());
final
boolean
isIconDefinedMatched
=
isIconDefined
(
caseAttr
,
R
.
styleable
.
Keyboard_Case_isIconDefined
,
mParams
.
mIconsSet
);
final
boolean
localeCodeMatched
=
matchString
(
caseAttr
,
R
.
styleable
.
Keyboard_Case_localeCode
,
id
.
mLocale
.
toString
());
final
boolean
languageCodeMatched
=
matchString
(
caseAttr
,
...
...
@@ -675,10 +677,11 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
&&
passwordInputMatched
&&
clobberSettingsKeyMatched
&&
supportsSwitchingToShortcutImeMatched
&&
hasShortcutKeyMatched
&&
languageSwitchKeyEnabledMatched
&&
isMultiLineMatched
&&
imeActionMatched
&&
localeCodeMatched
&&
languageCodeMatched
&&
countryCodeMatched
;
&&
isIconDefinedMatched
&&
localeCodeMatched
&&
languageCodeMatched
&&
countryCodeMatched
;
if
(
DEBUG
)
{
startTag
(
"<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s>%s"
,
TAG_CASE
,
startTag
(
"<%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s
%s
>%s"
,
TAG_CASE
,
textAttr
(
caseAttr
.
getString
(
R
.
styleable
.
Keyboard_Case_keyboardLayoutSet
),
"keyboardLayoutSet"
),
textAttr
(
caseAttr
.
getString
(
...
...
@@ -704,6 +707,8 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
"languageSwitchKeyEnabled"
),
booleanAttr
(
caseAttr
,
R
.
styleable
.
Keyboard_Case_isMultiLine
,
"isMultiLine"
),
textAttr
(
caseAttr
.
getString
(
R
.
styleable
.
Keyboard_Case_isIconDefined
),
"isIconDefined"
),
textAttr
(
caseAttr
.
getString
(
R
.
styleable
.
Keyboard_Case_localeCode
),
"localeCode"
),
textAttr
(
caseAttr
.
getString
(
R
.
styleable
.
Keyboard_Case_languageCode
),
...
...
@@ -755,6 +760,16 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
return
false
;
}
private
static
boolean
isIconDefined
(
final
TypedArray
a
,
final
int
index
,
final
KeyboardIconsSet
iconsSet
)
{
if
(!
a
.
hasValue
(
index
))
{
return
true
;
}
final
String
iconName
=
a
.
getString
(
index
);
final
int
iconId
=
KeyboardIconsSet
.
getIconId
(
iconName
);
return
iconsSet
.
getIconDrawable
(
iconId
)
!=
null
;
}
private
boolean
parseDefault
(
final
XmlPullParser
parser
,
final
KeyboardRow
row
,
final
boolean
skip
)
throws
XmlPullParserException
,
IOException
{
if
(
DEBUG
)
startTag
(
"<%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