Skip to content

Commit

Permalink
Update animation and popups logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zaiatsartem committed Dec 9, 2024
1 parent 1d4ee76 commit d029f06
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class AccountsOverviewFragment : BaseFragment() {
super.onViewCreated(view, savedInstanceState)

initializeViewModel()
viewModel.initialize()
initializeViews()

val baseActivity = (activity as BaseActivity)
Expand Down Expand Up @@ -173,7 +172,7 @@ class AccountsOverviewFragment : BaseFragment() {
showDisposalBalance(totalBalance.totalAtDisposalForAllAccounts)
}
viewModel.showDialogLiveData.observe(viewLifecycleOwner) { event ->
if (viewModel.hasShowedInitialAnimation()) {
if (mainViewModel.hasCompletedOnboarding()) {
when (event.contentIfNotHandled) {
AccountsOverviewViewModel.DialogToShow.UNSHIELDING -> {
UnshieldingNoticeDialog().showSingle(
Expand All @@ -196,10 +195,6 @@ class AccountsOverviewFragment : BaseFragment() {
viewModel.stateFlow.collectWhenStarted(viewLifecycleOwner) { state ->
when (state) {
OnboardingState.DONE -> {
if (!viewModel.hasShowedInitialAnimation()) {
binding.confettiAnimation.visibility = View.VISIBLE
binding.confettiAnimation.playAnimation()
}
showStateDefault()
}

Expand All @@ -210,6 +205,13 @@ class AccountsOverviewFragment : BaseFragment() {
}
}
viewModel.onrampActive.collectWhenStarted(viewLifecycleOwner) { active ->
if (active) {
if (!viewModel.hasShowedInitialAnimation()) {
binding.confettiAnimation.visibility = View.VISIBLE
binding.confettiAnimation.playAnimation()
}
}

binding.onrampBanner.root.setOnClickListener {
App.appCore.tracker.homeOnRampBannerClicked()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ class AccountsOverviewViewModel(application: Application) : AndroidViewModel(app
updateNotificationSubscription()
}

fun initialize() {
showSingleDialogIfNeeded()
}

override fun onCleared() {
super.onCleared()
accountRepository.allAccountsWithIdentity.removeObserver(accountsObserver)
Expand Down Expand Up @@ -191,6 +187,7 @@ class AccountsOverviewViewModel(application: Application) : AndroidViewModel(app
} else {
App.appCore.session.hasCompletedOnboarding()
postState(OnboardingState.DONE, notifyWaitingLiveData = notifyWaitingLiveData)
showSingleDialogIfNeeded()
updateSubmissionStatesAndBalances()
}
}
Expand All @@ -200,6 +197,7 @@ class AccountsOverviewViewModel(application: Application) : AndroidViewModel(app
if (doneCount > 0) {
App.appCore.session.hasCompletedOnboarding()
postState(OnboardingState.DONE, notifyWaitingLiveData = notifyWaitingLiveData)
showSingleDialogIfNeeded()
updateSubmissionStatesAndBalances()
} else {
postState(OnboardingState.SAVE_PHRASE, zeroAccountBalances, notifyWaitingLiveData)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -999,9 +999,9 @@
<string name="welcome_activate_bottom_sheet_create_wallet_button">Continue</string>
<string name="welcome_activate_bottom_sheet_import_wallet_details">You can import your wallet with a secret seed phrase, wallet private key or a backup file.</string>
<string name="welcome_activate_bottom_sheet_import_wallet_button"><u>Import a wallet</u></string>
<string name="passcode_create_title">Create passcode</string>
<string name="passcode_create_title">Create Passcode</string>
<string name="template_passcode_create_details">%1$d-digit passcode to secure your wallet. Remember it to enter the wallet again</string>
<string name="passcode_repeat_title">Repeat passcode</string>
<string name="passcode_repeat_title">Repeat Passcode</string>
<string name="template_passcode_repeat_details">It should be the same %1$d-digit passcode you entered in the previous step</string>
<string name="passcode_use_full_password">Use full password instead</string>
<string name="passcode_backspace_button">Delete</string>
Expand Down

0 comments on commit d029f06

Please sign in to comment.