diff --git a/vector/build.gradle b/vector/build.gradle index 9f6c91c2b5..a3c9314e8d 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -140,7 +140,7 @@ android { buildConfigField "String", "BUILD_NUMBER", "\"${buildNumber}\"" resValue "string", "build_number", "\"${buildNumber}\"" - buildConfigField "im.vector.app.features.VectorFeatures.LoginVersion", "LOGIN_VERSION", "im.vector.app.features.VectorFeatures.LoginVersion.V1" + buildConfigField "im.vector.app.features.VectorFeatures.LoginVariant", "LOGIN_VARIANT", "im.vector.app.features.VectorFeatures.LoginVariant.LEGACY" buildConfigField "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy", "outboundSessionKeySharingStrategy", "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy.WhenTyping" diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt b/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt index 8d22fc599f..ca5d26aaeb 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt @@ -28,8 +28,8 @@ class DebugFeaturesStateFactory @Inject constructor( return FeaturesState(listOf( createEnumFeature( label = "Login version", - selection = debugFeatures.loginVersion(), - default = defaultFeatures.loginVersion() + selection = debugFeatures.loginVariant(), + default = defaultFeatures.loginVariant() ) )) } diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt b/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt index 0831609e4f..638509e76b 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt @@ -38,8 +38,8 @@ class DebugVectorFeatures( private val dataStore = context.dataStore - override fun loginVersion(): VectorFeatures.LoginVersion { - return readPreferences().getEnum() ?: vectorFeatures.loginVersion() + override fun loginVariant(): VectorFeatures.LoginVariant { + return readPreferences().getEnum() ?: vectorFeatures.loginVariant() } fun > hasEnumOverride(type: KClass) = readPreferences().containsEnum(type) diff --git a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt index e106f7f75f..9453abe1db 100644 --- a/vector/src/main/java/im/vector/app/features/VectorFeatures.kt +++ b/vector/src/main/java/im/vector/app/features/VectorFeatures.kt @@ -20,11 +20,11 @@ import im.vector.app.BuildConfig interface VectorFeatures { - fun loginVersion(): LoginVersion + fun loginVariant(): LoginVariant - enum class LoginVersion { - V1, - V2 + enum class LoginVariant { + LEGACY, + FTUE_WIP } enum class NotificationSettingsVersion { @@ -34,5 +34,5 @@ interface VectorFeatures { } class DefaultVectorFeatures : VectorFeatures { - override fun loginVersion(): VectorFeatures.LoginVersion = BuildConfig.LOGIN_VERSION + override fun loginVariant(): VectorFeatures.LoginVariant = BuildConfig.LOGIN_VARIANT } diff --git a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt index befc62d2ce..b18604a13f 100644 --- a/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/navigation/DefaultNavigator.kt @@ -110,18 +110,18 @@ class DefaultNavigator @Inject constructor( ) : Navigator { override fun openLogin(context: Context, loginConfig: LoginConfig?, flags: Int) { - val intent = when (features.loginVersion()) { - VectorFeatures.LoginVersion.V1 -> LoginActivity.newIntent(context, loginConfig) - VectorFeatures.LoginVersion.V2 -> LoginActivity2.newIntent(context, loginConfig) + val intent = when (features.loginVariant()) { + VectorFeatures.LoginVariant.LEGACY -> LoginActivity.newIntent(context, loginConfig) + VectorFeatures.LoginVariant.FTUE_WIP -> LoginActivity2.newIntent(context, loginConfig) } intent.addFlags(flags) context.startActivity(intent) } override fun loginSSORedirect(context: Context, data: Uri?) { - val intent = when (features.loginVersion()) { - VectorFeatures.LoginVersion.V1 -> LoginActivity.redirectIntent(context, data) - VectorFeatures.LoginVersion.V2 -> LoginActivity2.redirectIntent(context, data) + val intent = when (features.loginVariant()) { + VectorFeatures.LoginVariant.LEGACY -> LoginActivity.redirectIntent(context, data) + VectorFeatures.LoginVariant.FTUE_WIP -> LoginActivity2.redirectIntent(context, data) } context.startActivity(intent) }