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
e6c6df90
Commit
e6c6df90
authored
11 years ago
by
Ken Wakasa
Committed by
Android Git Automerger
11 years ago
Browse files
Options
Downloads
Plain Diff
am
280990bc
: Merge "Address a couple more issues in Khmer layout"
* commit '
280990bc
': Address a couple more issues in Khmer layout
parents
4f5f3ebc
280990bc
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/src/com/android/inputmethod/keyboard/KeyboardView.java
+9
-2
9 additions, 2 deletions
java/src/com/android/inputmethod/keyboard/KeyboardView.java
java/src/com/android/inputmethod/latin/utils/TypefaceUtils.java
+5
-0
5 additions, 0 deletions
...rc/com/android/inputmethod/latin/utils/TypefaceUtils.java
with
14 additions
and
2 deletions
java/src/com/android/inputmethod/keyboard/KeyboardView.java
+
9
−
2
View file @
e6c6df90
...
...
@@ -26,6 +26,7 @@ import android.graphics.Paint.Align;
import
android.graphics.PorterDuff
;
import
android.graphics.Rect
;
import
android.graphics.Region
;
import
android.graphics.Typeface
;
import
android.graphics.drawable.Drawable
;
import
android.util.AttributeSet
;
import
android.view.View
;
...
...
@@ -445,6 +446,8 @@ public class KeyboardView extends View {
if
(
hintLabel
!=
null
)
{
paint
.
setTextSize
(
key
.
selectHintTextSize
(
params
));
paint
.
setColor
(
key
.
selectHintTextColor
(
params
));
// TODO: Should add a way to specify type face for hint letters
paint
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
);
blendAlpha
(
paint
,
params
.
mAnimAlpha
);
final
float
hintX
,
hintY
;
if
(
key
.
hasHintLabel
())
{
...
...
@@ -465,9 +468,13 @@ public class KeyboardView extends View {
paint
.
setTextAlign
(
Align
.
CENTER
);
}
else
{
// key.hasHintLetter()
// The hint letter is placed at top-right corner of the key. Used mainly on phone.
final
float
keyNumericHintLabelReferenceCharWidth
=
TypefaceUtils
.
getCharWidth
(
KEY_NUMERIC_HINT_LABEL_REFERENCE_CHAR
,
paint
);
final
float
keyHintLabelStringWidth
=
TypefaceUtils
.
getStringWidth
(
hintLabel
,
paint
);
hintX
=
keyWidth
-
mKeyHintLetterPadding
-
TypefaceUtils
.
getCharWidth
(
KEY_NUMERIC_HINT_LABEL_REFERENCE_CHAR
,
paint
)
/
2.0f
;
-
Math
.
max
(
keyNumericHintLabelReferenceCharWidth
,
keyHintLabelStringWidth
)
/
2.0f
;
hintY
=
-
paint
.
ascent
();
paint
.
setTextAlign
(
Align
.
CENTER
);
}
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/utils/TypefaceUtils.java
+
5
−
0
View file @
e6c6df90
...
...
@@ -66,6 +66,11 @@ public final class TypefaceUtils {
}
}
public
static
float
getStringWidth
(
final
String
string
,
final
Paint
paint
)
{
paint
.
getTextBounds
(
string
,
0
,
string
.
length
(),
sTextWidthBounds
);
return
sTextWidthBounds
.
width
();
}
private
static
int
getCharGeometryCacheKey
(
final
char
referenceChar
,
final
Paint
paint
)
{
final
int
labelSize
=
(
int
)
paint
.
getTextSize
();
final
Typeface
face
=
paint
.
getTypeface
();
...
...
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