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
8bfcac4d
Commit
8bfcac4d
authored
14 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Fix NPE in LatinKeyboard when it represent phone keyboard
Bug: 3041532 Change-Id: I1d846e9175bd033f056a8715287a936be2fe8f74
parent
1571a660
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/LatinKeyboard.java
+13
-9
13 additions, 9 deletions
java/src/com/android/inputmethod/latin/LatinKeyboard.java
with
13 additions
and
9 deletions
java/src/com/android/inputmethod/latin/LatinKeyboard.java
+
13
−
9
View file @
8bfcac4d
...
...
@@ -158,9 +158,22 @@ public class LatinKeyboard extends Keyboard {
mNumberHintIcons
[
9
]
=
res
.
getDrawable
(
R
.
drawable
.
keyboard_hint_9
);
}
// TODO: delete this method and do initialization in constructor.
private
void
initializeMemberVariablesAsNeeded
()
{
if
(
mNumberHintKeys
==
null
)
mNumberHintKeys
=
new
Key
[
NUMBER_HINT_COUNT
];
if
(
mShiftKeys
==
null
)
mShiftKeys
=
new
ArrayList
<
Key
>();
}
@Override
protected
Key
createKeyFromXml
(
Resources
res
,
Row
parent
,
int
x
,
int
y
,
XmlResourceParser
parser
)
{
// TODO: This initialization is needed because this protected method is being called from
// the base class constructor before this class constructor gets called. We need to fix
// this.
initializeMemberVariablesAsNeeded
();
Key
key
=
new
LatinKey
(
res
,
parent
,
x
,
y
,
parser
);
switch
(
key
.
codes
[
0
])
{
case
LatinIME
.
KEYCODE_ENTER
:
...
...
@@ -173,10 +186,6 @@ public class LatinKeyboard extends Keyboard {
mSpaceKey
=
key
;
break
;
case
KEYCODE_SHIFT:
// NOTE: This protected method is being called from the base class constructor before
// mShiftKeys gets initialized.
if
(
mShiftKeys
==
null
)
mShiftKeys
=
new
ArrayList
<
Key
>();
mShiftKeys
.
add
(
key
);
break
;
case
KEYCODE_MODE_CHANGE:
...
...
@@ -186,11 +195,6 @@ public class LatinKeyboard extends Keyboard {
}
// For number hints on the upper-right corner of key
if
(
mNumberHintKeys
==
null
)
{
// NOTE: This protected method is being called from the base class constructor before
// mNumberHintKeys gets initialized.
mNumberHintKeys
=
new
Key
[
NUMBER_HINT_COUNT
];
}
int
hintNumber
=
-
1
;
if
(
LatinKeyboardBaseView
.
isNumberAtLeftmostPopupChar
(
key
))
{
hintNumber
=
key
.
popupCharacters
.
charAt
(
0
)
-
'0'
;
...
...
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