Loading packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +19 −2 Original line number Original line Diff line number Diff line Loading @@ -98,6 +98,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private boolean mDark; private boolean mDark; private int mBgTint = 0; private int mBgTint = 0; private float mBgAlpha = 1f; /** /** * Flag to indicate that the notification has been touched once and the second touch will * Flag to indicate that the notification has been touched once and the second touch will Loading Loading @@ -392,6 +393,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView public void setDimmed(boolean dimmed, boolean fade) { public void setDimmed(boolean dimmed, boolean fade) { if (mDimmed != dimmed) { if (mDimmed != dimmed) { mDimmed = dimmed; mDimmed = dimmed; resetBackgroundAlpha(); if (fade) { if (fade) { fadeDimmedBackground(); fadeDimmedBackground(); } else { } else { Loading Loading @@ -594,14 +596,28 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mBackgroundAnimator.start(); mBackgroundAnimator.start(); } } protected void updateBackgroundAlpha(float transformationAmount) { mBgAlpha = isChildInGroup() && mDimmed ? transformationAmount : 1f; mBackgroundDimmed.setAlpha(mBgAlpha); } protected void resetBackgroundAlpha() { updateBackgroundAlpha(0f /* transformationAmount */); } protected void updateBackground() { protected void updateBackground() { cancelFadeAnimations(); cancelFadeAnimations(); if (shouldHideBackground()) { if (shouldHideBackground()) { mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundNormal.setVisibility(View.INVISIBLE); mBackgroundNormal.setVisibility(View.INVISIBLE); } else if (mDimmed) { } else if (mDimmed) { mBackgroundDimmed.setVisibility(View.VISIBLE); // When groups are animating to the expanded state from the lockscreen, show the mBackgroundNormal.setVisibility(mActivated ? View.VISIBLE : View.INVISIBLE); // normal background instead of the dimmed background final boolean dontShowDimmed = isGroupExpansionChanging() && isChildInGroup(); mBackgroundDimmed.setVisibility(dontShowDimmed ? View.INVISIBLE : View.VISIBLE); mBackgroundNormal.setVisibility((mActivated || dontShowDimmed) ? View.VISIBLE : View.INVISIBLE); } else { } else { mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundNormal.setVisibility(View.VISIBLE); mBackgroundNormal.setVisibility(View.VISIBLE); Loading Loading @@ -876,6 +892,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView public void reset() { public void reset() { setTintColor(0); setTintColor(0); resetBackgroundAlpha(); setShowingLegacyBackground(false); setShowingLegacyBackground(false); setBelowSpeedBump(false); setBelowSpeedBump(false); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -381,6 +381,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { boolean childInGroup = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && isChildInGroup; boolean childInGroup = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && isChildInGroup; mNotificationParent = childInGroup ? parent : null; mNotificationParent = childInGroup ? parent : null; mPrivateLayout.setIsChildInGroup(childInGroup); mPrivateLayout.setIsChildInGroup(childInGroup); resetBackgroundAlpha(); updateBackgroundForGroupState(); updateBackgroundForGroupState(); updateClickAndFocus(); updateClickAndFocus(); if (mNotificationParent != null) { if (mNotificationParent != null) { Loading Loading @@ -1072,7 +1073,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mPrivateLayout.setUserExpanding(userLocked); mPrivateLayout.setUserExpanding(userLocked); if (mIsSummaryWithChildren) { if (mIsSummaryWithChildren) { mChildrenContainer.setUserLocked(userLocked); mChildrenContainer.setUserLocked(userLocked); if (userLocked) { if (userLocked || (!userLocked && !isGroupExpanded())) { updateBackgroundForGroupState(); updateBackgroundForGroupState(); } } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -462,6 +462,7 @@ public class NotificationContentView extends FrameLayout { endColor = NotificationUtils.interpolateColors(startColor, endColor, endColor = NotificationUtils.interpolateColors(startColor, endColor, transformationAmount); transformationAmount); } } mContainingNotification.updateBackgroundAlpha(transformationAmount); mContainingNotification.setContentBackground(endColor, false, this); mContainingNotification.setContentBackground(endColor, false, this); } } Loading Loading @@ -594,6 +595,7 @@ public class NotificationContentView extends FrameLayout { public void updateBackgroundColor(boolean animate) { public void updateBackgroundColor(boolean animate) { int customBackgroundColor = getBackgroundColor(mVisibleType); int customBackgroundColor = getBackgroundColor(mVisibleType); mContainingNotification.resetBackgroundAlpha(); mContainingNotification.setContentBackground(customBackgroundColor, animate, this); mContainingNotification.setContentBackground(customBackgroundColor, animate, this); } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +19 −2 Original line number Original line Diff line number Diff line Loading @@ -98,6 +98,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private boolean mDark; private boolean mDark; private int mBgTint = 0; private int mBgTint = 0; private float mBgAlpha = 1f; /** /** * Flag to indicate that the notification has been touched once and the second touch will * Flag to indicate that the notification has been touched once and the second touch will Loading Loading @@ -392,6 +393,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView public void setDimmed(boolean dimmed, boolean fade) { public void setDimmed(boolean dimmed, boolean fade) { if (mDimmed != dimmed) { if (mDimmed != dimmed) { mDimmed = dimmed; mDimmed = dimmed; resetBackgroundAlpha(); if (fade) { if (fade) { fadeDimmedBackground(); fadeDimmedBackground(); } else { } else { Loading Loading @@ -594,14 +596,28 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mBackgroundAnimator.start(); mBackgroundAnimator.start(); } } protected void updateBackgroundAlpha(float transformationAmount) { mBgAlpha = isChildInGroup() && mDimmed ? transformationAmount : 1f; mBackgroundDimmed.setAlpha(mBgAlpha); } protected void resetBackgroundAlpha() { updateBackgroundAlpha(0f /* transformationAmount */); } protected void updateBackground() { protected void updateBackground() { cancelFadeAnimations(); cancelFadeAnimations(); if (shouldHideBackground()) { if (shouldHideBackground()) { mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundNormal.setVisibility(View.INVISIBLE); mBackgroundNormal.setVisibility(View.INVISIBLE); } else if (mDimmed) { } else if (mDimmed) { mBackgroundDimmed.setVisibility(View.VISIBLE); // When groups are animating to the expanded state from the lockscreen, show the mBackgroundNormal.setVisibility(mActivated ? View.VISIBLE : View.INVISIBLE); // normal background instead of the dimmed background final boolean dontShowDimmed = isGroupExpansionChanging() && isChildInGroup(); mBackgroundDimmed.setVisibility(dontShowDimmed ? View.INVISIBLE : View.VISIBLE); mBackgroundNormal.setVisibility((mActivated || dontShowDimmed) ? View.VISIBLE : View.INVISIBLE); } else { } else { mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundDimmed.setVisibility(View.INVISIBLE); mBackgroundNormal.setVisibility(View.VISIBLE); mBackgroundNormal.setVisibility(View.VISIBLE); Loading Loading @@ -876,6 +892,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView public void reset() { public void reset() { setTintColor(0); setTintColor(0); resetBackgroundAlpha(); setShowingLegacyBackground(false); setShowingLegacyBackground(false); setBelowSpeedBump(false); setBelowSpeedBump(false); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -381,6 +381,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { boolean childInGroup = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && isChildInGroup; boolean childInGroup = BaseStatusBar.ENABLE_CHILD_NOTIFICATIONS && isChildInGroup; mNotificationParent = childInGroup ? parent : null; mNotificationParent = childInGroup ? parent : null; mPrivateLayout.setIsChildInGroup(childInGroup); mPrivateLayout.setIsChildInGroup(childInGroup); resetBackgroundAlpha(); updateBackgroundForGroupState(); updateBackgroundForGroupState(); updateClickAndFocus(); updateClickAndFocus(); if (mNotificationParent != null) { if (mNotificationParent != null) { Loading Loading @@ -1072,7 +1073,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mPrivateLayout.setUserExpanding(userLocked); mPrivateLayout.setUserExpanding(userLocked); if (mIsSummaryWithChildren) { if (mIsSummaryWithChildren) { mChildrenContainer.setUserLocked(userLocked); mChildrenContainer.setUserLocked(userLocked); if (userLocked) { if (userLocked || (!userLocked && !isGroupExpanded())) { updateBackgroundForGroupState(); updateBackgroundForGroupState(); } } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -462,6 +462,7 @@ public class NotificationContentView extends FrameLayout { endColor = NotificationUtils.interpolateColors(startColor, endColor, endColor = NotificationUtils.interpolateColors(startColor, endColor, transformationAmount); transformationAmount); } } mContainingNotification.updateBackgroundAlpha(transformationAmount); mContainingNotification.setContentBackground(endColor, false, this); mContainingNotification.setContentBackground(endColor, false, this); } } Loading Loading @@ -594,6 +595,7 @@ public class NotificationContentView extends FrameLayout { public void updateBackgroundColor(boolean animate) { public void updateBackgroundColor(boolean animate) { int customBackgroundColor = getBackgroundColor(mVisibleType); int customBackgroundColor = getBackgroundColor(mVisibleType); mContainingNotification.resetBackgroundAlpha(); mContainingNotification.setContentBackground(customBackgroundColor, animate, this); mContainingNotification.setContentBackground(customBackgroundColor, animate, this); } } Loading