diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index f2632301..b4f1ad76 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -13,8 +13,8 @@ android { applicationId = "ac.at.lbg.dhp.more" minSdk = 29 targetSdk = 34 - versionCode = 17 - versionName = "4.0.17" + versionCode = 18 + versionName = "4.0.18" } buildFeatures { compose = true diff --git a/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentActivity.kt b/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentActivity.kt index 51590a12..02b338bd 100644 --- a/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentActivity.kt +++ b/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentActivity.kt @@ -58,7 +58,7 @@ fun ContentView(viewModel: ContentViewModel) { viewModel.openMainActivity(LocalContext.current) } else { MoreBackground(showBackButton = false, alertDialogModel = viewModel.alertDialogOpen.value) { - if (viewModel.loginViewScreenNr.value == 0) { + if (viewModel.loginViewScreenNr.intValue == 0) { LoginView(model = viewModel.loginViewModel) AppVersion() } else { diff --git a/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentViewModel.kt b/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentViewModel.kt index 4dcfa131..954daf8e 100644 --- a/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentViewModel.kt +++ b/androidApp/src/main/java/io/redlink/more/app/android/activities/ContentViewModel.kt @@ -13,6 +13,7 @@ package io.redlink.more.app.android.activities import android.app.Activity import android.content.Context import android.net.Uri +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -54,11 +55,12 @@ class ContentViewModel : ViewModel(), LoginViewModelListener, ConsentViewModelLi val hasCredentials = mutableStateOf(MoreApplication.shared!!.credentialRepository.hasCredentials()) - val loginViewScreenNr = mutableStateOf(0) + val loginViewScreenNr = mutableIntStateOf(0) val alertDialogOpen = mutableStateOf(null) init { + NavigationScreen.createDeepLinksForAllRoutes() viewModelScope.launch(Dispatchers.IO) { AlertController.alertDialogModel.collect { withContext(Dispatchers.Main) { @@ -134,14 +136,14 @@ class ContentViewModel : ViewModel(), LoginViewModelListener, ConsentViewModelLi private fun showLoginView() { viewModelScope.launch(Dispatchers.Main) { - loginViewScreenNr.value = 0 + loginViewScreenNr.intValue = 0 registrationService.reset() } } private fun showConsentView() { viewModelScope.launch(Dispatchers.Main) { - loginViewScreenNr.value = 1 + loginViewScreenNr.intValue = 1 } } diff --git a/androidApp/src/main/java/io/redlink/more/app/android/activities/NavigationScreen.kt b/androidApp/src/main/java/io/redlink/more/app/android/activities/NavigationScreen.kt index 6d289bea..51c49a38 100644 --- a/androidApp/src/main/java/io/redlink/more/app/android/activities/NavigationScreen.kt +++ b/androidApp/src/main/java/io/redlink/more/app/android/activities/NavigationScreen.kt @@ -139,7 +139,6 @@ enum class NavigationScreen( return fullRoute } - fun createListOfNavArguments(): List { if (cachedNavArguments == null) { cachedNavArguments = allParam().map { @@ -176,5 +175,9 @@ enum class NavigationScreen( fun allDeepLinks(deepLinkHost: String) = entries.flatMap { it.createDeepLinkRoute(deepLinkHost).mapNotNull { it.uriPattern } } .toSet() + + fun createDeepLinksForAllRoutes() { + entries.forEach { it.createDeepLinkRoute() } + } } } \ No newline at end of file