Added contacts notification group

This commit is contained in:
M66B 2019-03-17 18:06:51 +00:00
parent 7f9b48f9cf
commit 913f85c467
3 changed files with 10 additions and 0 deletions

View File

@ -1235,6 +1235,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
NotificationChannel channel = new NotificationChannel(
channelName, from.getAddress(),
NotificationManager.IMPORTANCE_HIGH);
channel.setGroup("contacts");
channel.setDescription(from.getPersonal());
channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
nm.createNotificationChannel(channel);

View File

@ -22,6 +22,7 @@ package eu.faircode.email;
import android.app.Application;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
import android.app.NotificationManager;
import android.content.Context;
import android.media.Ringtone;
@ -117,6 +118,11 @@ public class ApplicationEx extends Application {
NotificationManager.IMPORTANCE_HIGH);
error.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
nm.createNotificationChannel(error);
NotificationChannelGroup group = new NotificationChannelGroup(
"contacts",
getString(R.string.channel_group_contacts));
nm.createNotificationChannelGroup(group);
}
}
@ -171,6 +177,8 @@ public class ApplicationEx extends Application {
if (jchannel.has("group") && !jchannel.isNull("group"))
channel.setGroup(jchannel.getString("group"));
else
channel.setGroup("contacts");
if (jchannel.has("description") && !jchannel.isNull("description"))
channel.setDescription(jchannel.getString("description"));

View File

@ -10,6 +10,7 @@
<string name="channel_notification">Notifications</string>
<string name="channel_warning">Warnings</string>
<string name="channel_error">Errors</string>
<string name="channel_group_contacts">Contacts</string>
<string name="tile_synchronize">Synchronize</string>
<string name="tile_unseen">New messages</string>