Updates Notifications: Replaced action Details → Download(now by clicking the notification user goes to the release page instead of direct download).

This commit is contained in:
acclorite 2024-06-21 13:41:26 +03:00
parent 6b0ef799c6
commit 7bd24c78c6
3 changed files with 11 additions and 8 deletions

View file

@ -6,6 +6,7 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.graphics.drawable.Icon
import android.net.Uri
import ua.acclorite.book_story.R
import ua.acclorite.book_story.data.remote.dto.LatestReleaseInfo
@ -53,11 +54,13 @@ class UpdatesNotificationServiceImpl @Inject constructor(
releaseInfo.name
)
)
.setContentIntent(downloadLatestVersionPendingIntent)
.setContentIntent(latestReleasePendingIntent)
.addAction(
R.drawable.app_icon_monochrome,
application.getString(R.string.updates_notification_action),
latestReleasePendingIntent
Notification.Action.Builder(
Icon.createWithResource(application, R.drawable.app_icon_monochrome),
application.getString(R.string.updates_notification_action),
downloadLatestVersionPendingIntent
).build()
)
.build()

View file

@ -13,10 +13,10 @@
<string name="updates_notification_title">Нове оновлення Історії Книги!</string>
<string name="updates_notification_desc">
Оновлення %1$s вийшло!
Натиснувши на це сповіщення, ви завантажете останню версію застосунку.
Натисніть, щоб перейти на сторінку релізу.
</string>
<string name="updates_notification_action">
Подробиці
Завантажити
</string>
<!-- Screens -->

View file

@ -32,10 +32,10 @@
<string name="updates_notification_title">New update of Book\'s Story!</string>
<string name="updates_notification_desc">
Update %1$s just released!
By clicking this notification you will download the latest version of the app.
Click to go to the release page.
</string>
<string name="updates_notification_action">
Details
Download
</string>
<!-- Screens -->