mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-21 20:55:41 +03:00
Address deprecation, suggestion and spotless
This commit is contained in:
parent
eb3bea8150
commit
3bf70b230f
2 changed files with 5 additions and 3 deletions
|
@ -359,7 +359,7 @@ class DownloadCache(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.awaitAll()
|
.awaitAll()
|
||||||
|
|
||||||
rootDownloadsDir = updatedRootDir
|
rootDownloadsDir = updatedRootDir
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,12 +278,13 @@ class MainActivity : BaseActivity() {
|
||||||
@Composable
|
@Composable
|
||||||
private fun HandleOnNewIntent(context: Context, navigator: Navigator) {
|
private fun HandleOnNewIntent(context: Context, navigator: Navigator) {
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
callbackFlow<Intent> {
|
callbackFlow {
|
||||||
val componentActivity = context as ComponentActivity
|
val componentActivity = context as ComponentActivity
|
||||||
val consumer = Consumer<Intent> { trySend(it) }
|
val consumer = Consumer<Intent> { trySend(it) }
|
||||||
componentActivity.addOnNewIntentListener(consumer)
|
componentActivity.addOnNewIntentListener(consumer)
|
||||||
awaitClose { componentActivity.removeOnNewIntentListener(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
|
* When custom animation is used, status and navigation bar color will be set to transparent and will be restored
|
||||||
* after the animation is finished.
|
* after the animation is finished.
|
||||||
*/
|
*/
|
||||||
|
@Suppress("Deprecation")
|
||||||
private fun setSplashScreenExitAnimation(splashScreen: SplashScreen?) {
|
private fun setSplashScreenExitAnimation(splashScreen: SplashScreen?) {
|
||||||
val root = findViewById<View>(android.R.id.content)
|
val root = findViewById<View>(android.R.id.content)
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && splashScreen != null) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && splashScreen != null) {
|
||||||
|
|
Loading…
Reference in a new issue