From fd0e1e44c4388d16d492bf146f26b60365c31d8b Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 8 Dec 2021 11:54:21 +0000 Subject: [PATCH] renaming login version to variants to better describe the different flows --- vector/build.gradle | 2 +- .../debug/features/DebugFeaturesStateFactory.kt | 4 ++-- .../features/debug/features/DebugVectorFeatures.kt | 4 ++-- .../java/im/vector/app/features/VectorFeatures.kt | 10 +++++----- .../app/features/navigation/DefaultNavigator.kt | 12 ++++++------ 5 files changed, 16 insertions(+), 16 deletions(-) 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) }