Merge pull request #6584 from vector-im/task/eric/new_layout_feature_flag

Adds NewAppLayoutEnabled Feature Flag
This commit is contained in:
Eric Decanini 2022-07-19 12:24:16 +01:00 committed by GitHub
commit 221cb24de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

1
changelog.d/6584.misc Normal file
View File

@ -0,0 +1 @@
Adds NewAppLayoutEnabled feature flag

View File

@ -80,6 +80,11 @@ class DebugFeaturesStateFactory @Inject constructor(
key = DebugFeatureKeys.startDmOnFirstMsg, key = DebugFeatureKeys.startDmOnFirstMsg,
factory = VectorFeatures::shouldStartDmOnFirstMessage factory = VectorFeatures::shouldStartDmOnFirstMessage
), ),
createBooleanFeature(
label = "Enable New App Layout",
key = DebugFeatureKeys.newAppLayoutEnabled,
factory = VectorFeatures::isNewAppLayoutEnabled
),
) )
) )
} }

View File

@ -72,6 +72,9 @@ class DebugVectorFeatures(
override fun shouldStartDmOnFirstMessage(): Boolean = read(DebugFeatureKeys.startDmOnFirstMsg) override fun shouldStartDmOnFirstMessage(): Boolean = read(DebugFeatureKeys.startDmOnFirstMsg)
?: vectorFeatures.shouldStartDmOnFirstMessage() ?: vectorFeatures.shouldStartDmOnFirstMessage()
override fun isNewAppLayoutEnabled(): Boolean = read(DebugFeatureKeys.newAppLayoutEnabled)
?: vectorFeatures.isNewAppLayoutEnabled()
fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences { fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences {
if (value == null) { if (value == null) {
it.remove(key) it.remove(key)
@ -131,4 +134,5 @@ object DebugFeatureKeys {
val screenSharing = booleanPreferencesKey("screen-sharing") val screenSharing = booleanPreferencesKey("screen-sharing")
val forceUsageOfOpusEncoder = booleanPreferencesKey("force-usage-of-opus-encoder") val forceUsageOfOpusEncoder = booleanPreferencesKey("force-usage-of-opus-encoder")
val startDmOnFirstMsg = booleanPreferencesKey("start-dm-on-first-msg") val startDmOnFirstMsg = booleanPreferencesKey("start-dm-on-first-msg")
val newAppLayoutEnabled = booleanPreferencesKey("new-app-layout-enabled")
} }

View File

@ -32,6 +32,7 @@ interface VectorFeatures {
fun isScreenSharingEnabled(): Boolean fun isScreenSharingEnabled(): Boolean
fun forceUsageOfOpusEncoder(): Boolean fun forceUsageOfOpusEncoder(): Boolean
fun shouldStartDmOnFirstMessage(): Boolean fun shouldStartDmOnFirstMessage(): Boolean
fun isNewAppLayoutEnabled(): Boolean
enum class OnboardingVariant { enum class OnboardingVariant {
LEGACY, LEGACY,
@ -52,4 +53,5 @@ class DefaultVectorFeatures : VectorFeatures {
override fun isScreenSharingEnabled(): Boolean = true override fun isScreenSharingEnabled(): Boolean = true
override fun forceUsageOfOpusEncoder(): Boolean = false override fun forceUsageOfOpusEncoder(): Boolean = false
override fun shouldStartDmOnFirstMessage(): Boolean = false override fun shouldStartDmOnFirstMessage(): Boolean = false
override fun isNewAppLayoutEnabled(): Boolean = false
} }