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
a66069ab
Commit
a66069ab
authored
10 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Fix possible NPE in MainKeyboardView
Change-Id: I1fc21a981d9f1740315763b5ca0c1024ece1fa4d
parent
a94733cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+5
-2
5 additions, 2 deletions
...rc/com/android/inputmethod/keyboard/MainKeyboardView.java
with
5 additions
and
2 deletions
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+
5
−
2
View file @
a66069ab
...
@@ -895,13 +895,16 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy
...
@@ -895,13 +895,16 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy
}
}
private
void
drawLanguageOnSpacebar
(
final
Key
key
,
final
Canvas
canvas
,
final
Paint
paint
)
{
private
void
drawLanguageOnSpacebar
(
final
Key
key
,
final
Canvas
canvas
,
final
Paint
paint
)
{
final
Keyboard
keyboard
=
getKeyboard
();
if
(
keyboard
==
null
)
{
return
;
}
final
int
width
=
key
.
getWidth
();
final
int
width
=
key
.
getWidth
();
final
int
height
=
key
.
getHeight
();
final
int
height
=
key
.
getHeight
();
paint
.
setTextAlign
(
Align
.
CENTER
);
paint
.
setTextAlign
(
Align
.
CENTER
);
paint
.
setTypeface
(
Typeface
.
DEFAULT
);
paint
.
setTypeface
(
Typeface
.
DEFAULT
);
paint
.
setTextSize
(
mLanguageOnSpacebarTextSize
);
paint
.
setTextSize
(
mLanguageOnSpacebarTextSize
);
final
RichInputMethodSubtype
subtype
=
getKeyboard
().
mId
.
mSubtype
;
final
String
language
=
layoutLanguageOnSpacebar
(
paint
,
keyboard
.
mId
.
mSubtype
,
width
);
final
String
language
=
layoutLanguageOnSpacebar
(
paint
,
subtype
,
width
);
// Draw language text with shadow
// Draw language text with shadow
final
float
descent
=
paint
.
descent
();
final
float
descent
=
paint
.
descent
();
final
float
textHeight
=
-
paint
.
ascent
()
+
descent
;
final
float
textHeight
=
-
paint
.
ascent
()
+
descent
;
...
...
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