Implement Notification Settings

- Add UI and logic to inform the user of mismatched notification settings and help them correct it.
- Display a warning when the system notification settings are disabled and a link out to the app settings.
- A toggle to disable notifications for the device
- A screen for editing the group and direct chat notification defaults.
- A toggle for switching on/off atRoom and call notifications.
This commit is contained in:
David Langley 2023-09-12 01:11:13 +01:00
parent e64f0bd7d9
commit a0ac324e3f
27 changed files with 924 additions and 59 deletions

View file

@ -36,14 +36,18 @@ class FakeNotificationSettingsService : NotificationSettingsService {
override val notificationSettingsChangeFlow: SharedFlow<Unit>
get() = _roomNotificationSettingsStateFlow
override suspend fun getRoomNotificationSettings(roomId: RoomId, isEncrypted: Boolean, membersCount: Long): Result<RoomNotificationSettings> {
override suspend fun getRoomNotificationSettings(roomId: RoomId, isEncrypted: Boolean, isOneToOne: Boolean): Result<RoomNotificationSettings> {
return getRoomNotificationSettingsResult
}
override suspend fun getDefaultRoomNotificationMode(isEncrypted: Boolean, membersCount: Long): Result<RoomNotificationMode> {
override suspend fun getDefaultRoomNotificationMode(isEncrypted: Boolean, isOneToOne: Boolean): Result<RoomNotificationMode> {
return getDefaultRoomNotificationMode
}
override suspend fun setDefaultRoomNotificationMode(isEncrypted: Boolean, mode: RoomNotificationMode, isOneToOne: Boolean): Result<Unit> {
TODO("Not yet implemented")
}
override suspend fun setRoomNotificationMode(roomId: RoomId, mode: RoomNotificationMode): Result<Unit> {
return setRoomNotificationMode
}
@ -56,7 +60,24 @@ class FakeNotificationSettingsService : NotificationSettingsService {
return muteRoomResult
}
override suspend fun unmuteRoom(roomId: RoomId, isEncrypted: Boolean, membersCount: Long): Result<Unit> {
override suspend fun unmuteRoom(roomId: RoomId, isEncrypted: Boolean, isOneToOne: Boolean): Result<Unit> {
return unmuteRoomResult
}
override suspend fun isRoomMentionEnabled(): Result<Boolean> {
return Result.success(false)
}
override suspend fun setRoomMentionEnabled(enabled: Boolean): Result<Unit> {
return Result.success(Unit)
}
override suspend fun isCallEnabled(): Result<Boolean> {
return Result.success(false)
}
override suspend fun setCallEnabled(enabled: Boolean): Result<Unit> {
return Result.success(Unit)
}
}