mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 20:08:27 +00:00
Add number of messages to the notification number attribute
Although not used by stock Android, many custom ROM's (and possibly OEM versions?) have a setting to display the "number" count of a notification overlayed on the status bar icon. Add support for this. Closes #1637
This commit is contained in:
parent
d1dd50e31c
commit
19ae5043cc
@ -172,6 +172,7 @@ public class MessageNotifier {
|
|||||||
builder.setContentText(notifications.get(0).getText());
|
builder.setContentText(notifications.get(0).getText());
|
||||||
builder.setContentIntent(notifications.get(0).getPendingIntent(context));
|
builder.setContentIntent(notifications.get(0).getPendingIntent(context));
|
||||||
builder.setContentInfo(String.valueOf(notificationState.getMessageCount()));
|
builder.setContentInfo(String.valueOf(notificationState.getMessageCount()));
|
||||||
|
builder.setNumber(notificationState.getMessageCount());
|
||||||
|
|
||||||
if (masterSecret != null) {
|
if (masterSecret != null) {
|
||||||
builder.addAction(R.drawable.check, context.getString(R.string.MessageNotifier_mark_as_read),
|
builder.addAction(R.drawable.check, context.getString(R.string.MessageNotifier_mark_as_read),
|
||||||
@ -215,6 +216,7 @@ public class MessageNotifier {
|
|||||||
builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, RoutingActivity.class), 0));
|
builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, RoutingActivity.class), 0));
|
||||||
|
|
||||||
builder.setContentInfo(String.valueOf(notificationState.getMessageCount()));
|
builder.setContentInfo(String.valueOf(notificationState.getMessageCount()));
|
||||||
|
builder.setNumber(notificationState.getMessageCount());
|
||||||
|
|
||||||
if (masterSecret != null) {
|
if (masterSecret != null) {
|
||||||
builder.addAction(R.drawable.check, context.getString(R.string.MessageNotifier_mark_all_as_read),
|
builder.addAction(R.drawable.check, context.getString(R.string.MessageNotifier_mark_all_as_read),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user