mirror of https://github.com/M66B/FairEmail.git
Added contacts notification group
This commit is contained in:
parent
7f9b48f9cf
commit
913f85c467
|
@ -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);
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue