From 9801ff7eab4803f558fba26f6465de4413e91fc9 Mon Sep 17 00:00:00 2001 From: "i.kulikov" Date: Mon, 3 Jul 2023 15:17:08 +0300 Subject: [PATCH] new pop up urls and text --- .../home/selection/HomeSelectionActivity.kt | 19 ++++++++++++++----- .../home/selection/HomeSelectionViewModel.kt | 6 +++--- android/app/src/main/res/values/strings.xml | 5 +++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionActivity.kt b/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionActivity.kt index 4ca1ca37..1ed70c04 100644 --- a/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionActivity.kt +++ b/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionActivity.kt @@ -102,9 +102,9 @@ class HomeSelectionActivity : BaseActivity() { viewModel.connectionState.observe(this) { handleConnectionState(it) } - viewModel.showNewAppUrl.observe(this) { + viewModel.showNewAppUrl.observe(this) { link -> val i = Intent(Intent.ACTION_VIEW) - i.data = Uri.parse(getString(R.string.new_pop_up_url)) + i.data = Uri.parse(link) startActivity(i) } viewModel.isNewAppPopUpShow.observe(this) { isShow -> @@ -123,7 +123,7 @@ class HomeSelectionActivity : BaseActivity() { private fun bindsAction() { binding.newAppNotification.setOnClickListener { - viewModel.openNewAppLink(NewAppPopupSource.NOTIFICATION) + viewModel.openNewAppLink(NewAppPopupSource.NOTIFICATION, getString(R.string.new_pop_up_url_download_url)) } binding.newAppNotificationClose.setOnClickListener { viewModel.closeNewAppPopups(NewAppPopupSource.NOTIFICATION) @@ -315,14 +315,23 @@ class HomeSelectionActivity : BaseActivity() { private fun showNewAppPopup() { bindingNewAppPopUp = PopUpDownloadNewApplicationBinding.inflate(layoutInflater) dialogPasswordPopup = createPopUp(bindingNewAppPopUp.root, true) + dialogPasswordPopup?.setOnDismissListener { + viewModel.closeNewAppPopups(NewAppPopupSource.POP_UP) + } with(bindingNewAppPopUp) { acceptButton.setOnClickListener { dialogPasswordPopup?.dismiss() - viewModel.openNewAppLink(NewAppPopupSource.POP_UP) + viewModel.openNewAppLink( + NewAppPopupSource.POP_UP, + getString(R.string.new_pop_up_url_download_url) + ) } declineButton.setOnClickListener { dialogPasswordPopup?.dismiss() - viewModel.closeNewAppPopups(NewAppPopupSource.POP_UP) + viewModel.openNewAppLink( + NewAppPopupSource.POP_UP, + getString(R.string.new_pop_up_learn_more) + ) } } dialogPasswordPopup?.show() diff --git a/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionViewModel.kt b/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionViewModel.kt index 2c599c0b..5e9af64e 100644 --- a/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionViewModel.kt +++ b/android/app/src/main/java/updated/mysterium/vpn/ui/home/selection/HomeSelectionViewModel.kt @@ -29,7 +29,7 @@ class HomeSelectionViewModel(useCaseProvider: UseCaseProvider) : ViewModel() { get() = _isNewAppNotificationShow private val _isNewAppNotificationShow = MutableLiveData() - val showNewAppUrl = SingleLiveEvent() + val showNewAppUrl = SingleLiveEvent() private val _connectionState = MutableLiveData() private val connectionUseCase = useCaseProvider.connection() @@ -83,8 +83,8 @@ class HomeSelectionViewModel(useCaseProvider: UseCaseProvider) : ViewModel() { settingsUseCase.getResidentCountry() } - fun openNewAppLink(popUp: NewAppPopupSource) { - showNewAppUrl.value = Unit + fun openNewAppLink(popUp: NewAppPopupSource, link: String) { + showNewAppUrl.value = link closeNewAppPopups(popUp) } diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 9d86d160..0ed87bab 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -323,10 +323,11 @@ Mysterium VPN 2.0 for\nAndroid is live! Download the new app to use\nMysterium VPN on Android, iOS,\nMac and Windows. Download - Go to Home + Learn More Mysterium VPN 2.0 for Android is live! Download the new app to use Mysterium\nVPN on Android, iOS,Mac and Windows. - https://mysteriumvpn.com/v2 + https://mysteriumvpn.com/v2 + https://play.google.com/store/apps/details?id=com.mysteriumvpn.android&hl=en&gl=US