Added wearable dismiss action

pull/162/head
M66B 5 years ago
parent cfc01f4b94
commit 0f546900b9

@ -2499,6 +2499,12 @@ class Core {
Intent clear = new Intent(context, ServiceUI.class).setAction("clear:" + group);
PendingIntent piClear = PendingIntent.getService(context, ServiceUI.PI_CLEAR, clear, PendingIntent.FLAG_UPDATE_CURRENT);
// Wearable action
NotificationCompat.Action.Builder actionDismiss = new NotificationCompat.Action.Builder(
R.drawable.baseline_clear_all_24,
context.getString(R.string.title_dismiss),
piClear);
// Build title
String title = context.getResources().getQuantityString(
R.plurals.title_notification_unseen, messages.size(), messages.size());
@ -2517,7 +2523,9 @@ class Core {
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setGroup(Long.toString(group))
.setGroupSummary(true)
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN);
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
.extend(new NotificationCompat.WearableExtender()
.addAction(actionDismiss.build()));
if (pro && group != 0 && messages.size() > 0) {
TupleMessageEx amessage = messages.get(0);

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M5,13h14v-2L5,11v2zM3,17h14v-2L3,15v2zM7,7v2h14L21,7L7,7z"/>
</vector>

@ -835,6 +835,7 @@
<string name="title_after">After %1$s</string>
<string name="title_reset">Reset</string>
<string name="title_minutes">Minutes</string>
<string name="title_dismiss">Dismiss</string>
<string name="title_icalendar_accept">Accept</string>
<string name="title_icalendar_decline">Decline</string>

Loading…
Cancel
Save