Merge "Fixed an issue where icons could remain white" into pi-dev

This commit is contained in:
Selim Cinek
2018-05-17 01:22:41 +00:00
committed by Android (Google) Code Review
4 changed files with 23 additions and 4 deletions

View File

@@ -61,6 +61,7 @@
<item type="id" name="notification_temperature"/>
<item type="id" name="notification_plugin"/>
<item type="id" name="transformation_start_x_tag"/>
<item type="id" name="doze_intensity_tag"/>
<item type="id" name="transformation_start_y_tag"/>
<item type="id" name="transformation_start_actual_width"/>
<item type="id" name="transformation_start_actual_height"/>

View File

@@ -806,7 +806,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
updateDecorColor();
updateIconColor();
updateAllowAnimation();
}, dark, fade, delay);
}, dark, fade, delay, this);
}
private void updateAllowAnimation() {

View File

@@ -166,7 +166,7 @@ public class HybridGroupManager {
mDozer.setIntensityDark((f)->{
mDarkAmount = f;
updateOverFlowNumberColor(view);
}, dark, fade, delay);
}, dark, fade, delay, view);
view.setTextSize(TypedValue.COMPLEX_UNIT_PX,
dark ? mOverflowNumberSizeDark : mOverflowNumberSize);
int paddingEnd = dark ? mOverflowNumberPaddingDark : mOverflowNumberPadding;

View File

@@ -21,14 +21,17 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.view.View;
import android.widget.ImageView;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import java.util.function.Consumer;
public class NotificationDozeHelper {
private static final int DOZE_ANIMATOR_TAG = R.id.doze_intensity_tag;
private final ColorMatrix mGrayscaleColorMatrix = new ColorMatrix();
public void fadeGrayscale(final ImageView target, final boolean dark, long delay) {
@@ -76,11 +79,26 @@ public class NotificationDozeHelper {
}
public void setIntensityDark(Consumer<Float> listener, boolean dark,
boolean animate, long delay) {
boolean animate, long delay, View view) {
if (animate) {
startIntensityAnimation(a -> listener.accept((Float) a.getAnimatedValue()), dark, delay,
null /* listener */);
new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setTag(DOZE_ANIMATOR_TAG, null);
}
@Override
public void onAnimationStart(Animator animation) {
view.setTag(DOZE_ANIMATOR_TAG, animation);
}
} /* listener */);
} else {
Animator animator = (Animator) view.getTag(DOZE_ANIMATOR_TAG);
if (animator != null) {
animator.cancel();
}
listener.accept(dark ? 1f : 0f);
}
}