Fixed a bug where the fade in from dark would not work properly
Change-Id: Idd0b38b40b06806c727d8e033847a0da0b51f55e Fixes: 30224123
This commit is contained in:
@@ -137,11 +137,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
|||||||
|
|
||||||
private float mNormalBackgroundVisibilityAmount;
|
private float mNormalBackgroundVisibilityAmount;
|
||||||
private ValueAnimator mFadeInFromDarkAnimator;
|
private ValueAnimator mFadeInFromDarkAnimator;
|
||||||
|
private float mDimmedBackgroundFadeInAmount = -1;
|
||||||
private ValueAnimator.AnimatorUpdateListener mBackgroundVisibilityUpdater
|
private ValueAnimator.AnimatorUpdateListener mBackgroundVisibilityUpdater
|
||||||
= new ValueAnimator.AnimatorUpdateListener() {
|
= new ValueAnimator.AnimatorUpdateListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationUpdate(ValueAnimator animation) {
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
setNormalBackgroundVisibilityAmount(mBackgroundNormal.getAlpha());
|
setNormalBackgroundVisibilityAmount(mBackgroundNormal.getAlpha());
|
||||||
|
mDimmedBackgroundFadeInAmount = mBackgroundDimmed.getAlpha();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private AnimatorListenerAdapter mFadeInEndListener = new AnimatorListenerAdapter() {
|
private AnimatorListenerAdapter mFadeInEndListener = new AnimatorListenerAdapter() {
|
||||||
@@ -149,6 +151,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
|||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
super.onAnimationEnd(animation);
|
super.onAnimationEnd(animation);
|
||||||
mFadeInFromDarkAnimator = null;
|
mFadeInFromDarkAnimator = null;
|
||||||
|
mDimmedBackgroundFadeInAmount = -1;
|
||||||
updateBackground();
|
updateBackground();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -597,7 +600,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void updateBackgroundAlpha(float transformationAmount) {
|
protected void updateBackgroundAlpha(float transformationAmount) {
|
||||||
mBgAlpha = isChildInGroup() && mDimmed ? transformationAmount : 1f;
|
mBgAlpha = isChildInGroup() && mDimmed ? transformationAmount : 1f;
|
||||||
|
if (mDimmedBackgroundFadeInAmount != -1) {
|
||||||
|
mBgAlpha *= mDimmedBackgroundFadeInAmount;
|
||||||
|
}
|
||||||
mBackgroundDimmed.setAlpha(mBgAlpha);
|
mBackgroundDimmed.setAlpha(mBgAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1122,7 +1122,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
|||||||
mPrivateLayout.setUserExpanding(userLocked);
|
mPrivateLayout.setUserExpanding(userLocked);
|
||||||
if (mIsSummaryWithChildren) {
|
if (mIsSummaryWithChildren) {
|
||||||
mChildrenContainer.setUserLocked(userLocked);
|
mChildrenContainer.setUserLocked(userLocked);
|
||||||
if (userLocked || (!userLocked && !isGroupExpanded())) {
|
if (userLocked || !isGroupExpanded()) {
|
||||||
updateBackgroundForGroupState();
|
updateBackgroundForGroupState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user