Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +10 −3 Original line number Diff line number Diff line Loading @@ -357,16 +357,22 @@ public class ExpandableNotificationRow extends ActivatableNotificationView updateShelfIconColor(); } private void updateShelfIconColor() { @VisibleForTesting void updateShelfIconColor() { StatusBarIconView expandedIcon = mEntry.expandedIcon; boolean isPreL = Boolean.TRUE.equals(expandedIcon.getTag(R.id.icon_is_pre_L)); boolean colorize = !isPreL || NotificationUtils.isGrayscale(expandedIcon, NotificationColorUtil.getInstance(mContext)); int color = StatusBarIconView.NO_COLOR; if (colorize) { NotificationHeaderView header = getVisibleNotificationHeader(); if (header != null) { color = header.getOriginalIconColor(); } else { color = mEntry.getContrastedColor(mContext, mIsLowPriority && !isExpanded(), getBackgroundColorWithoutTint()); } } expandedIcon.setStaticDrawableColor(color); } Loading Loading @@ -1728,6 +1734,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView NotificationContentView showingLayout = getShowingLayout(); showingLayout.updateBackgroundColor(animated); mPrivateLayout.updateExpandButtons(isExpandable()); updateShelfIconColor(); showingLayout.setDark(isDark(), false /* animate */, 0 /* delay */); mShowingPublicInitialized = true; } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +2 −3 Original line number Diff line number Diff line Loading @@ -456,9 +456,8 @@ public class NotificationShelf extends ActivatableNotificationView implements } int shelfColor = icon.getStaticDrawableColor(); if (!noIcon && shelfColor != StatusBarIconView.NO_COLOR) { int notificationColor = row.getVisibleNotificationHeader().getOriginalNotificationColor(); shelfColor = NotificationUtils.interpolateColors(notificationColor, shelfColor, int iconColor = row.getVisibleNotificationHeader().getOriginalIconColor(); shelfColor = NotificationUtils.interpolateColors(iconColor, shelfColor, iconState.iconAppearAmount); } iconState.iconColor = shelfColor; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java +8 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.statusbar; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import android.content.Context; Loading Loading @@ -87,5 +88,11 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { verify(mockContainer).reInflateViews(any(), any()); } @Test public void testIconColorShouldBeUpdatedWhenSensitive() throws Exception { ExpandableNotificationRow row = spy(mNotificationTestHelper.createRow()); row.setSensitive(true, true); row.setHideSensitive(true, false, 0, 0); verify(row).updateShelfIconColor(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +10 −3 Original line number Diff line number Diff line Loading @@ -357,16 +357,22 @@ public class ExpandableNotificationRow extends ActivatableNotificationView updateShelfIconColor(); } private void updateShelfIconColor() { @VisibleForTesting void updateShelfIconColor() { StatusBarIconView expandedIcon = mEntry.expandedIcon; boolean isPreL = Boolean.TRUE.equals(expandedIcon.getTag(R.id.icon_is_pre_L)); boolean colorize = !isPreL || NotificationUtils.isGrayscale(expandedIcon, NotificationColorUtil.getInstance(mContext)); int color = StatusBarIconView.NO_COLOR; if (colorize) { NotificationHeaderView header = getVisibleNotificationHeader(); if (header != null) { color = header.getOriginalIconColor(); } else { color = mEntry.getContrastedColor(mContext, mIsLowPriority && !isExpanded(), getBackgroundColorWithoutTint()); } } expandedIcon.setStaticDrawableColor(color); } Loading Loading @@ -1728,6 +1734,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView NotificationContentView showingLayout = getShowingLayout(); showingLayout.updateBackgroundColor(animated); mPrivateLayout.updateExpandButtons(isExpandable()); updateShelfIconColor(); showingLayout.setDark(isDark(), false /* animate */, 0 /* delay */); mShowingPublicInitialized = true; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +2 −3 Original line number Diff line number Diff line Loading @@ -456,9 +456,8 @@ public class NotificationShelf extends ActivatableNotificationView implements } int shelfColor = icon.getStaticDrawableColor(); if (!noIcon && shelfColor != StatusBarIconView.NO_COLOR) { int notificationColor = row.getVisibleNotificationHeader().getOriginalNotificationColor(); shelfColor = NotificationUtils.interpolateColors(notificationColor, shelfColor, int iconColor = row.getVisibleNotificationHeader().getOriginalIconColor(); shelfColor = NotificationUtils.interpolateColors(iconColor, shelfColor, iconState.iconAppearAmount); } iconState.iconColor = shelfColor; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java +8 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.statusbar; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import android.content.Context; Loading Loading @@ -87,5 +88,11 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { verify(mockContainer).reInflateViews(any(), any()); } @Test public void testIconColorShouldBeUpdatedWhenSensitive() throws Exception { ExpandableNotificationRow row = spy(mNotificationTestHelper.createRow()); row.setSensitive(true, true); row.setHideSensitive(true, false, 0, 0); verify(row).updateShelfIconColor(); } }