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
831198a4
Commit
831198a4
authored
12 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Consolidate two helper methods (refactor step 3)
Change-Id: I8b8522d1e5342fc73346ba2748e75f0c1d5bf03c
parent
2a3b15b2
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/PointerTracker.java
+13
-25
13 additions, 25 deletions
.../src/com/android/inputmethod/keyboard/PointerTracker.java
with
13 additions
and
25 deletions
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+
13
−
25
View file @
831198a4
...
...
@@ -893,21 +893,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
onMoveEventInternal
(
x
,
y
,
eventTime
);
}
private
void
slideInToNewKey
(
final
Key
newKey
,
final
int
x
,
final
int
y
,
final
long
eventTime
)
{
// The pointer has been slid in to the new key, but the finger was not on any keys.
// In this case, we must call onPress() to notify that the new key is being pressed.
// This onPress call may have changed keyboard layout. Those cases are detected at
// {@link #setKeyboard}. In those cases, we should update key according to the
// new keyboard layout.
Key
key
=
newKey
;
if
(
callListenerOnPressAndCheckKeyboardLayoutChange
(
key
))
{
key
=
onMoveKey
(
x
,
y
);
}
onMoveToNewKey
(
key
,
x
,
y
);
startLongPressTimer
(
key
);
setPressedKeyGraphics
(
key
,
eventTime
);
}
private
void
processSlidingKeyInput
(
final
Key
newKey
,
final
int
x
,
final
int
y
,
final
long
eventTime
)
{
// This onPress call may have changed keyboard layout. Those cases are detected
...
...
@@ -959,15 +944,19 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
onDownEventInternal
(
x
,
y
,
eventTime
);
}
private
void
processSildeOutFromOldKey
(
final
Key
oldKey
)
{
setReleasedKeyGraphics
(
oldKey
);
callListenerOnRelease
(
oldKey
,
oldKey
.
mCode
,
true
);
startSlidingKeyInput
(
oldKey
);
mTimerProxy
.
cancelKeyTimers
();
}
private
void
slideFromOldKeyToNewKey
(
final
Key
key
,
final
int
x
,
final
int
y
,
final
long
eventTime
,
final
Key
oldKey
,
final
int
lastX
,
final
int
lastY
)
{
// The pointer has been slid in to the new key from the previous key, we must call
// onRelease() first to notify that the previous key has been released, then call
// onPress() to notify that the new key is being pressed.
setReleasedKeyGraphics
(
oldKey
);
callListenerOnRelease
(
oldKey
,
oldKey
.
mCode
,
true
);
startSlidingKeyInput
(
oldKey
);
mTimerProxy
.
cancelKeyTimers
();
processSildeOutFromOldKey
(
oldKey
);
startRepeatKey
(
key
);
if
(
mIsAllowedSlidingKeyInput
)
{
processSlidingKeyInput
(
key
,
x
,
y
,
eventTime
);
...
...
@@ -1011,10 +1000,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
private
void
slideOutFromOldKey
(
final
Key
oldKey
,
final
int
x
,
final
int
y
)
{
// The pointer has been slid out from the previous key, we must call onRelease() to
// notify that the previous key has been released.
setReleasedKeyGraphics
(
oldKey
);
callListenerOnRelease
(
oldKey
,
oldKey
.
mCode
,
true
);
startSlidingKeyInput
(
oldKey
);
mTimerProxy
.
cancelLongPressTimer
();
processSildeOutFromOldKey
(
oldKey
);
if
(
mIsAllowedSlidingKeyInput
)
{
onMoveToNewKey
(
null
,
x
,
y
);
}
else
{
...
...
@@ -1044,9 +1030,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
if
(
oldKey
!=
null
&&
isMajorEnoughMoveToBeOnNewKey
(
x
,
y
,
eventTime
,
newKey
))
{
slideFromOldKeyToNewKey
(
newKey
,
x
,
y
,
eventTime
,
oldKey
,
lastX
,
lastY
);
}
else
if
(
oldKey
==
null
)
{
slideInToNewKey
(
newKey
,
x
,
y
,
eventTime
);
// The pointer has been slid in to the new key, but the finger was not on any keys.
// In this case, we must call onPress() to notify that the new key is being pressed.
processSlidingKeyInput
(
newKey
,
x
,
y
,
eventTime
);
}
}
else
{
}
else
{
// newKey == null
if
(
oldKey
!=
null
&&
isMajorEnoughMoveToBeOnNewKey
(
x
,
y
,
eventTime
,
newKey
))
{
slideOutFromOldKey
(
oldKey
,
x
,
y
);
}
...
...
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