Skip to content

Commit

Permalink
Fix new events notification bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jisungbin committed Jul 10, 2021
1 parent 23ac9a8 commit dfc06dd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,31 @@ class EventReloadReceiver : BroadcastReceiver() {
}
}
val diffEventNames = diffEvents.map { it.name }
NotificationUtil.showInboxStyleNotification(
context = context,
id = Random.nextInt(),
channelId = getString(R.string.notification_channel_name),
title = getString(R.string.receiver_notification_title_new_event),
content = getString(
R.string.receiver_notification_new_events_size,
diffEventNames.size
),
boxText = diffEventNames,
icon = R.drawable.ic_round_event_note_24,
isOnGoing = false
)
if (diffEventNames.isEmpty()) {
NotificationUtil.showNormalNotification(
context = context,
id = Random.nextInt(),
channelId = getString(R.string.notification_channel_name),
title = getString(R.string.receiver_notification_title_new_event),
content = getString(R.string.receiver_notification_non_new_events),
icon = R.drawable.ic_round_event_note_24,
isOnGoing = false
)
} else {
NotificationUtil.showInboxStyleNotification(
context = context,
id = Random.nextInt(),
channelId = getString(R.string.notification_channel_name),
title = getString(R.string.receiver_notification_title_new_event),
content = getString(
R.string.receiver_notification_new_events_size,
diffEventNames.size
),
boxText = diffEventNames,
icon = R.drawable.ic_round_event_note_24,
isOnGoing = false
)
}
}
}
is EventRepoResult.Error -> {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@
<string name="receiver_notification_title_new_event">์ƒˆ๋กœ์šด ์ด๋ฒคํŠธ๊ฐ€ ๋„์ฐฉํ–ˆ์–ด์š” \uD83C\uDF89</string>
<string name="receiver_notification_new_events_size">์ด %d๊ฐœ๊ฐ€ ์ƒˆ๋กœ ์ƒ๊ฒผ์–ด์š”</string>
<string name="receiver_notification_error_when_reload_events">์ด๋ฒคํŠธ ๊ฐฑ์‹ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์–ด์š” \uD83D\uDE22</string>
<string name="receiver_notification_non_new_events">์ƒˆ๋กœ์šด ์ด๋ฒคํŠธ๊ฐ€ ์—†์–ด์š”</string>
</resources>
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ object Application {
const val targetSdk = 30
const val compileSdk = 30
const val jvmTarget = "1.8"
const val versionCode = 7
const val versionName = "1.0.2"
const val versionCode = 8
const val versionName = "1.0.3"

val targetCompat = JavaVersion.VERSION_11
val sourceCompat = JavaVersion.VERSION_11
Expand Down

0 comments on commit dfc06dd

Please sign in to comment.