mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Adding forceEnableLiveLocationSharing field in VectorOverride interface
This commit is contained in:
parent
9d3d574d28
commit
93876737e7
2 changed files with 13 additions and 0 deletions
|
@ -33,6 +33,7 @@ private val keyForceDialPadDisplay = booleanPreferencesKey("force_dial_pad_displ
|
|||
private val keyForceLoginFallback = booleanPreferencesKey("force_login_fallback")
|
||||
private val forceCanChangeDisplayName = booleanPreferencesKey("force_can_change_display_name")
|
||||
private val forceCanChangeAvatar = booleanPreferencesKey("force_can_change_avatar")
|
||||
private val keyForceEnableLiveLocationSharing = booleanPreferencesKey("force_enable_live_location_sharing")
|
||||
|
||||
class DebugVectorOverrides(private val context: Context) : VectorOverrides {
|
||||
|
||||
|
@ -51,6 +52,10 @@ class DebugVectorOverrides(private val context: Context) : VectorOverrides {
|
|||
)
|
||||
}
|
||||
|
||||
override val forceEnableLiveLocationSharing = context.dataStore.data.map { preferences ->
|
||||
preferences[keyForceEnableLiveLocationSharing].orFalse()
|
||||
}
|
||||
|
||||
suspend fun setForceDialPadDisplay(force: Boolean) {
|
||||
context.dataStore.edit { settings ->
|
||||
settings[keyForceDialPadDisplay] = force
|
||||
|
@ -76,4 +81,10 @@ class DebugVectorOverrides(private val context: Context) : VectorOverrides {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun setForceEnableLiveLocationSharing(force: Boolean) {
|
||||
context.dataStore.edit { settings ->
|
||||
settings[keyForceEnableLiveLocationSharing] = force
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ interface VectorOverrides {
|
|||
val forceDialPad: Flow<Boolean>
|
||||
val forceLoginFallback: Flow<Boolean>
|
||||
val forceHomeserverCapabilities: Flow<HomeserverCapabilitiesOverride>?
|
||||
val forceEnableLiveLocationSharing: Flow<Boolean>
|
||||
}
|
||||
|
||||
data class HomeserverCapabilitiesOverride(
|
||||
|
@ -34,4 +35,5 @@ class DefaultVectorOverrides : VectorOverrides {
|
|||
override val forceDialPad = flowOf(false)
|
||||
override val forceLoginFallback = flowOf(false)
|
||||
override val forceHomeserverCapabilities: Flow<HomeserverCapabilitiesOverride>? = null
|
||||
override val forceEnableLiveLocationSharing = flowOf(false)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue