mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 04:19:16 +01:00
Change "Download" to "Update" for Android 12 for new app updates
This commit is contained in:
parent
5f0157499e
commit
e97956ee69
@ -4,6 +4,7 @@ import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
@ -58,10 +59,11 @@ internal class UpdaterNotifier(private val context: Context) {
|
||||
setSmallIcon(android.R.drawable.stat_sys_download_done)
|
||||
color = context.getResourceColor(R.attr.colorAccent)
|
||||
clearActions()
|
||||
val isOnA12 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
// Download action
|
||||
addAction(
|
||||
android.R.drawable.stat_sys_download_done,
|
||||
context.getString(R.string.download),
|
||||
context.getString(if (isOnA12) R.string.update else R.string.download),
|
||||
PendingIntent.getService(
|
||||
context,
|
||||
0,
|
||||
|
@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.core.net.toUri
|
||||
import androidx.preference.PreferenceScreen
|
||||
@ -190,10 +191,11 @@ class AboutController : SettingsController() {
|
||||
)
|
||||
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
val isOnA12 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
|
||||
return MaterialDialog(activity!!)
|
||||
.title(R.string.new_version_available)
|
||||
.message(text = args.getString(BODY_KEY) ?: "")
|
||||
.positiveButton(R.string.download) {
|
||||
.positiveButton(if (isOnA12) R.string.update else R.string.download) {
|
||||
val appContext = applicationContext
|
||||
if (appContext != null) {
|
||||
// Start download
|
||||
|
Loading…
x
Reference in New Issue
Block a user