mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
adding feature flag and redirecting the sign in flow
- temporarily to the combined register fragment
This commit is contained in:
parent
fdaaed430e
commit
34e97112a4
@ -60,6 +60,11 @@ class DebugFeaturesStateFactory @Inject constructor(
|
||||
key = DebugFeatureKeys.onboardingCombinedRegister,
|
||||
factory = VectorFeatures::isOnboardingCombinedRegisterEnabled
|
||||
),
|
||||
createBooleanFeature(
|
||||
label = "FTUE Combined login",
|
||||
key = DebugFeatureKeys.onboardingCombinedLogin,
|
||||
factory = VectorFeatures::isOnboardingCombinedLoginEnabled
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -57,6 +57,9 @@ class DebugVectorFeatures(
|
||||
override fun isOnboardingCombinedRegisterEnabled(): Boolean = read(DebugFeatureKeys.onboardingCombinedRegister)
|
||||
?: vectorFeatures.isOnboardingCombinedRegisterEnabled()
|
||||
|
||||
override fun isOnboardingCombinedLoginEnabled(): Boolean = read(DebugFeatureKeys.onboardingCombinedLogin)
|
||||
?: vectorFeatures.isOnboardingCombinedLoginEnabled()
|
||||
|
||||
override fun isScreenSharingEnabled(): Boolean = read(DebugFeatureKeys.screenSharing)
|
||||
?: vectorFeatures.isScreenSharingEnabled()
|
||||
|
||||
@ -113,6 +116,7 @@ object DebugFeatureKeys {
|
||||
val onboardingUseCase = booleanPreferencesKey("onboarding-splash-carousel")
|
||||
val onboardingPersonalize = booleanPreferencesKey("onboarding-personalize")
|
||||
val onboardingCombinedRegister = booleanPreferencesKey("onboarding-combined-register")
|
||||
val onboardingCombinedLogin = booleanPreferencesKey("onboarding-combined-login")
|
||||
val liveLocationSharing = booleanPreferencesKey("live-location-sharing")
|
||||
val screenSharing = booleanPreferencesKey("screen-sharing")
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ interface VectorFeatures {
|
||||
fun isOnboardingUseCaseEnabled(): Boolean
|
||||
fun isOnboardingPersonalizeEnabled(): Boolean
|
||||
fun isOnboardingCombinedRegisterEnabled(): Boolean
|
||||
fun isOnboardingCombinedLoginEnabled(): Boolean
|
||||
fun isScreenSharingEnabled(): Boolean
|
||||
|
||||
enum class OnboardingVariant {
|
||||
@ -42,5 +43,6 @@ class DefaultVectorFeatures : VectorFeatures {
|
||||
override fun isOnboardingUseCaseEnabled() = true
|
||||
override fun isOnboardingPersonalizeEnabled() = false
|
||||
override fun isOnboardingCombinedRegisterEnabled() = false
|
||||
override fun isOnboardingCombinedLoginEnabled() = false
|
||||
override fun isScreenSharingEnabled(): Boolean = true
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ sealed class OnboardingViewEvents : VectorViewEvents {
|
||||
object OpenUseCaseSelection : OnboardingViewEvents()
|
||||
object OpenServerSelection : OnboardingViewEvents()
|
||||
object OpenCombinedRegister : OnboardingViewEvents()
|
||||
object OpenCombinedLogin : OnboardingViewEvents()
|
||||
object EditServerSelection : OnboardingViewEvents()
|
||||
data class OnServerSelectionDone(val serverType: ServerType) : OnboardingViewEvents()
|
||||
object OnLoginFlowRetrieved : OnboardingViewEvents()
|
||||
|
@ -194,7 +194,9 @@ class OnboardingViewModel @AssistedInject constructor(
|
||||
} else {
|
||||
OnboardingViewEvents.OpenServerSelection
|
||||
}
|
||||
OnboardingFlow.SignIn,
|
||||
OnboardingFlow.SignIn -> if (vectorFeatures.isOnboardingCombinedRegisterEnabled()) {
|
||||
OnboardingViewEvents.OpenCombinedLogin
|
||||
} else OnboardingViewEvents.OpenServerSelection
|
||||
OnboardingFlow.SignInSignUp -> OnboardingViewEvents.OpenServerSelection
|
||||
}
|
||||
_viewEvents.post(nextOnboardingStep)
|
||||
|
@ -227,10 +227,15 @@ class FtueAuthVariant(
|
||||
option = commonOption
|
||||
)
|
||||
}
|
||||
OnboardingViewEvents.OnHomeserverEdited -> activity.popBackstack()
|
||||
OnboardingViewEvents.OnHomeserverEdited -> activity.popBackstack()
|
||||
OnboardingViewEvents.OpenCombinedLogin -> onStartCombinedLogin()
|
||||
}
|
||||
}
|
||||
|
||||
private fun onStartCombinedLogin() {
|
||||
addRegistrationStageFragmentToBackstack(FtueAuthCombinedRegisterFragment::class.java)
|
||||
}
|
||||
|
||||
private fun onRegistrationFlow(viewEvents: OnboardingViewEvents.RegistrationFlowResult) {
|
||||
when {
|
||||
registrationShouldFallback(viewEvents) -> displayFallbackWebDialog()
|
||||
|
Loading…
Reference in New Issue
Block a user