Loading packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java +14 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public class AnimatedImageView extends ImageView { private final boolean mHasOverlappingRendering; AnimationDrawable mAnim; boolean mAttached; private boolean mAllowAnimation; // Tracks the last image that was set, so that we don't refresh the image if it is exactly // the same as the previous one. If this is a resid, we track that. If it's a drawable, we Loading @@ -56,6 +57,17 @@ public class AnimatedImageView extends ImageView { } } public void setAllowAnimation(boolean allowAnimation) { if (mAllowAnimation != allowAnimation) { mAllowAnimation = allowAnimation; updateAnim(); if (!mAllowAnimation && mAnim != null) { // Reset drawable such that we show the first frame whenever we're not animating. mAnim.setVisible(getVisibility() == VISIBLE, true /* restart */); } } } private void updateAnim() { Drawable drawable = getDrawable(); if (mAttached && mAnim != null) { Loading @@ -63,7 +75,7 @@ public class AnimatedImageView extends ImageView { } if (drawable instanceof AnimationDrawable) { mAnim = (AnimationDrawable) drawable; if (isShown()) { if (isShown() && mAllowAnimation) { mAnim.start(); } } else { Loading Loading @@ -114,7 +126,7 @@ public class AnimatedImageView extends ImageView { protected void onVisibilityChanged(View changedView, int vis) { super.onVisibilityChanged(changedView, vis); if (mAnim != null) { if (isShown()) { if (isShown() && mAllowAnimation) { mAnim.start(); } else { mAnim.stop(); Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +7 −0 Original line number Diff line number Diff line Loading @@ -756,9 +756,16 @@ public class StatusBarIconView extends AnimatedImageView { updateIconScale(); updateDecorColor(); updateIconColor(); updateAllowAnimation(); }, dark, fade, delay); } private void updateAllowAnimation() { if (mDarkAmount == 0 || mDarkAmount == 1) { setAllowAnimation(mDarkAmount == 0); } } public interface OnVisibilityChangedListener { void onVisibilityChanged(int newVisibility); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java +14 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public class AnimatedImageView extends ImageView { private final boolean mHasOverlappingRendering; AnimationDrawable mAnim; boolean mAttached; private boolean mAllowAnimation; // Tracks the last image that was set, so that we don't refresh the image if it is exactly // the same as the previous one. If this is a resid, we track that. If it's a drawable, we Loading @@ -56,6 +57,17 @@ public class AnimatedImageView extends ImageView { } } public void setAllowAnimation(boolean allowAnimation) { if (mAllowAnimation != allowAnimation) { mAllowAnimation = allowAnimation; updateAnim(); if (!mAllowAnimation && mAnim != null) { // Reset drawable such that we show the first frame whenever we're not animating. mAnim.setVisible(getVisibility() == VISIBLE, true /* restart */); } } } private void updateAnim() { Drawable drawable = getDrawable(); if (mAttached && mAnim != null) { Loading @@ -63,7 +75,7 @@ public class AnimatedImageView extends ImageView { } if (drawable instanceof AnimationDrawable) { mAnim = (AnimationDrawable) drawable; if (isShown()) { if (isShown() && mAllowAnimation) { mAnim.start(); } } else { Loading Loading @@ -114,7 +126,7 @@ public class AnimatedImageView extends ImageView { protected void onVisibilityChanged(View changedView, int vis) { super.onVisibilityChanged(changedView, vis); if (mAnim != null) { if (isShown()) { if (isShown() && mAllowAnimation) { mAnim.start(); } else { mAnim.stop(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +7 −0 Original line number Diff line number Diff line Loading @@ -756,9 +756,16 @@ public class StatusBarIconView extends AnimatedImageView { updateIconScale(); updateDecorColor(); updateIconColor(); updateAllowAnimation(); }, dark, fade, delay); } private void updateAllowAnimation() { if (mDarkAmount == 0 || mDarkAmount == 1) { setAllowAnimation(mDarkAmount == 0); } } public interface OnVisibilityChangedListener { void onVisibilityChanged(int newVisibility); } Loading