aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-05-15 11:04:55 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-15 11:04:55 -0700
commit037be7fa0a50b7c4bfc1368b9e9e158473f2e3b5 (patch)
tree1fc7374a42e09284ccaf28d702914d728ea0edbf /java
parentb55f0be85c51d07c6e64d8fc59279349045e52aa (diff)
parent3385fe8ff58cf42f1c1abac85d6d2ba2aa62ff32 (diff)
downloadlatinime-037be7fa0a50b7c4bfc1368b9e9e158473f2e3b5.tar.gz
latinime-037be7fa0a50b7c4bfc1368b9e9e158473f2e3b5.tar.xz
latinime-037be7fa0a50b7c4bfc1368b9e9e158473f2e3b5.zip
am 3385fe8f: am 9fc82bdb: Merge "Remove graying animation of alt-code keys while typing"
* commit '3385fe8ff58cf42f1c1abac85d6d2ba2aa62ff32': Remove graying animation of alt-code keys while typing
Diffstat (limited to 'java')
-rw-r--r--java/res/values/styles.xml2
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java5
2 files changed, 7 insertions, 0 deletions
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index 436e080f7..dad7e2064 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -94,8 +94,10 @@
<item name="showMoreKeysKeyboardAtTouchedPoint">@bool/config_show_more_keys_keyboard_at_touched_point</item>
<item name="languageOnSpacebarFinalAlpha">@integer/config_language_on_spacebar_final_alpha</item>
<item name="languageOnSpacebarFadeoutAnimator">@anim/language_on_spacebar_fadeout</item>
+ <!-- Remove animations for now because it could drain a non-negligible amount of battery while typing.
<item name="altCodeKeyWhileTypingFadeoutAnimator">@anim/alt_code_key_while_typing_fadeout</item>
<item name="altCodeKeyWhileTypingFadeinAnimator">@anim/alt_code_key_while_typing_fadein</item>
+ -->
<!-- Common attributes of MainKeyboardView for gesture typing detection and recognition -->
<item name="gestureFloatingPreviewTextLingerTimeout">@integer/config_gesture_floating_preview_text_linger_timeout</item>
<item name="gestureStaticTimeThresholdAfterFastTyping">@integer/config_gesture_static_time_threshold_after_fast_typing</item>
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 454469ce7..8d4beeced 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -333,6 +333,10 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
private static void cancelAndStartAnimators(final ObjectAnimator animatorToCancel,
final ObjectAnimator animatorToStart) {
+ if (animatorToCancel == null || animatorToStart == null) {
+ // TODO: Stop using null as a no-operation animator.
+ return;
+ }
float startFraction = 0.0f;
if (animatorToCancel.isStarted()) {
animatorToCancel.cancel();
@@ -581,6 +585,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
private ObjectAnimator loadObjectAnimator(final int resId, final Object target) {
if (resId == 0) {
+ // TODO: Stop returning null.
return null;
}
final ObjectAnimator animator = (ObjectAnimator)AnimatorInflater.loadAnimator(