diff options
author | Evan Charlton <evanc@google.com> | 2014-12-16 01:58:02 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-16 01:58:02 +0000 |
commit | 92433d18316e0d2dc22f250ffa53250f073f50eb (patch) | |
tree | 72a791339efb207b5b5c5a56dba3d31abb2df6bb | |
parent | 3d4e131577ac5b28ab50b8617fed712dc95f956b (diff) | |
parent | 30f9f98b0f23a8861df7f5081154f61ea1ea0441 (diff) |
am 616f0eac: am 2396cf49: Animate drawables if possible
* commit '616f0eaceb1996c9e61ab6842d3f4118a887366a':
Animate drawables if possible
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 9d11b4cfc..54fbb3008 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -25,6 +25,7 @@ import android.app.Activity; import android.content.Context; import android.content.res.Configuration; import android.graphics.Point; +import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.telecom.DisconnectCause; @@ -524,7 +525,12 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr || TextUtils.isEmpty(callStateLabel)) { mCallStateIcon.clearAnimation(); } else { - mCallStateIcon.startAnimation(mPulseAnimation); + if (callStateIcon instanceof AnimationDrawable) { + // Animate the drawable instead of the view + ((AnimationDrawable) callStateIcon).start(); + } else { + mCallStateIcon.startAnimation(mPulseAnimation); + } } } else { Animation callStateIconAnimation = mCallStateIcon.getAnimation(); |