Skip to content

Commit 221cb24

Browse files
authored
Merge pull request element-hq#6584 from vector-im/task/eric/new_layout_feature_flag
Adds NewAppLayoutEnabled Feature Flag
2 parents 246307a + 2f40865 commit 221cb24

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

changelog.d/6584.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adds NewAppLayoutEnabled feature flag

vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ class DebugFeaturesStateFactory @Inject constructor(
8080
key = DebugFeatureKeys.startDmOnFirstMsg,
8181
factory = VectorFeatures::shouldStartDmOnFirstMessage
8282
),
83+
createBooleanFeature(
84+
label = "Enable New App Layout",
85+
key = DebugFeatureKeys.newAppLayoutEnabled,
86+
factory = VectorFeatures::isNewAppLayoutEnabled
87+
),
8388
)
8489
)
8590
}

vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ class DebugVectorFeatures(
7272
override fun shouldStartDmOnFirstMessage(): Boolean = read(DebugFeatureKeys.startDmOnFirstMsg)
7373
?: vectorFeatures.shouldStartDmOnFirstMessage()
7474

75+
override fun isNewAppLayoutEnabled(): Boolean = read(DebugFeatureKeys.newAppLayoutEnabled)
76+
?: vectorFeatures.isNewAppLayoutEnabled()
77+
7578
fun <T> override(value: T?, key: Preferences.Key<T>) = updatePreferences {
7679
if (value == null) {
7780
it.remove(key)
@@ -131,4 +134,5 @@ object DebugFeatureKeys {
131134
val screenSharing = booleanPreferencesKey("screen-sharing")
132135
val forceUsageOfOpusEncoder = booleanPreferencesKey("force-usage-of-opus-encoder")
133136
val startDmOnFirstMsg = booleanPreferencesKey("start-dm-on-first-msg")
137+
val newAppLayoutEnabled = booleanPreferencesKey("new-app-layout-enabled")
134138
}

vector/src/main/java/im/vector/app/features/VectorFeatures.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface VectorFeatures {
3232
fun isScreenSharingEnabled(): Boolean
3333
fun forceUsageOfOpusEncoder(): Boolean
3434
fun shouldStartDmOnFirstMessage(): Boolean
35+
fun isNewAppLayoutEnabled(): Boolean
3536

3637
enum class OnboardingVariant {
3738
LEGACY,
@@ -52,4 +53,5 @@ class DefaultVectorFeatures : VectorFeatures {
5253
override fun isScreenSharingEnabled(): Boolean = true
5354
override fun forceUsageOfOpusEncoder(): Boolean = false
5455
override fun shouldStartDmOnFirstMessage(): Boolean = false
56+
override fun isNewAppLayoutEnabled(): Boolean = false
5557
}

0 commit comments

Comments
 (0)