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
95e3008d
Commit
95e3008d
authored
12 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Rename variables related to key preview popup"
parents
6ece8f71
813692c9
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/keyboard/KeyboardView.java
+12
-13
12 additions, 13 deletions
java/src/com/android/inputmethod/keyboard/KeyboardView.java
with
12 additions
and
13 deletions
java/src/com/android/inputmethod/keyboard/KeyboardView.java
+
12
−
13
View file @
95e3008d
...
...
@@ -146,13 +146,13 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
// Key preview
private
static
final
int
PREVIEW_ALPHA
=
240
;
private
final
int
mKeyPreviewLayoutId
;
private
final
int
mPreviewOffset
;
private
final
int
mPreviewHeight
;
private
final
int
mPreviewLingerTimeout
;
private
final
int
mKeyPreviewOffset
;
private
final
int
mKeyPreviewHeight
;
private
final
SparseArray
<
TextView
>
mKeyPreviewTexts
=
CollectionUtils
.
newSparseArray
();
protected
final
KeyPreviewDrawParams
mKeyPreviewDrawParams
=
new
KeyPreviewDrawParams
();
private
boolean
mShowKeyPreviewPopup
=
true
;
private
int
mDelayAfterPreview
;
private
int
mKeyPreviewLingerTimeout
;
// Background state set
private
static
final
int
[][][]
KEY_PREVIEW_BACKGROUND_STATE_TABLE
=
{
{
// STATE_MIDDLE
...
...
@@ -252,13 +252,12 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
R
.
styleable
.
KeyboardView
,
defStyle
,
R
.
style
.
KeyboardView
);
mKeyBackground
=
keyboardViewAttr
.
getDrawable
(
R
.
styleable
.
KeyboardView_keyBackground
);
mKeyBackground
.
getPadding
(
mKeyBackgroundPadding
);
mPreviewOffset
=
keyboardViewAttr
.
getDimensionPixelOffset
(
m
Key
PreviewOffset
=
keyboardViewAttr
.
getDimensionPixelOffset
(
R
.
styleable
.
KeyboardView_keyPreviewOffset
,
0
);
mPreviewHeight
=
keyboardViewAttr
.
getDimensionPixelSize
(
m
Key
PreviewHeight
=
keyboardViewAttr
.
getDimensionPixelSize
(
R
.
styleable
.
KeyboardView_keyPreviewHeight
,
80
);
mPreviewLingerTimeout
=
keyboardViewAttr
.
getInt
(
m
Key
PreviewLingerTimeout
=
keyboardViewAttr
.
getInt
(
R
.
styleable
.
KeyboardView_keyPreviewLingerTimeout
,
0
);
mDelayAfterPreview
=
mPreviewLingerTimeout
;
mKeyLabelHorizontalPadding
=
keyboardViewAttr
.
getDimensionPixelOffset
(
R
.
styleable
.
KeyboardView_keyLabelHorizontalPadding
,
0
);
mKeyHintLetterPadding
=
keyboardViewAttr
.
getDimension
(
...
...
@@ -332,7 +331,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
*/
public
void
setKeyPreviewPopupEnabled
(
final
boolean
previewEnabled
,
final
int
delay
)
{
mShowKeyPreviewPopup
=
previewEnabled
;
m
DelayAfterPreview
=
delay
;
m
KeyPreviewLingerTimeout
=
delay
;
}
/**
...
...
@@ -820,7 +819,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
@Override
public
void
dismissKeyPreview
(
final
PointerTracker
tracker
)
{
mDrawingHandler
.
dismissKeyPreview
(
m
DelayAfterPreview
,
tracker
);
mDrawingHandler
.
dismissKeyPreview
(
m
KeyPreviewLingerTimeout
,
tracker
);
}
private
void
addKeyPreview
(
final
TextView
keyPreview
)
{
...
...
@@ -942,7 +941,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
);
final
int
keyDrawWidth
=
key
.
getDrawWidth
();
final
int
previewWidth
=
previewText
.
getMeasuredWidth
();
final
int
previewHeight
=
mPreviewHeight
;
final
int
previewHeight
=
m
Key
PreviewHeight
;
// The width and height of visible part of the key preview background. The content marker
// of the background 9-patch have to cover the visible part of the background.
previewParams
.
mPreviewVisibleWidth
=
previewWidth
-
previewText
.
getPaddingLeft
()
...
...
@@ -951,7 +950,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
-
previewText
.
getPaddingBottom
();
// The distance between the top edge of the parent key and the bottom of the visible part
// of the key preview background.
previewParams
.
mPreviewVisibleOffset
=
mPreviewOffset
-
previewText
.
getPaddingBottom
();
previewParams
.
mPreviewVisibleOffset
=
m
Key
PreviewOffset
-
previewText
.
getPaddingBottom
();
getLocationInWindow
(
mOriginCoords
);
// The key preview is horizontally aligned with the center of the visible part of the
// parent key. If it doesn't fit in this {@link KeyboardView}, it is moved inward to fit and
...
...
@@ -970,7 +969,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy,
}
// The key preview is placed vertically above the top edge of the parent key with an
// arbitrary offset.
final
int
previewY
=
key
.
mY
-
previewHeight
+
mPreviewOffset
final
int
previewY
=
key
.
mY
-
previewHeight
+
m
Key
PreviewOffset
+
CoordinateUtils
.
y
(
mOriginCoords
);
if
(
background
!=
null
)
{
...
...
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