Merge "Add subtitle for Do not disturb" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-17 09:08:17 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 0 deletions

View File

@@ -7432,6 +7432,9 @@
<!-- Sound: Title for the Do not Disturb option and associated settings page. [CHAR LIMIT=50]--> <!-- Sound: Title for the Do not Disturb option and associated settings page. [CHAR LIMIT=50]-->
<string name="zen_mode_settings_title">Do Not Disturb</string> <string name="zen_mode_settings_title">Do Not Disturb</string>
<!-- Subtitle for the Do not Disturb slice. [CHAR LIMIT=50]-->
<string name="zen_mode_slice_subtitle">Limit interruptions</string>
<!-- Do not disturb: Title for the Do not Disturb dialog to turn on Do not disturb. [CHAR LIMIT=50]--> <!-- Do not disturb: Title for the Do not Disturb dialog to turn on Do not disturb. [CHAR LIMIT=50]-->
<string name="zen_mode_settings_turn_on_dialog_title">Turn on Do Not Disturb</string> <string name="zen_mode_settings_turn_on_dialog_title">Turn on Do Not Disturb</string>

View File

@@ -73,6 +73,7 @@ public class ZenModeSliceBuilder {
public static Slice getSlice(Context context) { public static Slice getSlice(Context context) {
final boolean isZenModeEnabled = isZenModeEnabled(context); final boolean isZenModeEnabled = isZenModeEnabled(context);
final CharSequence title = context.getText(R.string.zen_mode_settings_title); final CharSequence title = context.getText(R.string.zen_mode_settings_title);
final CharSequence subtitle = context.getText(R.string.zen_mode_slice_subtitle);
@ColorInt final int color = Utils.getColorAccentDefaultColor(context); @ColorInt final int color = Utils.getColorAccentDefaultColor(context);
final PendingIntent toggleAction = getBroadcastIntent(context); final PendingIntent toggleAction = getBroadcastIntent(context);
final PendingIntent primaryAction = getPrimaryAction(context); final PendingIntent primaryAction = getPrimaryAction(context);
@@ -87,6 +88,7 @@ public class ZenModeSliceBuilder {
.setAccentColor(color) .setAccentColor(color)
.addRow(new RowBuilder() .addRow(new RowBuilder()
.setTitle(title) .setTitle(title)
.setSubtitle(subtitle)
.addEndItem(toggleSliceAction) .addEndItem(toggleSliceAction)
.setPrimaryAction(primarySliceAction)) .setPrimaryAction(primarySliceAction))
.build(); .build();