mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 07:37:48 +01:00
Bump dependencies
This commit is contained in:
parent
2e5efadf42
commit
cb4699a5bb
10 changed files with 41 additions and 21 deletions
|
@ -11,6 +11,7 @@ import eu.kanade.tachiyomi.data.notification.Notifications
|
|||
import eu.kanade.tachiyomi.util.storage.getUriCompat
|
||||
import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import eu.kanade.tachiyomi.util.system.notify
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.io.File
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
@ -34,7 +35,7 @@ class BackupNotifier(private val context: Context) {
|
|||
}
|
||||
|
||||
private fun NotificationCompat.Builder.show(id: Int) {
|
||||
context.notificationManager.notify(id, build())
|
||||
context.notify(id, build())
|
||||
}
|
||||
|
||||
fun showBackupProgress(): NotificationCompat.Builder {
|
||||
|
|
|
@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.data.notification.Notifications
|
|||
import eu.kanade.tachiyomi.util.lang.chop
|
||||
import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import eu.kanade.tachiyomi.util.system.notify
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.regex.Pattern
|
||||
|
||||
|
@ -50,7 +51,7 @@ internal class DownloadNotifier(private val context: Context) {
|
|||
* @param id the id of the notification.
|
||||
*/
|
||||
private fun NotificationCompat.Builder.show(id: Int) {
|
||||
context.notificationManager.notify(id, build())
|
||||
context.notify(id, build())
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.graphics.BitmapFactory
|
|||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.net.Uri
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import coil.imageLoader
|
||||
import coil.request.ImageRequest
|
||||
import coil.transform.CircleCropTransformation
|
||||
|
@ -82,7 +83,7 @@ class LibraryUpdateNotifier(private val context: Context) {
|
|||
.setStyle(NotificationCompat.BigTextStyle().bigText(updatingText))
|
||||
}
|
||||
|
||||
context.notificationManager.notify(
|
||||
context.notify(
|
||||
Notifications.ID_LIBRARY_PROGRESS,
|
||||
progressNotificationBuilder
|
||||
.setProgress(total, current, false)
|
||||
|
@ -190,9 +191,11 @@ class LibraryUpdateNotifier(private val context: Context) {
|
|||
// Per-manga notification
|
||||
if (!preferences.hideNotificationContent().get()) {
|
||||
launchUI {
|
||||
updates.forEach { (manga, chapters) ->
|
||||
context.notificationManager.notify(manga.id.hashCode(), createNewChaptersNotification(manga, chapters))
|
||||
}
|
||||
context.notify(
|
||||
updates.map { (manga, chapters) ->
|
||||
NotificationManagerCompat.NotificationWithIdAndTag(manga.id.hashCode(), createNewChaptersNotification(manga, chapters))
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,12 +99,12 @@ object Notifications {
|
|||
* @param context The application context.
|
||||
*/
|
||||
fun createChannels(context: Context) {
|
||||
val notificationService = NotificationManagerCompat.from(context)
|
||||
val notificationManager = NotificationManagerCompat.from(context)
|
||||
|
||||
// Delete old notification channels
|
||||
deprecatedChannels.forEach(notificationService::deleteNotificationChannel)
|
||||
deprecatedChannels.forEach(notificationManager::deleteNotificationChannel)
|
||||
|
||||
notificationService.createNotificationChannelGroupsCompat(
|
||||
notificationManager.createNotificationChannelGroupsCompat(
|
||||
listOf(
|
||||
buildNotificationChannelGroup(GROUP_BACKUP_RESTORE) {
|
||||
setName(context.getString(R.string.label_backup))
|
||||
|
@ -121,7 +121,7 @@ object Notifications {
|
|||
),
|
||||
)
|
||||
|
||||
notificationService.createNotificationChannelsCompat(
|
||||
notificationManager.createNotificationChannelsCompat(
|
||||
listOf(
|
||||
buildNotificationChannel(CHANNEL_COMMON, IMPORTANCE_LOW) {
|
||||
setName(context.getString(R.string.channel_common))
|
||||
|
|
|
@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.data.notification.NotificationHandler
|
|||
import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import eu.kanade.tachiyomi.util.system.notify
|
||||
|
||||
internal class AppUpdateNotifier(private val context: Context) {
|
||||
|
||||
|
@ -24,7 +24,7 @@ internal class AppUpdateNotifier(private val context: Context) {
|
|||
* @param id id of the notification channel.
|
||||
*/
|
||||
private fun NotificationCompat.Builder.show(id: Int = Notifications.ID_APP_UPDATER) {
|
||||
context.notificationManager.notify(id, build())
|
||||
context.notify(id, build())
|
||||
}
|
||||
|
||||
@SuppressLint("LaunchActivityFromNotification")
|
||||
|
|
|
@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
|||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import eu.kanade.tachiyomi.util.system.notify
|
||||
|
||||
/**
|
||||
* Class used to show BigPictureStyle notifications
|
||||
|
@ -97,6 +98,6 @@ class SaveImageNotifier(private val context: Context) {
|
|||
|
||||
private fun updateNotification() {
|
||||
// Displays the progress bar on notification
|
||||
context.notificationManager.notify(notificationId, notificationBuilder.build())
|
||||
context.notify(notificationId, notificationBuilder.build())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package eu.kanade.tachiyomi.util.system
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Notification
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import androidx.core.app.NotificationChannelCompat
|
||||
import androidx.core.app.NotificationChannelGroupCompat
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.core.app.NotificationManagerCompat.NotificationWithIdAndTag
|
||||
import androidx.core.content.PermissionChecker
|
||||
import androidx.core.content.getSystemService
|
||||
import eu.kanade.tachiyomi.R
|
||||
|
@ -15,14 +17,26 @@ val Context.notificationManager: NotificationManager
|
|||
get() = getSystemService()!!
|
||||
|
||||
fun Context.notify(id: Int, channelId: String, block: (NotificationCompat.Builder.() -> Unit)? = null) {
|
||||
val notification = notificationBuilder(channelId, block).build()
|
||||
this.notify(id, notification)
|
||||
}
|
||||
|
||||
fun Context.notify(id: Int, notification: Notification) {
|
||||
if (PermissionChecker.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PermissionChecker.PERMISSION_GRANTED) {
|
||||
return
|
||||
}
|
||||
|
||||
val notification = notificationBuilder(channelId, block).build()
|
||||
NotificationManagerCompat.from(this).notify(id, notification)
|
||||
}
|
||||
|
||||
fun Context.notify(notificationWithIdAndTags: List<NotificationWithIdAndTag>) {
|
||||
if (PermissionChecker.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PermissionChecker.PERMISSION_GRANTED) {
|
||||
return
|
||||
}
|
||||
|
||||
NotificationManagerCompat.from(this).notify(notificationWithIdAndTags)
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to create a notification builder.
|
||||
*
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
[versions]
|
||||
agp_version = "7.4.2"
|
||||
lifecycle_version = "2.6.0"
|
||||
lifecycle_version = "2.6.1"
|
||||
|
||||
[libraries]
|
||||
gradle = { module = "com.android.tools.build:gradle", version.ref = "agp_version" }
|
||||
|
||||
annotation = "androidx.annotation:annotation:1.6.0"
|
||||
annotation = "androidx.annotation:annotation:1.7.0-alpha01"
|
||||
appcompat = "androidx.appcompat:appcompat:1.6.1"
|
||||
biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha05"
|
||||
constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
|
||||
coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
|
||||
corektx = "androidx.core:core-ktx:1.10.0-rc01"
|
||||
corektx = "androidx.core:core-ktx:1.11.0-alpha01"
|
||||
splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02"
|
||||
recyclerview = "androidx.recyclerview:recyclerview:1.3.0"
|
||||
viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01"
|
||||
glance = "androidx.glance:glance-appwidget:1.0.0-alpha03"
|
||||
profileinstaller = "androidx.profileinstaller:profileinstaller:1.2.2"
|
||||
profileinstaller = "androidx.profileinstaller:profileinstaller:1.3.0"
|
||||
|
||||
lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "lifecycle_version" }
|
||||
lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle_version" }
|
||||
lifecycle-runtimektx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle_version" }
|
||||
|
||||
work-runtime = "androidx.work:work-runtime-ktx:2.8.0"
|
||||
work-runtime = "androidx.work:work-runtime-ktx:2.8.1"
|
||||
guava = "com.google.guava:guava:31.1-android"
|
||||
|
||||
paging-runtime = "androidx.paging:paging-runtime:3.1.1"
|
||||
|
|
|
@ -4,7 +4,7 @@ compose-bom = "2023.02.00-rc02"
|
|||
accompanist = "0.29.1-alpha"
|
||||
|
||||
[libraries]
|
||||
activity = "androidx.activity:activity-compose:1.6.1"
|
||||
activity = "androidx.activity:activity-compose:1.7.0"
|
||||
bom = { group = "dev.chrisbanes.compose", name = "compose-bom", version.ref = "compose-bom" }
|
||||
foundation = { module = "androidx.compose.foundation:foundation" }
|
||||
animation = { module = "androidx.compose.animation:animation" }
|
||||
|
|
|
@ -3,7 +3,7 @@ aboutlib_version = "10.6.1"
|
|||
okhttp_version = "5.0.0-alpha.11"
|
||||
coil_version = "2.2.2"
|
||||
shizuku_version = "12.2.0"
|
||||
sqlite = "2.3.0"
|
||||
sqlite = "2.3.1"
|
||||
sqldelight = "1.5.5"
|
||||
leakcanary = "2.10"
|
||||
voyager = "1.0.0-rc07"
|
||||
|
|
Loading…
Reference in a new issue