|
@@ -61,22 +61,6 @@ internal class AppUpdateNotifier(private val context: Context) {
|
|
|
notificationBuilder.show()
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Some people are still installing the app from F-Droid, so we avoid prompting GitHub-based
|
|
|
- * updates.
|
|
|
- *
|
|
|
- * We can prompt them to migrate to the GitHub version though.
|
|
|
- */
|
|
|
- fun promptFdroidUpdate() {
|
|
|
- with(notificationBuilder) {
|
|
|
- setContentTitle(context.getString(R.string.update_check_notification_update_available))
|
|
|
- setContentText(context.getString(R.string.update_check_fdroid_migration_info))
|
|
|
- setSmallIcon(R.drawable.ic_tachi)
|
|
|
- setContentIntent(NotificationHandler.openUrl(context, "https://tachiyomi.org/help/faq/#how-do-i-migrate-from-the-f-droid-version"))
|
|
|
- }
|
|
|
- notificationBuilder.show()
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Call when apk download starts.
|
|
|
*
|
|
@@ -118,7 +102,7 @@ internal class AppUpdateNotifier(private val context: Context) {
|
|
|
*
|
|
|
* @param uri path location of apk.
|
|
|
*/
|
|
|
- fun onDownloadFinished(uri: Uri) {
|
|
|
+ fun promptInstall(uri: Uri) {
|
|
|
val installIntent = NotificationHandler.installApkPendingActivity(context, uri)
|
|
|
with(notificationBuilder) {
|
|
|
setContentText(context.getString(R.string.update_check_notification_download_complete))
|
|
@@ -137,10 +121,26 @@ internal class AppUpdateNotifier(private val context: Context) {
|
|
|
addAction(
|
|
|
R.drawable.ic_close_24dp,
|
|
|
context.getString(R.string.action_cancel),
|
|
|
- NotificationReceiver.dismissNotificationPendingBroadcast(context, Notifications.ID_APP_UPDATER),
|
|
|
+ NotificationReceiver.dismissNotificationPendingBroadcast(context, Notifications.ID_APP_UPDATE_PROMPT),
|
|
|
)
|
|
|
}
|
|
|
- notificationBuilder.show()
|
|
|
+ notificationBuilder.show(Notifications.ID_APP_UPDATE_PROMPT)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Some people are still installing the app from F-Droid, so we avoid prompting GitHub-based
|
|
|
+ * updates.
|
|
|
+ *
|
|
|
+ * We can prompt them to migrate to the GitHub version though.
|
|
|
+ */
|
|
|
+ fun promptFdroidUpdate() {
|
|
|
+ with(notificationBuilder) {
|
|
|
+ setContentTitle(context.getString(R.string.update_check_notification_update_available))
|
|
|
+ setContentText(context.getString(R.string.update_check_fdroid_migration_info))
|
|
|
+ setSmallIcon(R.drawable.ic_tachi)
|
|
|
+ setContentIntent(NotificationHandler.openUrl(context, "https://tachiyomi.org/help/faq/#how-do-i-migrate-from-the-f-droid-version"))
|
|
|
+ }
|
|
|
+ notificationBuilder.show(Notifications.ID_APP_UPDATE_PROMPT)
|
|
|
}
|
|
|
|
|
|
/**
|