From b20b75ca5f1ebe893777355907886a1516df00b5 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 22 Mar 2016 15:32:00 -0700 Subject: [PATCH] Fixed the default of AlphaOptimizedImageViews overlapping rendering The default was true before, which lead to quite a few bugs. Moved done the introduced attrs to support it on AnimatedImageView Change-Id: I68714c22ceefff6bac7cd9496c83edd69256ee1b Fixes: 27745673 --- packages/SystemUI/res/layout/qs_detail.xml | 2 -- .../quick_status_bar_expanded_header.xml | 1 - .../res/layout/signal_cluster_view.xml | 7 ------ .../res/layout/status_bar_expanded_header.xml | 1 - packages/SystemUI/res/values/attrs.xml | 2 +- .../statusbar/AlphaOptimizedImageView.java | 17 +------------ .../systemui/statusbar/AnimatedImageView.java | 24 +++++++++++++++++-- 7 files changed, 24 insertions(+), 30 deletions(-) diff --git a/packages/SystemUI/res/layout/qs_detail.xml b/packages/SystemUI/res/layout/qs_detail.xml index 858f48737544a..3358a1869bdfb 100644 --- a/packages/SystemUI/res/layout/qs_detail.xml +++ b/packages/SystemUI/res/layout/qs_detail.xml @@ -17,7 +17,6 @@ - + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedImageView.java b/packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedImageView.java index 700ea346e3271..ef03d5f7e746c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedImageView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/AlphaOptimizedImageView.java @@ -17,18 +17,14 @@ package com.android.systemui.statusbar; import android.content.Context; -import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.ImageView; -import com.android.systemui.R; - /** * An ImageView which supports an attribute specifying whether it has overlapping rendering * commands and therefore does not need a layer when alpha is changed. */ public class AlphaOptimizedImageView extends ImageView { - private final boolean mHasOverlappingRendering; public AlphaOptimizedImageView(Context context) { this(context, null /* attrs */); @@ -45,21 +41,10 @@ public class AlphaOptimizedImageView extends ImageView { public AlphaOptimizedImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); - - TypedArray a = context.getTheme().obtainStyledAttributes(attrs, - R.styleable.AlphaOptimizedImageView, 0, 0); - - try { - // Default to true, which is what View.java defaults to - mHasOverlappingRendering = a.getBoolean( - R.styleable.AlphaOptimizedImageView_hasOverlappingRendering, true); - } finally { - a.recycle(); - } } @Override public boolean hasOverlappingRendering() { - return mHasOverlappingRendering; + return false; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java b/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java index 767022321209a..ae665c7fcee73 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/AnimatedImageView.java @@ -17,14 +17,19 @@ package com.android.systemui.statusbar; import android.content.Context; +import android.content.res.TypedArray; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; +import android.widget.ImageView; import android.widget.RemoteViews.RemoteView; +import com.android.systemui.R; + @RemoteView -public class AnimatedImageView extends AlphaOptimizedImageView { +public class AnimatedImageView extends ImageView { + private final boolean mHasOverlappingRendering; AnimationDrawable mAnim; boolean mAttached; @@ -34,11 +39,21 @@ public class AnimatedImageView extends AlphaOptimizedImageView { int mDrawableId; public AnimatedImageView(Context context) { - super(context); + this(context, null); } public AnimatedImageView(Context context, AttributeSet attrs) { super(context, attrs); + TypedArray a = context.getTheme().obtainStyledAttributes(attrs, + R.styleable.AnimatedImageView, 0, 0); + + try { + // Default to true, which is what View.java defaults toA + mHasOverlappingRendering = a.getBoolean( + R.styleable.AnimatedImageView_hasOverlappingRendering, true); + } finally { + a.recycle(); + } } private void updateAnim() { @@ -106,5 +121,10 @@ public class AnimatedImageView extends AlphaOptimizedImageView { } } } + + @Override + public boolean hasOverlappingRendering() { + return mHasOverlappingRendering; + } }