From 3bf70b230fc2c3eda58c4d46dec3fb75668e4f69 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 19 Oct 2024 20:19:06 +0600 Subject: [PATCH] Address deprecation, suggestion and spotless --- .../java/eu/kanade/tachiyomi/data/download/DownloadCache.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt index c204b1db2..532b7d243 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt @@ -359,7 +359,7 @@ class DownloadCache( } } } - .awaitAll() + .awaitAll() rootDownloadsDir = updatedRootDir } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 0d668dc79..aefe0fe77 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -278,12 +278,13 @@ class MainActivity : BaseActivity() { @Composable private fun HandleOnNewIntent(context: Context, navigator: Navigator) { LaunchedEffect(Unit) { - callbackFlow { + callbackFlow { val componentActivity = context as ComponentActivity val consumer = Consumer { trySend(it) } componentActivity.addOnNewIntentListener(consumer) awaitClose { componentActivity.removeOnNewIntentListener(consumer) } - }.collectLatest { handleIntentAction(it, navigator) } + } + .collectLatest { handleIntentAction(it, navigator) } } } @@ -339,6 +340,7 @@ class MainActivity : BaseActivity() { * When custom animation is used, status and navigation bar color will be set to transparent and will be restored * after the animation is finished. */ + @Suppress("Deprecation") private fun setSplashScreenExitAnimation(splashScreen: SplashScreen?) { val root = findViewById(android.R.id.content) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && splashScreen != null) {