aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-04-12 16:25:53 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-04-12 16:43:24 +0900
commit45213ed2a6e9a940ec540ff43ded7e877cb20dc9 (patch)
tree482d2e30f40cb054ae04511904b72c1b1132c19e /java/src
parentf1678ba8024606349bc184cfeaead2be059f7b5b (diff)
downloadlatinime-45213ed2a6e9a940ec540ff43ded7e877cb20dc9.tar.gz
latinime-45213ed2a6e9a940ec540ff43ded7e877cb20dc9.tar.xz
latinime-45213ed2a6e9a940ec540ff43ded7e877cb20dc9.zip
Polish fade-in/out animations for the gray-out-while-typing keys
Bug: 6326723 Change-Id: Idb6fa023c497cf1f0f584f496e7e5ae82b1c9f4f
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index a08c0743a..7fadb3b8a 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -227,16 +227,16 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
removeMessages(MSG_LONGPRESS_KEY);
}
- public static void cancelAndStartAnimators(ObjectAnimator animatorToCancel,
- ObjectAnimator animatorToStart) {
- if (animatorToCancel != null && animatorToCancel.isStarted()) {
+ public static void cancelAndStartAnimators(final ObjectAnimator animatorToCancel,
+ final ObjectAnimator animatorToStart) {
+ float startFraction = 0.0f;
+ if (animatorToCancel.isStarted()) {
animatorToCancel.cancel();
+ startFraction = 1.0f - animatorToCancel.getAnimatedFraction();
}
- // TODO: Start the animation with an initial value that is the same as the final value
- // of the above animation when it gets cancelled.
- if (animatorToStart != null && !animatorToStart.isStarted()) {
- animatorToStart.start();
- }
+ final long startTime = (long)(animatorToStart.getDuration() * startFraction);
+ animatorToStart.start();
+ animatorToStart.setCurrentPlayTime(startTime);
}
@Override