From ee95c1439f8c47d912c88bd9ebb442e64a89f8ff Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 13 Jun 2023 20:20:08 -0400 Subject: [PATCH] Blur manga info header image Similar to J2K. This only applies on Android 12+. --- .../eu/kanade/presentation/manga/components/MangaInfoHeader.kt | 2 ++ .../java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt | 2 +- .../main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt | 1 - app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt | 1 - .../eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt | 1 - .../tachiyomi/ui/browse/migration/search/MigrateDialog.kt | 1 - 6 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt index 538cb727ec..887019e327 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt @@ -56,6 +56,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.alpha +import androidx.compose.ui.draw.blur import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.graphics.Brush @@ -120,6 +121,7 @@ fun MangaInfoBox( brush = Brush.verticalGradient(colors = backdropGradientColors), ) } + .blur(4.dp) .alpha(.2f), ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt index ae75363816..0b64f296cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt @@ -72,7 +72,7 @@ class GlobalExceptionHandler private constructor( return try { Json.decodeFromString(ThrowableSerializer, intent.getStringExtra(INTENT_EXTRA)!!) } catch (e: Exception) { - logcat(LogPriority.ERROR, e) { "Wasn't able to retrive throwable from intent" } + logcat(LogPriority.ERROR, e) { "Wasn't able to retrieve throwable from intent" } null } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt index ae4c07c577..34583f9d17 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt @@ -73,7 +73,6 @@ class BackupRestorer( return File("") } - @Suppress("BlockingMethodInNonBlockingContext") private suspend fun performRestore(uri: Uri): Boolean { val backup = BackupUtil.decodeBackup(context, uri) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt index c0536e431a..2610db5655 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt @@ -60,7 +60,6 @@ class ImageSaver( try { data().use { input -> - @Suppress("BlockingMethodInNonBlockingContext") context.contentResolver.openOutputStream(picture, "w").use { output -> input.copyTo(output!!) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt index cf03f3f371..6cc4efd330 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt @@ -43,7 +43,6 @@ class ShizukuInstaller(private val service: Service) : Installer(service) { override var ready = false - @Suppress("BlockingMethodInNonBlockingContext") override fun processEntry(entry: Entry) { super.processEntry(entry) scope.launch { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt index dc50459083..c3358a88b7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt @@ -289,7 +289,6 @@ internal class MigrateDialogScreenModel( // Update custom cover (recheck if custom cover exists) if (migrateCustomCover && oldManga.hasCustomCover()) { - @Suppress("BlockingMethodInNonBlockingContext") coverCache.setCustomCoverToCache(newManga, coverCache.getCustomCoverFile(oldManga.id).inputStream()) }