mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
Merge pull request #6584 from vector-im/task/eric/new_layout_feature_flag
Adds NewAppLayoutEnabled Feature Flag
This commit is contained in:
commit
221cb24de8
4 changed files with 12 additions and 0 deletions
1
changelog.d/6584.misc
Normal file
1
changelog.d/6584.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Adds NewAppLayoutEnabled feature flag
|
|
@ -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
|
||||||
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue