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
18d536f6
Commit
18d536f6
authored
14 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
14 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Dismiss orange highlight after suggestion has been selected" into gingerbread
parents
a0a60b37
4fa67efc
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/latin/CandidateView.java
+9
-7
9 additions, 7 deletions
java/src/com/android/inputmethod/latin/CandidateView.java
with
9 additions
and
7 deletions
java/src/com/android/inputmethod/latin/CandidateView.java
+
9
−
7
View file @
18d536f6
...
...
@@ -40,14 +40,15 @@ import java.util.List;
public
class
CandidateView
extends
View
{
private
static
final
int
OUT_OF_BOUNDS
=
-
1
;
private
static
final
int
OUT_OF_BOUNDS_WORD_INDEX
=
-
1
;
private
static
final
int
OUT_OF_BOUNDS_X_COORD
=
-
1
;
private
LatinIME
mService
;
private
final
ArrayList
<
CharSequence
>
mSuggestions
=
new
ArrayList
<
CharSequence
>();
private
boolean
mShowingCompletions
;
private
CharSequence
mSelectedString
;
private
int
mSelectedIndex
;
private
int
mTouchX
=
OUT_OF_BOUNDS
;
private
int
mTouchX
=
OUT_OF_BOUNDS
_X_COORD
;
private
final
Drawable
mSelectionHighlight
;
private
boolean
mTypedWordValid
;
...
...
@@ -256,8 +257,8 @@ public class CandidateView extends View {
mWordX
[
i
]
=
x
;
if
(
touchX
+
scrollX
>=
x
&&
touchX
+
scrollX
<
x
+
wordWidth
&&
!
scrolled
&&
touchX
!=
OUT_OF_BOUNDS
)
{
if
(
touchX
!=
OUT_OF_BOUNDS_X_COORD
&&
!
scrolled
&&
touchX
+
scrollX
>=
x
&&
touchX
+
scrollX
<
x
+
wordWidth
)
{
if
(
canvas
!=
null
&&
!
mShowingAddToDictionary
)
{
canvas
.
translate
(
x
,
0
);
mSelectionHighlight
.
setBounds
(
0
,
bgPadding
.
top
,
wordWidth
,
height
);
...
...
@@ -360,7 +361,7 @@ public class CandidateView extends View {
// Don't call mSuggestions.clear() because it's being used for logging
// in LatinIME.pickSuggestionManually().
mSuggestions
.
clear
();
mTouchX
=
OUT_OF_BOUNDS
;
mTouchX
=
OUT_OF_BOUNDS
_X_COORD
;
mSelectedString
=
null
;
mSelectedIndex
=
-
1
;
mShowingAddToDictionary
=
false
;
...
...
@@ -429,7 +430,8 @@ public class CandidateView extends View {
}
private
void
hidePreview
()
{
mCurrentWordIndex
=
OUT_OF_BOUNDS
;
mTouchX
=
OUT_OF_BOUNDS_X_COORD
;
mCurrentWordIndex
=
OUT_OF_BOUNDS_WORD_INDEX
;
mPreviewPopup
.
dismiss
();
}
...
...
@@ -438,7 +440,7 @@ public class CandidateView extends View {
mCurrentWordIndex
=
wordIndex
;
// If index changed or changing text
if
(
oldWordIndex
!=
mCurrentWordIndex
||
altText
!=
null
)
{
if
(
wordIndex
==
OUT_OF_BOUNDS
)
{
if
(
wordIndex
==
OUT_OF_BOUNDS
_WORD_INDEX
)
{
hidePreview
();
}
else
{
CharSequence
word
=
altText
!=
null
?
altText
:
mSuggestions
.
get
(
wordIndex
);
...
...
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