From b55fb400f1365d70dc0459544ec2f36f4ec9cae0 Mon Sep 17 00:00:00 2001 From: SkyD666 Date: Mon, 12 Aug 2024 23:29:57 +0800 Subject: [PATCH] [fix] Fix manifest file issue; fix download screen deeplink issue --- app/build.gradle.kts | 2 +- app/src/main/AndroidManifest.xml | 6 +++++ .../worker/download/DownloadTorrentWorker.kt | 23 +++++++++---------- .../com/skyd/anivu/ui/screen/MainScreen.kt | 16 ++++++++----- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 86b6cef4..ed587fab 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,7 +22,7 @@ android { minSdk = 24 targetSdk = 35 versionCode = 21 - versionName = "2.1-alpha10" + versionName = "2.1-alpha11" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index adbb0253..8a854492 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -62,6 +62,12 @@ + + + + + + = Build.VERSION_CODES.O) { diff --git a/app/src/main/java/com/skyd/anivu/ui/screen/MainScreen.kt b/app/src/main/java/com/skyd/anivu/ui/screen/MainScreen.kt index fb33cb3b..c1771c29 100644 --- a/app/src/main/java/com/skyd/anivu/ui/screen/MainScreen.kt +++ b/app/src/main/java/com/skyd/anivu/ui/screen/MainScreen.kt @@ -43,7 +43,6 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -63,6 +62,10 @@ import com.skyd.anivu.R import com.skyd.anivu.ext.activity import com.skyd.anivu.ext.isCompact import com.skyd.anivu.model.preference.appearance.NavigationBarLabelPreference +import com.skyd.anivu.ui.local.LocalMediaLibLocation +import com.skyd.anivu.ui.local.LocalNavController +import com.skyd.anivu.ui.local.LocalNavigationBarLabel +import com.skyd.anivu.ui.local.LocalWindowSizeClass import com.skyd.anivu.ui.screen.download.openDownloadScreen import com.skyd.anivu.ui.screen.feed.FEED_SCREEN_ROUTE import com.skyd.anivu.ui.screen.feed.FeedScreen @@ -70,10 +73,6 @@ import com.skyd.anivu.ui.screen.media.MEDIA_SCREEN_ROUTE import com.skyd.anivu.ui.screen.media.MediaScreen import com.skyd.anivu.ui.screen.more.MORE_SCREEN_ROUTE import com.skyd.anivu.ui.screen.more.MoreScreen -import com.skyd.anivu.ui.local.LocalMediaLibLocation -import com.skyd.anivu.ui.local.LocalNavController -import com.skyd.anivu.ui.local.LocalNavigationBarLabel -import com.skyd.anivu.ui.local.LocalWindowSizeClass const val MAIN_SCREEN_ROUTE = "mainScreen" @@ -91,6 +90,10 @@ private fun handleIntent(intent: Intent?, navController: NavController) { url = data.toString() } } + + "anivu" -> { + navController.navigate(data) + } } if (url != null) { openDownloadScreen( @@ -101,6 +104,8 @@ private fun handleIntent(intent: Intent?, navController: NavController) { } } +private var needHandleIntent by mutableStateOf(true) + @Composable fun MainScreen() { val windowSizeClass = LocalWindowSizeClass.current @@ -112,7 +117,6 @@ fun MainScreen() { NavigationBarOrRail(navController = mainNavController) } - var needHandleIntent by rememberSaveable { mutableStateOf(true) } if (needHandleIntent) { LaunchedEffect(Unit) { needHandleIntent = false