mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 21:48:50 +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() {
|
private fun addFirstFragment() {
|
||||||
val splashFragment = when (vectorFeatures.isOnboardingSplashCarouselEnabled()) {
|
val splashFragment = when (vectorFeatures.isOnboardingSplashCarouselEnabled()) {
|
||||||
true -> FtueAuthSplashCarouselFragment::class.java
|
true -> FtueAuthSplashCarouselFragment::class.java
|
||||||
|
@ -124,6 +120,23 @@ class FtueAuthVariant(
|
||||||
activity.addFragment(views.loginFragmentContainer, splashFragment)
|
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) {
|
private fun handleOnboardingViewEvents(viewEvents: OnboardingViewEvents) {
|
||||||
when (viewEvents) {
|
when (viewEvents) {
|
||||||
is OnboardingViewEvents.RegistrationFlowResult -> {
|
is OnboardingViewEvents.RegistrationFlowResult -> {
|
||||||
|
@ -245,17 +258,6 @@ class FtueAuthVariant(
|
||||||
.show()
|
.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) {
|
private fun onWebLoginError(onWebLoginError: OnboardingViewEvents.OnWebLoginError) {
|
||||||
// Pop the backstack
|
// Pop the backstack
|
||||||
supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
supportFragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||||
|
|
Loading…
Reference in a new issue