diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 15:23:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 15:23:13 +0000 |
commit | 300a8683b9c28424fb0f0c571a0abe128c461f69 (patch) | |
tree | 3a325b0effac02fbd228b8ddf2f96589e5df72cd /java/com/android/incallui/contactgrid/ContactGridManager.java | |
parent | d67f1627521b174f12e0c247f154c7c93c5e408e (diff) | |
parent | 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 (diff) |
Update Dialer to V10 RC16
am: 10b34a5ebf
Change-Id: Iea3e96ccdeaf1fa796ceca702cace82ca20f298c
Diffstat (limited to 'java/com/android/incallui/contactgrid/ContactGridManager.java')
-rw-r--r-- | java/com/android/incallui/contactgrid/ContactGridManager.java | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java index ddbceb052..b3b775be2 100644 --- a/java/com/android/incallui/contactgrid/ContactGridManager.java +++ b/java/com/android/incallui/contactgrid/ContactGridManager.java @@ -17,6 +17,8 @@ package com.android.incallui.contactgrid; import android.content.Context; +import android.graphics.drawable.Animatable; +import android.graphics.drawable.Drawable; import android.os.SystemClock; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -24,8 +26,6 @@ import android.telecom.TelecomManager; import android.text.TextUtils; import android.view.View; import android.view.accessibility.AccessibilityEvent; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; import android.widget.Chronometer; import android.widget.ImageView; import android.widget.TextView; @@ -319,15 +319,22 @@ public class ContactGridManager { bottomTextView.setText(info.label); bottomTextView.setAllCaps(info.isSpamIconVisible); workIconImageView.setVisibility(info.isWorkIconVisible ? View.VISIBLE : View.GONE); - boolean wasHdIconVisible = hdIconImageView.getVisibility() == View.VISIBLE; - hdIconImageView.setVisibility( - info.isHdIconVisible || info.isHdAttemptingIconVisible ? View.VISIBLE : View.GONE); - if (!wasHdIconVisible && info.isHdAttemptingIconVisible) { - Animation animation = AnimationUtils.loadAnimation(context, R.anim.blinking); - hdIconImageView.startAnimation(animation); - } else if (wasHdIconVisible && !info.isHdAttemptingIconVisible) { - hdIconImageView.clearAnimation(); - hdIconImageView.setAlpha(1f); + if (hdIconImageView.getVisibility() == View.GONE) { + if (info.isHdAttemptingIconVisible) { + hdIconImageView.setVisibility(View.VISIBLE); + hdIconImageView.setActivated(false); + Drawable drawableCurrent = hdIconImageView.getDrawable().getCurrent(); + if (drawableCurrent instanceof Animatable && !((Animatable) drawableCurrent).isRunning()) { + ((Animatable) drawableCurrent).start(); + } + } else if (info.isHdIconVisible) { + hdIconImageView.setVisibility(View.VISIBLE); + hdIconImageView.setActivated(true); + } + } else if (info.isHdIconVisible) { + hdIconImageView.setActivated(true); + } else if (!info.isHdAttemptingIconVisible) { + hdIconImageView.setVisibility(View.GONE); } forwardIconImageView.setVisibility(info.isForwardIconVisible ? View.VISIBLE : View.GONE); spamIconImageView.setVisibility(info.isSpamIconVisible ? View.VISIBLE : View.GONE); |