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
8ec8c5fe
Commit
8ec8c5fe
authored
12 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Cancel the while-typing timer when user hits the spacebar" into jb-mr1-dev
parents
bf505d98
d2173b57
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+27
-7
27 additions, 7 deletions
...rc/com/android/inputmethod/keyboard/MainKeyboardView.java
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+4
-8
4 additions, 8 deletions
.../src/com/android/inputmethod/keyboard/PointerTracker.java
with
31 additions
and
15 deletions
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+
27
−
7
View file @
8ec8c5fe
...
...
@@ -154,8 +154,7 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
}
break
;
case
MSG_TYPING_STATE_EXPIRED:
cancelAndStartAnimators
(
keyboardView
.
mAltCodeKeyWhileTypingFadeoutAnimator
,
keyboardView
.
mAltCodeKeyWhileTypingFadeinAnimator
);
startWhileTypingFadeinAnimation
(
keyboardView
);
break
;
}
}
...
...
@@ -229,7 +228,7 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
removeMessages
(
MSG_LONGPRESS_KEY
);
}
p
ublic
static
void
cancelAndStartAnimators
(
final
ObjectAnimator
animatorToCancel
,
p
rivate
static
void
cancelAndStartAnimators
(
final
ObjectAnimator
animatorToCancel
,
final
ObjectAnimator
animatorToStart
)
{
float
startFraction
=
0.0f
;
if
(
animatorToCancel
.
isStarted
())
{
...
...
@@ -241,18 +240,39 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
animatorToStart
.
setCurrentPlayTime
(
startTime
);
}
private
static
void
startWhileTypingFadeinAnimation
(
final
MainKeyboardView
keyboardView
)
{
cancelAndStartAnimators
(
keyboardView
.
mAltCodeKeyWhileTypingFadeoutAnimator
,
keyboardView
.
mAltCodeKeyWhileTypingFadeinAnimator
);
}
private
static
void
startWhileTypingFadeoutAnimation
(
final
MainKeyboardView
keyboardView
)
{
cancelAndStartAnimators
(
keyboardView
.
mAltCodeKeyWhileTypingFadeinAnimator
,
keyboardView
.
mAltCodeKeyWhileTypingFadeoutAnimator
);
}
@Override
public
void
startTypingStateTimer
()
{
public
void
startTypingStateTimer
(
Key
typedKey
)
{
if
(
typedKey
.
isModifier
()
||
typedKey
.
altCodeWhileTyping
())
{
return
;
}
final
boolean
isTyping
=
isTypingState
();
removeMessages
(
MSG_TYPING_STATE_EXPIRED
);
final
MainKeyboardView
keyboardView
=
getOuterInstance
();
// When user hits the space or the enter key, just cancel the while-typing timer.
final
int
typedCode
=
typedKey
.
mCode
;
if
(
typedCode
==
Keyboard
.
CODE_SPACE
||
typedCode
==
Keyboard
.
CODE_ENTER
)
{
startWhileTypingFadeinAnimation
(
keyboardView
);
return
;
}
sendMessageDelayed
(
obtainMessage
(
MSG_TYPING_STATE_EXPIRED
),
mParams
.
mIgnoreAltCodeKeyTimeout
);
if
(
isTyping
)
{
return
;
}
final
MainKeyboardView
keyboardView
=
getOuterInstance
();
cancelAndStartAnimators
(
keyboardView
.
mAltCodeKeyWhileTypingFadeinAnimator
,
keyboardView
.
mAltCodeKeyWhileTypingFadeoutAnimator
);
startWhileTypingFadeoutAnimation
(
keyboardView
);
}
@Override
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+
4
−
8
View file @
8ec8c5fe
...
...
@@ -82,7 +82,7 @@ public class PointerTracker {
}
public
interface
TimerProxy
{
public
void
startTypingStateTimer
();
public
void
startTypingStateTimer
(
Key
typedKey
);
public
boolean
isTypingState
();
public
void
startKeyRepeatTimer
(
PointerTracker
tracker
);
public
void
startLongPressTimer
(
PointerTracker
tracker
);
...
...
@@ -95,7 +95,7 @@ public class PointerTracker {
public
static
class
Adapter
implements
TimerProxy
{
@Override
public
void
startTypingStateTimer
()
{}
public
void
startTypingStateTimer
(
Key
typedKey
)
{}
@Override
public
boolean
isTypingState
()
{
return
false
;
}
@Override
...
...
@@ -329,9 +329,7 @@ public class PointerTracker {
mListener
.
onPressKey
(
key
.
mCode
);
final
boolean
keyboardLayoutHasBeenChanged
=
mKeyboardLayoutHasBeenChanged
;
mKeyboardLayoutHasBeenChanged
=
false
;
if
(!
key
.
altCodeWhileTyping
()
&&
!
key
.
isModifier
())
{
mTimerProxy
.
startTypingStateTimer
();
}
mTimerProxy
.
startTypingStateTimer
(
key
);
return
keyboardLayoutHasBeenChanged
;
}
return
false
;
...
...
@@ -956,9 +954,7 @@ public class PointerTracker {
public
void
onRegisterKey
(
Key
key
)
{
if
(
key
!=
null
)
{
detectAndSendKey
(
key
,
key
.
mX
,
key
.
mY
);
if
(!
key
.
altCodeWhileTyping
()
&&
!
key
.
isModifier
())
{
mTimerProxy
.
startTypingStateTimer
();
}
mTimerProxy
.
startTypingStateTimer
(
key
);
}
}
...
...
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