mirror of
https://github.com/element-hq/element-android
synced 2024-11-25 02:45:37 +03:00
Reorders some functions within FtueAuthVariant
This commit is contained in:
parent
92c6d59984
commit
3d57d72a7e
1 changed files with 17 additions and 15 deletions
|
@ -112,10 +112,6 @@ class FtueAuthVariant(
|
|||
}
|
||||
}
|
||||
|
||||
override fun setIsLoading(isLoading: Boolean) {
|
||||
doNothing()
|
||||
}
|
||||
|
||||
private fun addFirstFragment() {
|
||||
val splashFragment = when (vectorFeatures.isOnboardingSplashCarouselEnabled()) {
|
||||
true -> FtueAuthSplashCarouselFragment::class.java
|
||||
|
@ -124,6 +120,23 @@ class FtueAuthVariant(
|
|||
activity.addFragment(views.loginFragmentContainer, splashFragment)
|
||||
}
|
||||
|
||||
private fun updateWithState(viewState: OnboardingViewState) {
|
||||
isForceLoginFallbackEnabled = viewState.isForceLoginFallbackEnabled
|
||||
views.loginLoading.isVisible = shouldShowLoading(viewState)
|
||||
}
|
||||
|
||||
private fun shouldShowLoading(viewState: OnboardingViewState) =
|
||||
if (vectorFeatures.isOnboardingPersonalizeEnabled()) {
|
||||
viewState.isLoading()
|
||||
} else {
|
||||
// Keep loading when during success because of the delay when switching to the next Activity
|
||||
viewState.isLoading() || viewState.isAuthTaskCompleted()
|
||||
}
|
||||
|
||||
override fun setIsLoading(isLoading: Boolean) {
|
||||
doNothing()
|
||||
}
|
||||
|
||||
private fun handleOnboardingViewEvents(viewEvents: OnboardingViewEvents) {
|
||||
when (viewEvents) {
|
||||
is OnboardingViewEvents.RegistrationFlowResult -> {
|
||||
|
@ -245,17 +258,6 @@ class FtueAuthVariant(
|
|||
.show()
|
||||
}
|
||||
|
||||
private fun updateWithState(viewState: OnboardingViewState) {
|
||||
isForceLoginFallbackEnabled = viewState.isForceLoginFallbackEnabled
|
||||
|
||||
views.loginLoading.isVisible = if (vectorFeatures.isOnboardingPersonalizeEnabled()) {
|
||||
viewState.isLoading()
|
||||
} else {
|
||||
// Keep loading when during success because of the delay when switching to the next Activity
|
||||
viewState.isLoading() || viewState.isAuthTaskCompleted()
|
||||
}
|
||||
}
|
||||
|
||||
private fun onWebLoginError(onWebLoginError: OnboardingViewEvents.OnWebLoginError) {
|
||||
// Pop the backstack
|
||||
supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
|
|
Loading…
Reference in a new issue