mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Move call to setGroup to configureWith
This commit is contained in:
committed by
Benoit Marty
parent
3382aa2cfc
commit
674814e322
+1
-7
@@ -155,9 +155,6 @@ class DefaultNotificationCreator(
|
|||||||
setShortcutId(createShortcutId(roomInfo.sessionId, roomInfo.roomId))
|
setShortcutId(createShortcutId(roomInfo.sessionId, roomInfo.roomId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Auto-bundling is enabled for 4 or more notifications on API 24+ (N+)
|
|
||||||
// devices and all Wear devices. But we want a custom grouping, so we specify the groupID
|
|
||||||
.setGroup(roomInfo.sessionId.value)
|
|
||||||
.setGroupSummary(false)
|
.setGroupSummary(false)
|
||||||
// In order to avoid notification making sound twice (due to the summary notification)
|
// In order to avoid notification making sound twice (due to the summary notification)
|
||||||
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
|
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
|
||||||
@@ -236,7 +233,6 @@ class DefaultNotificationCreator(
|
|||||||
.setOnlyAlertOnce(true)
|
.setOnlyAlertOnce(true)
|
||||||
.setContentTitle((inviteNotifiableEvent.roomName ?: buildMeta.applicationName).annotateForDebug(5))
|
.setContentTitle((inviteNotifiableEvent.roomName ?: buildMeta.applicationName).annotateForDebug(5))
|
||||||
.setContentText(inviteNotifiableEvent.description.annotateForDebug(6))
|
.setContentText(inviteNotifiableEvent.description.annotateForDebug(6))
|
||||||
.setGroup(inviteNotifiableEvent.sessionId.value)
|
|
||||||
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL)
|
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL)
|
||||||
.configureWith(notificationAccountParams)
|
.configureWith(notificationAccountParams)
|
||||||
.apply {
|
.apply {
|
||||||
@@ -277,7 +273,6 @@ class DefaultNotificationCreator(
|
|||||||
.setOnlyAlertOnce(true)
|
.setOnlyAlertOnce(true)
|
||||||
.setContentTitle(buildMeta.applicationName.annotateForDebug(7))
|
.setContentTitle(buildMeta.applicationName.annotateForDebug(7))
|
||||||
.setContentText(simpleNotifiableEvent.description.annotateForDebug(8))
|
.setContentText(simpleNotifiableEvent.description.annotateForDebug(8))
|
||||||
.setGroup(simpleNotifiableEvent.sessionId.value)
|
|
||||||
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL)
|
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL)
|
||||||
.configureWith(notificationAccountParams)
|
.configureWith(notificationAccountParams)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
@@ -308,7 +303,6 @@ class DefaultNotificationCreator(
|
|||||||
.setOnlyAlertOnce(true)
|
.setOnlyAlertOnce(true)
|
||||||
.setContentTitle(buildMeta.applicationName.annotateForDebug(7))
|
.setContentTitle(buildMeta.applicationName.annotateForDebug(7))
|
||||||
.setContentText(fallbackNotifiableEvent.description.orEmpty().annotateForDebug(8))
|
.setContentText(fallbackNotifiableEvent.description.orEmpty().annotateForDebug(8))
|
||||||
.setGroup(fallbackNotifiableEvent.sessionId.value)
|
|
||||||
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL)
|
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_ALL)
|
||||||
.configureWith(notificationAccountParams)
|
.configureWith(notificationAccountParams)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
@@ -343,7 +337,6 @@ class DefaultNotificationCreator(
|
|||||||
// used in compat < N, after summary is built based on child notifications
|
// used in compat < N, after summary is built based on child notifications
|
||||||
.setWhen(lastMessageTimestamp)
|
.setWhen(lastMessageTimestamp)
|
||||||
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
|
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
|
||||||
.setGroup(userId.value)
|
|
||||||
// set this notification as the summary for the group
|
// set this notification as the summary for the group
|
||||||
.setGroupSummary(true)
|
.setGroupSummary(true)
|
||||||
.configureWith(notificationAccountParams)
|
.configureWith(notificationAccountParams)
|
||||||
@@ -476,6 +469,7 @@ class DefaultNotificationCreator(
|
|||||||
private fun NotificationCompat.Builder.configureWith(notificationAccountParams: NotificationAccountParams) = apply {
|
private fun NotificationCompat.Builder.configureWith(notificationAccountParams: NotificationAccountParams) = apply {
|
||||||
setSmallIcon(CommonDrawables.ic_notification)
|
setSmallIcon(CommonDrawables.ic_notification)
|
||||||
setColor(notificationAccountParams.color)
|
setColor(notificationAccountParams.color)
|
||||||
|
setGroup(notificationAccountParams.user.userId.value)
|
||||||
if (notificationAccountParams.showSessionId) {
|
if (notificationAccountParams.showSessionId) {
|
||||||
setSubText(notificationAccountParams.user.userId.value)
|
setSubText(notificationAccountParams.user.userId.value)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user