Merge "Do not highlight group expanders" into sc-dev

This commit is contained in:
Jeff DeCew
2021-04-06 15:10:57 +00:00
committed by Android (Google) Code Review

View File

@@ -5358,8 +5358,8 @@ public class Notification implements Parcelable
int pillColor = getProtectionColor(p); int pillColor = getProtectionColor(p);
contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor); contentView.setInt(R.id.expand_button, "setDefaultTextColor", textColor);
contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor);
// Use different highlighted colors except when low-priority mode prevents that // Use different highlighted colors for conversations' unread count
if (!p.mReduceHighlights) { if (p.mHighlightExpander) {
pillColor = getAccentTertiaryColor(p); pillColor = getAccentTertiaryColor(p);
// TODO(b/183710694): The accent tertiary is currently too bright in dark mode, so // TODO(b/183710694): The accent tertiary is currently too bright in dark mode, so
// we need to pick a contrasting color. // we need to pick a contrasting color.
@@ -5993,7 +5993,7 @@ public class Notification implements Parcelable
.viewType(StandardTemplateParams.VIEW_TYPE_PUBLIC) .viewType(StandardTemplateParams.VIEW_TYPE_PUBLIC)
.fillTextsFrom(this); .fillTextsFrom(this);
if (isLowPriority) { if (isLowPriority) {
params.reduceHighlights(); params.highlightExpander(false);
} }
view = makeNotificationHeader(params); view = makeNotificationHeader(params);
view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true); view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true);
@@ -6016,7 +6016,7 @@ public class Notification implements Parcelable
public RemoteViews makeLowPriorityContentView(boolean useRegularSubtext) { public RemoteViews makeLowPriorityContentView(boolean useRegularSubtext) {
StandardTemplateParams p = mParams.reset() StandardTemplateParams p = mParams.reset()
.viewType(StandardTemplateParams.VIEW_TYPE_MINIMIZED) .viewType(StandardTemplateParams.VIEW_TYPE_MINIMIZED)
.reduceHighlights() .highlightExpander(false)
.fillTextsFrom(this); .fillTextsFrom(this);
if (!useRegularSubtext || TextUtils.isEmpty(mParams.summaryText)) { if (!useRegularSubtext || TextUtils.isEmpty(mParams.summaryText)) {
p.summaryText(createSummaryText()); p.summaryText(createSummaryText());
@@ -8293,6 +8293,7 @@ public class Notification implements Parcelable
StandardTemplateParams p = mBuilder.mParams.reset() StandardTemplateParams p = mBuilder.mParams.reset()
.viewType(isCollapsed ? StandardTemplateParams.VIEW_TYPE_NORMAL .viewType(isCollapsed ? StandardTemplateParams.VIEW_TYPE_NORMAL
: StandardTemplateParams.VIEW_TYPE_BIG) : StandardTemplateParams.VIEW_TYPE_BIG)
.highlightExpander(isConversationLayout)
.hideProgress(true) .hideProgress(true)
.title(conversationTitle) .title(conversationTitle)
.text(null) .text(null)
@@ -12178,7 +12179,7 @@ public class Notification implements Parcelable
int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; int maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES;
boolean hideLargeIcon; boolean hideLargeIcon;
boolean allowColorization = true; boolean allowColorization = true;
boolean mReduceHighlights = false; boolean mHighlightExpander = false;
final StandardTemplateParams reset() { final StandardTemplateParams reset() {
mViewType = VIEW_TYPE_UNSPECIFIED; mViewType = VIEW_TYPE_UNSPECIFIED;
@@ -12202,7 +12203,7 @@ public class Notification implements Parcelable
maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES; maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES;
hideLargeIcon = false; hideLargeIcon = false;
allowColorization = true; allowColorization = true;
mReduceHighlights = false; mHighlightExpander = false;
return this; return this;
} }
@@ -12310,8 +12311,8 @@ public class Notification implements Parcelable
return this; return this;
} }
final StandardTemplateParams reduceHighlights() { final StandardTemplateParams highlightExpander(boolean highlight) {
this.mReduceHighlights = true; this.mHighlightExpander = highlight;
return this; return this;
} }