Skip to content

Commit

Permalink
Merge pull request #757 from mysteriumnetwork/feature/Auto-navigate-a…
Browse files Browse the repository at this point in the history
…fter-back-up

Navigation improvements
  • Loading branch information
ArtemHryhorovGeniusee authored Jan 31, 2023
2 parents 7048f05 + fd6584a commit 60f8324
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,22 @@ abstract class BaseActivity : AppCompatActivity() {
connectionStateToolbar?.protectedState(true)
}

protected fun getTransitionAnimation(isBackTransition: Boolean?): Bundle? {
return if (isBackTransition == true) {
ActivityOptions.makeCustomAnimation(
applicationContext,
R.anim.slide_in_left,
R.anim.slide_out_right
).toBundle()
} else {
ActivityOptions.makeCustomAnimation(
applicationContext,
R.anim.slide_in_right,
R.anim.slide_out_left
).toBundle()
}
}

private fun unprotectedConnection() {
connectionStateToolbar?.unprotectedState()
}
Expand Down Expand Up @@ -360,22 +376,6 @@ abstract class BaseActivity : AppCompatActivity() {
}
}

private fun getTransitionAnimation(isBackTransition: Boolean?): Bundle? {
return if (isBackTransition == true) {
ActivityOptions.makeCustomAnimation(
applicationContext,
R.anim.slide_in_left,
R.anim.slide_out_right
).toBundle()
} else {
ActivityOptions.makeCustomAnimation(
applicationContext,
R.anim.slide_in_right,
R.anim.slide_out_left
).toBundle()
}
}

private fun getCountryCode(): String? {
return homeSelectionViewModel.getPreviousCountryCode()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class PrivateKeyActivity : BaseActivity(), ActivityCompat.OnRequestPermissionsRe
setNextToAccountFrameAvailability(result.isSuccess)
result.onSuccess {
viewModel.accountCreated()
navigateToPrepareTopUp()
}
result.onFailure {
Log.i(TAG, "onFailure ${it.localizedMessage}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class TermsOfUseActivity : BaseActivity() {
} else {
Intent(this, CreateAccountActivity::class.java)
}
startActivity(intent)
startActivity(intent, getTransitionAnimation(false))
finish()
}
}
Expand Down

0 comments on commit 60f8324

Please sign in to comment.