diff --git a/app/src/debug/res/drawable-hdpi/ic_stat_grade.png b/app/src/debug/res/drawable-hdpi/ic_stat_grade.png deleted file mode 100644 index 013b7ac4..00000000 Binary files a/app/src/debug/res/drawable-hdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/debug/res/drawable-hdpi/ic_stat_luckynumber.png b/app/src/debug/res/drawable-hdpi/ic_stat_luckynumber.png deleted file mode 100644 index 74a4d0c5..00000000 Binary files a/app/src/debug/res/drawable-hdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/debug/res/drawable-hdpi/ic_stat_message.png b/app/src/debug/res/drawable-hdpi/ic_stat_message.png deleted file mode 100644 index be41e343..00000000 Binary files a/app/src/debug/res/drawable-hdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/debug/res/drawable-hdpi/ic_stat_note.png b/app/src/debug/res/drawable-hdpi/ic_stat_note.png deleted file mode 100644 index 1992edf2..00000000 Binary files a/app/src/debug/res/drawable-hdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/debug/res/drawable-hdpi/ic_stat_timetable.png b/app/src/debug/res/drawable-hdpi/ic_stat_timetable.png deleted file mode 100644 index 10b27cee..00000000 Binary files a/app/src/debug/res/drawable-hdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/debug/res/drawable-mdpi/ic_stat_grade.png b/app/src/debug/res/drawable-mdpi/ic_stat_grade.png deleted file mode 100644 index a5df2a35..00000000 Binary files a/app/src/debug/res/drawable-mdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/debug/res/drawable-mdpi/ic_stat_luckynumber.png b/app/src/debug/res/drawable-mdpi/ic_stat_luckynumber.png deleted file mode 100644 index 278ed2c6..00000000 Binary files a/app/src/debug/res/drawable-mdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/debug/res/drawable-mdpi/ic_stat_message.png b/app/src/debug/res/drawable-mdpi/ic_stat_message.png deleted file mode 100644 index 7327a02f..00000000 Binary files a/app/src/debug/res/drawable-mdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/debug/res/drawable-mdpi/ic_stat_note.png b/app/src/debug/res/drawable-mdpi/ic_stat_note.png deleted file mode 100644 index 2fb02098..00000000 Binary files a/app/src/debug/res/drawable-mdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/debug/res/drawable-mdpi/ic_stat_timetable.png b/app/src/debug/res/drawable-mdpi/ic_stat_timetable.png deleted file mode 100644 index db5747b0..00000000 Binary files a/app/src/debug/res/drawable-mdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xhdpi/ic_stat_grade.png b/app/src/debug/res/drawable-xhdpi/ic_stat_grade.png deleted file mode 100644 index c63f810f..00000000 Binary files a/app/src/debug/res/drawable-xhdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xhdpi/ic_stat_luckynumber.png b/app/src/debug/res/drawable-xhdpi/ic_stat_luckynumber.png deleted file mode 100644 index 4035ceba..00000000 Binary files a/app/src/debug/res/drawable-xhdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xhdpi/ic_stat_message.png b/app/src/debug/res/drawable-xhdpi/ic_stat_message.png deleted file mode 100644 index c4140be8..00000000 Binary files a/app/src/debug/res/drawable-xhdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xhdpi/ic_stat_note.png b/app/src/debug/res/drawable-xhdpi/ic_stat_note.png deleted file mode 100644 index 6b533c8e..00000000 Binary files a/app/src/debug/res/drawable-xhdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xhdpi/ic_stat_timetable.png b/app/src/debug/res/drawable-xhdpi/ic_stat_timetable.png deleted file mode 100644 index 8d985829..00000000 Binary files a/app/src/debug/res/drawable-xhdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xxhdpi/ic_stat_grade.png b/app/src/debug/res/drawable-xxhdpi/ic_stat_grade.png deleted file mode 100644 index 13c26b77..00000000 Binary files a/app/src/debug/res/drawable-xxhdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xxhdpi/ic_stat_luckynumber.png b/app/src/debug/res/drawable-xxhdpi/ic_stat_luckynumber.png deleted file mode 100644 index da435745..00000000 Binary files a/app/src/debug/res/drawable-xxhdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xxhdpi/ic_stat_message.png b/app/src/debug/res/drawable-xxhdpi/ic_stat_message.png deleted file mode 100644 index 9d0fa781..00000000 Binary files a/app/src/debug/res/drawable-xxhdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xxhdpi/ic_stat_note.png b/app/src/debug/res/drawable-xxhdpi/ic_stat_note.png deleted file mode 100644 index 64da443f..00000000 Binary files a/app/src/debug/res/drawable-xxhdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/debug/res/drawable-xxhdpi/ic_stat_timetable.png b/app/src/debug/res/drawable-xxhdpi/ic_stat_timetable.png deleted file mode 100644 index 232108e8..00000000 Binary files a/app/src/debug/res/drawable-xxhdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/debug/res/drawable-anydpi-v24/ic_stat_grade.xml b/app/src/debug/res/drawable/ic_stat_grade.xml similarity index 100% rename from app/src/debug/res/drawable-anydpi-v24/ic_stat_grade.xml rename to app/src/debug/res/drawable/ic_stat_grade.xml diff --git a/app/src/debug/res/drawable-anydpi-v24/ic_stat_luckynumber.xml b/app/src/debug/res/drawable/ic_stat_luckynumber.xml similarity index 100% rename from app/src/debug/res/drawable-anydpi-v24/ic_stat_luckynumber.xml rename to app/src/debug/res/drawable/ic_stat_luckynumber.xml diff --git a/app/src/debug/res/drawable-anydpi-v24/ic_stat_message.xml b/app/src/debug/res/drawable/ic_stat_message.xml similarity index 100% rename from app/src/debug/res/drawable-anydpi-v24/ic_stat_message.xml rename to app/src/debug/res/drawable/ic_stat_message.xml diff --git a/app/src/debug/res/drawable-anydpi-v24/ic_stat_note.xml b/app/src/debug/res/drawable/ic_stat_note.xml similarity index 100% rename from app/src/debug/res/drawable-anydpi-v24/ic_stat_note.xml rename to app/src/debug/res/drawable/ic_stat_note.xml diff --git a/app/src/debug/res/drawable-anydpi-v24/ic_stat_timetable.xml b/app/src/debug/res/drawable/ic_stat_timetable.xml similarity index 100% rename from app/src/debug/res/drawable-anydpi-v24/ic_stat_timetable.xml rename to app/src/debug/res/drawable/ic_stat_timetable.xml diff --git a/app/src/main/java/io/github/wulkanowy/data/pojos/Notification.kt b/app/src/main/java/io/github/wulkanowy/data/pojos/Notification.kt index ba003f3a..ada901ef 100644 --- a/app/src/main/java/io/github/wulkanowy/data/pojos/Notification.kt +++ b/app/src/main/java/io/github/wulkanowy/data/pojos/Notification.kt @@ -7,6 +7,7 @@ import io.github.wulkanowy.ui.modules.main.MainView sealed interface Notification { val channelId: String + val group: String val startMenu: MainView.Section val icon: Int val titleStringRes: Int @@ -15,6 +16,7 @@ sealed interface Notification { data class MultipleNotifications( override val channelId: String, + override val group: String, override val startMenu: MainView.Section, @DrawableRes override val icon: Int, @PluralsRes override val titleStringRes: Int, @@ -26,6 +28,7 @@ data class MultipleNotifications( data class OneNotification( override val channelId: String, + override val group: String, override val startMenu: MainView.Section, @DrawableRes override val icon: Int, @StringRes override val titleStringRes: Int, diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/LuckyNumberChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/LuckyNumberChannel.kt index 8025bd76..abcd7aa0 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/LuckyNumberChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/LuckyNumberChannel.kt @@ -18,6 +18,7 @@ class LuckyNumberChannel @Inject constructor( companion object { const val CHANNEL_ID = "lucky_number_channel" + const val GROUP_ID = "lucky_number_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewConferencesChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewConferencesChannel.kt index 397e67c6..13c405c3 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewConferencesChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewConferencesChannel.kt @@ -18,6 +18,7 @@ class NewConferencesChannel @Inject constructor( companion object { const val CHANNEL_ID = "new_conferences_channel" + const val GROUP_ID = "new_conferences_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewExamChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewExamChannel.kt index 1bf5f855..851b392a 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewExamChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewExamChannel.kt @@ -18,6 +18,7 @@ class NewExamChannel @Inject constructor( companion object { const val CHANNEL_ID = "new_exam_channel" + const val GROUP_ID = "new_exam_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewGradesChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewGradesChannel.kt index 5d5727d3..6ba1f5b6 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewGradesChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewGradesChannel.kt @@ -18,6 +18,9 @@ class NewGradesChannel @Inject constructor( companion object { const val CHANNEL_ID = "new_grade_channel" + const val GROUP_DETAILS_ID = "new_grade_details_group" + const val GROUP_PREDICTED_ID = "new_grade_predicted_group" + const val GROUP_FINAL_ID = "new_grade_final_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewHomeworkChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewHomeworkChannel.kt index 4b7dd0e9..57e1efa5 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewHomeworkChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewHomeworkChannel.kt @@ -18,6 +18,7 @@ class NewHomeworkChannel @Inject constructor( companion object { const val CHANNEL_ID = "new_homework_channel" + const val GROUP_ID = "new_homework_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewMessagesChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewMessagesChannel.kt index 962fbfa2..35ba4992 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewMessagesChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewMessagesChannel.kt @@ -18,6 +18,7 @@ class NewMessagesChannel @Inject constructor( companion object { const val CHANNEL_ID = "new_message_channel" + const val GROUP_ID = "new_message_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewNotesChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewNotesChannel.kt index c6e79b39..4ed8f7fa 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewNotesChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewNotesChannel.kt @@ -18,6 +18,7 @@ class NewNotesChannel @Inject constructor( companion object { const val CHANNEL_ID = "new_notes_channel" + const val GROUP_ID = "new_notes_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewSchoolAnnouncementsChannel.kt b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewSchoolAnnouncementsChannel.kt index 5c191cb3..60762740 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewSchoolAnnouncementsChannel.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/channels/NewSchoolAnnouncementsChannel.kt @@ -17,7 +17,8 @@ class NewSchoolAnnouncementsChannel @Inject constructor( ) : Channel { companion object { - const val CHANNEL_ID = "new_schoolAnnouncements_channel" + const val CHANNEL_ID = "new_school_announcements_channel" + const val GROUP_ID = "new_school_announcements_group" } override fun create() { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/BaseNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/BaseNotification.kt index 089924f6..15654fa1 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/BaseNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/BaseNotification.kt @@ -2,6 +2,8 @@ package io.github.wulkanowy.services.sync.notifications import android.app.PendingIntent import android.content.Context +import android.os.Build +import androidx.annotation.PluralsRes import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import io.github.wulkanowy.R @@ -18,53 +20,68 @@ abstract class BaseNotification( private val notificationManager: NotificationManagerCompat, ) { - protected fun sendNotification(notification: Notification) { + protected fun sendNotification(notification: Notification) = when (notification) { + is OneNotification -> sendOneNotification(notification) + is MultipleNotifications -> sendMultipleNotifications(notification) + } + + private fun sendOneNotification(notification: OneNotification) { notificationManager.notify( Random.nextInt(Int.MAX_VALUE), - NotificationCompat.Builder(context, notification.channelId) - .setLargeIcon(context.getCompatBitmap(notification.icon, R.color.colorPrimary)) - .setSmallIcon(R.drawable.ic_stat_all) - .setAutoCancel(true) - .setDefaults(NotificationCompat.DEFAULT_ALL) - .setPriority(NotificationCompat.PRIORITY_HIGH) - .setColor(context.getCompatColor(R.color.colorPrimary)) - .setContentIntent( - PendingIntent.getActivity( - context, notification.startMenu.id, - MainActivity.getStartIntent(context, notification.startMenu, true), - PendingIntent.FLAG_UPDATE_CURRENT - ) + getNotificationBuilder(notification).apply { + val content = context.getString( + notification.contentStringRes, + *notification.contentValues.toTypedArray() ) - .apply { - when (notification) { - is OneNotification -> buildForOneNotification(notification) - is MultipleNotifications -> buildForMultipleNotification(notification) - } - } - .build() + setContentTitle(context.getString(notification.titleStringRes)) + setContentText(content) + setStyle(NotificationCompat.BigTextStyle().bigText(content)) + }.build() ) } - private fun NotificationCompat.Builder.buildForOneNotification(n: OneNotification) { - val content = context.getString(n.contentStringRes, *n.contentValues.toTypedArray()) - setContentTitle(context.getString(n.titleStringRes)) - setContentText(content) - setStyle(NotificationCompat.BigTextStyle().run { - bigText(content) - this - }) + private fun sendMultipleNotifications(notification: MultipleNotifications) { + notification.lines.forEach { item -> + notificationManager.notify( + Random.nextInt(Int.MAX_VALUE), + getNotificationBuilder(notification).apply { + setContentTitle(getQuantityString(notification.titleStringRes, 1)) + setContentText(item) + setStyle(NotificationCompat.BigTextStyle().bigText(item)) + setGroup(notification.group) + }.build() + ) + } + + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) return + + notificationManager.notify( + notification.group.hashCode(), + getNotificationBuilder(notification).apply { + setSmallIcon(notification.icon) + setGroup(notification.group) + setGroupSummary(true) + }.build() + ) } - private fun NotificationCompat.Builder.buildForMultipleNotification(n: MultipleNotifications) { - val lines = n.lines.size - setContentTitle(context.resources.getQuantityString(n.titleStringRes, lines, lines)) - setContentText(context.resources.getQuantityString(n.contentStringRes, lines, lines)) - setStyle(NotificationCompat.InboxStyle().run { - setSummaryText( - context.resources.getQuantityString(n.summaryStringRes, n.lines.size, n.lines.size) + private fun getNotificationBuilder(notification: Notification) = NotificationCompat + .Builder(context, notification.channelId) + .setLargeIcon(context.getCompatBitmap(notification.icon, R.color.colorPrimary)) + .setSmallIcon(R.drawable.ic_stat_all) + .setAutoCancel(true) + .setDefaults(NotificationCompat.DEFAULT_ALL) + .setPriority(NotificationCompat.PRIORITY_HIGH) + .setColor(context.getCompatColor(R.color.colorPrimary)) + .setContentIntent( + PendingIntent.getActivity( + context, notification.startMenu.id, + MainActivity.getStartIntent(context, notification.startMenu, true), + PendingIntent.FLAG_UPDATE_CURRENT ) - n.lines.forEach(::addLine) - this - }) + ) + + private fun getQuantityString(@PluralsRes id: Int, value: Int): String { + return context.resources.getQuantityString(id, value, value) } } diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewConferenceNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewConferenceNotification.kt index 8e8431f7..a96de1be 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewConferenceNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewConferenceNotification.kt @@ -18,6 +18,7 @@ class NewConferenceNotification @Inject constructor( fun notify(items: List) { val notification = MultipleNotifications( channelId = NewConferencesChannel.CHANNEL_ID, + group = NewConferencesChannel.GROUP_ID, icon = R.drawable.ic_more_conferences, titleStringRes = R.plurals.conference_notify_new_item_title, contentStringRes = R.plurals.conference_notify_new_items, diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewExamNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewExamNotification.kt index a2d9da56..6a60de93 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewExamNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewExamNotification.kt @@ -18,9 +18,10 @@ class NewExamNotification @Inject constructor( fun notify(items: List) { val notification = MultipleNotifications( channelId = NewExamChannel.CHANNEL_ID, + group = NewExamChannel.GROUP_ID, icon = R.drawable.ic_main_exam, titleStringRes = R.plurals.exam_notify_new_item_title, - contentStringRes = R.plurals.grade_notify_new_items, // TODO add missing string + contentStringRes = R.plurals.exam_notify_new_item_title, // TODO add missing string summaryStringRes = R.plurals.exam_number_item, startMenu = MainView.Section.EXAM, lines = items.map { diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewGradeNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewGradeNotification.kt index 4a2eacad..5ef4f6c3 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewGradeNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewGradeNotification.kt @@ -16,9 +16,10 @@ class NewGradeNotification @Inject constructor( notificationManager: NotificationManagerCompat, ) : BaseNotification(context, notificationManager) { - fun notifyDetails(items: List) { + fun notifyDetails(items: List) { val notification = MultipleNotifications( channelId = NewGradesChannel.CHANNEL_ID, + group = NewGradesChannel.GROUP_DETAILS_ID, icon = R.drawable.ic_stat_grade, titleStringRes = R.plurals.grade_new_items, contentStringRes = R.plurals.grade_notify_new_items, @@ -32,9 +33,10 @@ class NewGradeNotification @Inject constructor( sendNotification(notification) } - fun notifyPredicted(items: List) { + fun notifyPredicted(items: List) { val notification = MultipleNotifications( channelId = NewGradesChannel.CHANNEL_ID, + group = NewGradesChannel.GROUP_PREDICTED_ID, icon = R.drawable.ic_stat_grade, titleStringRes = R.plurals.grade_new_items_predicted, contentStringRes = R.plurals.grade_notify_new_items_predicted, @@ -48,9 +50,10 @@ class NewGradeNotification @Inject constructor( sendNotification(notification) } - fun notifyFinal(items: List) { + fun notifyFinal(items: List) { val notification = MultipleNotifications( channelId = NewGradesChannel.CHANNEL_ID, + group = NewGradesChannel.GROUP_FINAL_ID, icon = R.drawable.ic_stat_grade, titleStringRes = R.plurals.grade_new_items_final, contentStringRes = R.plurals.grade_notify_new_items_final, diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewHomeworkNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewHomeworkNotification.kt index 228ca668..1249b495 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewHomeworkNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewHomeworkNotification.kt @@ -18,6 +18,7 @@ class NewHomeworkNotification @Inject constructor( fun notify(items: List) { val notification = MultipleNotifications( channelId = NewHomeworkChannel.CHANNEL_ID, + group = NewHomeworkChannel.GROUP_ID, icon = R.drawable.ic_more_homework, titleStringRes = R.plurals.homework_notify_new_item_title, contentStringRes = R.plurals.homework_notify_new_item_title, // todo: you received %d new homework diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewLuckyNumberNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewLuckyNumberNotification.kt index 4bbffa9d..68e01414 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewLuckyNumberNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewLuckyNumberNotification.kt @@ -18,6 +18,7 @@ class NewLuckyNumberNotification @Inject constructor( fun notify(item: LuckyNumber) { val notification = OneNotification( channelId = LuckyNumberChannel.CHANNEL_ID, + group = LuckyNumberChannel.GROUP_ID, icon = R.drawable.ic_stat_luckynumber, titleStringRes = R.string.lucky_number_notify_new_item_title, contentStringRes = R.string.lucky_number_notify_new_item, diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewMessageNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewMessageNotification.kt index f52fe857..4e7940d9 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewMessageNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewMessageNotification.kt @@ -18,6 +18,7 @@ class NewMessageNotification @Inject constructor( fun notify(items: List) { val notification = MultipleNotifications( channelId = NewMessagesChannel.CHANNEL_ID, + group = NewMessagesChannel.GROUP_ID, icon = R.drawable.ic_stat_message, titleStringRes = R.plurals.message_new_items, contentStringRes = R.plurals.message_notify_new_items, diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewNoteNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewNoteNotification.kt index e6e22a44..fb4cf918 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewNoteNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewNoteNotification.kt @@ -7,7 +7,7 @@ import io.github.wulkanowy.R import io.github.wulkanowy.data.db.entities.Note import io.github.wulkanowy.data.pojos.MultipleNotifications import io.github.wulkanowy.sdk.scrapper.notes.NoteCategory -import io.github.wulkanowy.services.sync.channels.NewMessagesChannel +import io.github.wulkanowy.services.sync.channels.NewNotesChannel import io.github.wulkanowy.ui.modules.main.MainView import javax.inject.Inject @@ -18,7 +18,8 @@ class NewNoteNotification @Inject constructor( fun notify(items: List) { val notification = MultipleNotifications( - channelId = NewMessagesChannel.CHANNEL_ID, + channelId = NewNotesChannel.CHANNEL_ID, + group = NewNotesChannel.GROUP_ID, icon = R.drawable.ic_stat_note, titleStringRes = when (NoteCategory.getByValue(items.first().categoryType)) { NoteCategory.POSITIVE -> R.plurals.praise_new_items diff --git a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewSchoolAnnouncementNotification.kt b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewSchoolAnnouncementNotification.kt index e4928927..524c188c 100644 --- a/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewSchoolAnnouncementNotification.kt +++ b/app/src/main/java/io/github/wulkanowy/services/sync/notifications/NewSchoolAnnouncementNotification.kt @@ -18,6 +18,7 @@ class NewSchoolAnnouncementNotification @Inject constructor( fun notify(items: List) { val notification = MultipleNotifications( channelId = NewSchoolAnnouncementsChannel.CHANNEL_ID, + group = NewSchoolAnnouncementsChannel.GROUP_ID, icon = R.drawable.ic_all_about, titleStringRes = R.plurals.school_announcement_notify_new_item_title, contentStringRes = R.plurals.school_announcement_notify_new_items, diff --git a/app/src/main/res/drawable-hdpi/ic_stat_grade.png b/app/src/main/res/drawable-hdpi/ic_stat_grade.png deleted file mode 100644 index d97efb5d..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_luckynumber.png b/app/src/main/res/drawable-hdpi/ic_stat_luckynumber.png deleted file mode 100644 index b91c4ae6..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_message.png b/app/src/main/res/drawable-hdpi/ic_stat_message.png deleted file mode 100644 index ce0fdabc..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_note.png b/app/src/main/res/drawable-hdpi/ic_stat_note.png deleted file mode 100644 index 7318c419..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_stat_timetable.png b/app/src/main/res/drawable-hdpi/ic_stat_timetable.png deleted file mode 100644 index 21095e29..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_grade.png b/app/src/main/res/drawable-mdpi/ic_stat_grade.png deleted file mode 100644 index c85b2702..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_luckynumber.png b/app/src/main/res/drawable-mdpi/ic_stat_luckynumber.png deleted file mode 100644 index bfced4eb..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_message.png b/app/src/main/res/drawable-mdpi/ic_stat_message.png deleted file mode 100644 index b357b321..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_note.png b/app/src/main/res/drawable-mdpi/ic_stat_note.png deleted file mode 100644 index 55a4fbbf..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_stat_timetable.png b/app/src/main/res/drawable-mdpi/ic_stat_timetable.png deleted file mode 100644 index 9147c409..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_grade.png b/app/src/main/res/drawable-xhdpi/ic_stat_grade.png deleted file mode 100644 index c55ca7fd..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_luckynumber.png b/app/src/main/res/drawable-xhdpi/ic_stat_luckynumber.png deleted file mode 100644 index 49e502ac..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_message.png b/app/src/main/res/drawable-xhdpi/ic_stat_message.png deleted file mode 100644 index 0e67ade3..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_note.png b/app/src/main/res/drawable-xhdpi/ic_stat_note.png deleted file mode 100644 index ea674a79..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_stat_timetable.png b/app/src/main/res/drawable-xhdpi/ic_stat_timetable.png deleted file mode 100644 index 96942b5a..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_grade.png b/app/src/main/res/drawable-xxhdpi/ic_stat_grade.png deleted file mode 100644 index eeb6fa41..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_stat_grade.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_luckynumber.png b/app/src/main/res/drawable-xxhdpi/ic_stat_luckynumber.png deleted file mode 100644 index 9bab1373..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_stat_luckynumber.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_message.png b/app/src/main/res/drawable-xxhdpi/ic_stat_message.png deleted file mode 100644 index 2e881824..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_stat_message.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_note.png b/app/src/main/res/drawable-xxhdpi/ic_stat_note.png deleted file mode 100644 index 174e1509..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_stat_note.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_stat_timetable.png b/app/src/main/res/drawable-xxhdpi/ic_stat_timetable.png deleted file mode 100644 index 510da8d5..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_stat_timetable.png b/app/src/main/res/drawable-xxxhdpi/ic_stat_timetable.png deleted file mode 100644 index a95cc4f5..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_stat_timetable.png and /dev/null differ diff --git a/app/src/main/res/drawable-anydpi-v24/ic_stat_grade.xml b/app/src/main/res/drawable/ic_stat_grade.xml similarity index 100% rename from app/src/main/res/drawable-anydpi-v24/ic_stat_grade.xml rename to app/src/main/res/drawable/ic_stat_grade.xml diff --git a/app/src/main/res/drawable-anydpi-v24/ic_stat_luckynumber.xml b/app/src/main/res/drawable/ic_stat_luckynumber.xml similarity index 100% rename from app/src/main/res/drawable-anydpi-v24/ic_stat_luckynumber.xml rename to app/src/main/res/drawable/ic_stat_luckynumber.xml diff --git a/app/src/main/res/drawable-anydpi-v24/ic_stat_message.xml b/app/src/main/res/drawable/ic_stat_message.xml similarity index 100% rename from app/src/main/res/drawable-anydpi-v24/ic_stat_message.xml rename to app/src/main/res/drawable/ic_stat_message.xml diff --git a/app/src/main/res/drawable-anydpi-v24/ic_stat_note.xml b/app/src/main/res/drawable/ic_stat_note.xml similarity index 100% rename from app/src/main/res/drawable-anydpi-v24/ic_stat_note.xml rename to app/src/main/res/drawable/ic_stat_note.xml diff --git a/app/src/main/res/drawable-anydpi-v24/ic_stat_timetable.xml b/app/src/main/res/drawable/ic_stat_timetable.xml similarity index 100% rename from app/src/main/res/drawable-anydpi-v24/ic_stat_timetable.xml rename to app/src/main/res/drawable/ic_stat_timetable.xml