diff --git a/app/build.gradle b/app/build.gradle index 4287d4c310..92ed0edd8d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,7 +19,7 @@ android { compileSdk compile_sdk_version minSdkVersion min_sdk_version targetSdkVersion compile_sdk_version - versionCode 117 + versionCode 118 versionName "0.40.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt index 807d11c900..51fcefd1bf 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt @@ -247,6 +247,7 @@ private fun MainScreen( R.id.releaseNotesFragment, ReleaseNotesFragment.Input(true) ) + viewModel.whatsNewShown() } } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt index e767b786dd..0927b5271e 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt @@ -171,7 +171,6 @@ class MainViewModel( fun whatsNewShown() { showWhatsNew = false - releaseNotesManager.updateShownAppVersion() emitState() } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesFragment.kt index 923ae67b35..7a59b72b63 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesFragment.kt @@ -24,8 +24,6 @@ import androidx.navigation.NavController import io.horizontalsystems.bankwallet.R import io.horizontalsystems.bankwallet.core.BaseComposeFragment import io.horizontalsystems.bankwallet.core.getInput -import io.horizontalsystems.bankwallet.modules.main.MainModule -import io.horizontalsystems.bankwallet.modules.main.MainViewModel import io.horizontalsystems.bankwallet.modules.markdown.MarkdownContent import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme import io.horizontalsystems.bankwallet.ui.compose.TranslatableString @@ -56,10 +54,9 @@ fun ReleaseNotesScreen( closeablePopup: Boolean, onCloseClick: () -> Unit, viewModel: ReleaseNotesViewModel = viewModel(factory = ReleaseNotesModule.Factory()), - mainViewModel: MainViewModel = viewModel(factory = MainModule.Factory()) ) { BackHandler() { - mainViewModel.whatsNewShown() + viewModel.whatsNewShown() onCloseClick.invoke() } @@ -73,7 +70,7 @@ fun ReleaseNotesScreen( title = TranslatableString.ResString(R.string.Button_Close), icon = R.drawable.ic_close, onClick = { - mainViewModel.whatsNewShown() + viewModel.whatsNewShown() onCloseClick.invoke() } ) diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt index feca8d72bd..e2b7fbd997 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesModule.kt @@ -12,6 +12,7 @@ object ReleaseNotesModule { App.networkManager, App.releaseNotesManager.releaseNotesUrl, App.connectivityManager, + App.releaseNotesManager, App.appConfigProvider ) as T } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesViewModel.kt index 40c66e14a6..01f9dd4a82 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/releasenotes/ReleaseNotesViewModel.kt @@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import io.horizontalsystems.bankwallet.core.INetworkManager import io.horizontalsystems.bankwallet.core.managers.ConnectivityManager +import io.horizontalsystems.bankwallet.core.managers.ReleaseNotesManager import io.horizontalsystems.bankwallet.core.providers.AppConfigProvider import io.horizontalsystems.bankwallet.entities.ViewState import io.horizontalsystems.bankwallet.modules.markdown.MarkdownBlock @@ -21,6 +22,7 @@ class ReleaseNotesViewModel( private val networkManager: INetworkManager, private val contentUrl: String, private val connectivityManager: ConnectivityManager, + private val releaseNotesManager: ReleaseNotesManager, appConfigProvider: AppConfigProvider ) : ViewModel() { @@ -50,6 +52,10 @@ class ReleaseNotesViewModel( loadContent() } + fun whatsNewShown() { + releaseNotesManager.updateShownAppVersion() + } + private fun loadContent() { viewModelScope.launch { try {