mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 18:36:21 +03:00
lifting the live location sharing build flag to the config along with debug toggle
This commit is contained in:
parent
f14aabcd22
commit
012485b8e3
6 changed files with 16 additions and 4 deletions
|
@ -37,6 +37,8 @@ object Config {
|
|||
*/
|
||||
const val ALLOW_EXTERNAL_UNIFIED_PUSH_DISTRIBUTORS = true
|
||||
|
||||
const val ENABLE_LOCATION_SHARING = true
|
||||
|
||||
/**
|
||||
* The maximum length of voice messages in milliseconds.
|
||||
*/
|
||||
|
|
|
@ -160,7 +160,6 @@ android {
|
|||
// This *must* only be set in trusted environments.
|
||||
buildConfigField "Boolean", "handleCallAssertedIdentityEvents", "false"
|
||||
|
||||
buildConfigField "Boolean", "enableLocationSharing", "true"
|
||||
buildConfigField "String", "mapTilerKey", "\"fU3vlMsMn4Jb6dnEIFsx\""
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
|
|
@ -70,6 +70,11 @@ class DebugFeaturesStateFactory @Inject constructor(
|
|||
key = DebugFeatureKeys.allowExternalUnifiedPushDistributors,
|
||||
factory = VectorFeatures::allowExternalUnifiedPushDistributors
|
||||
),
|
||||
createBooleanFeature(
|
||||
label = "Enable Live Location Sharing",
|
||||
key = DebugFeatureKeys.liveLocationSharing,
|
||||
factory = VectorFeatures::isLocationSharingEnabled
|
||||
),
|
||||
createBooleanFeature(
|
||||
label = "Force usage of OpusEncoder library",
|
||||
key = DebugFeatureKeys.forceUsageOfOpusEncoder,
|
||||
|
|
|
@ -67,6 +67,9 @@ class DebugVectorFeatures(
|
|||
override fun isScreenSharingEnabled(): Boolean = read(DebugFeatureKeys.screenSharing)
|
||||
?: vectorFeatures.isScreenSharingEnabled()
|
||||
|
||||
override fun isLocationSharingEnabled(): Boolean = read(DebugFeatureKeys.liveLocationSharing)
|
||||
?: vectorFeatures.isLocationSharingEnabled()
|
||||
|
||||
override fun forceUsageOfOpusEncoder(): Boolean = read(DebugFeatureKeys.forceUsageOfOpusEncoder)
|
||||
?: vectorFeatures.forceUsageOfOpusEncoder()
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ interface VectorFeatures {
|
|||
fun isOnboardingCombinedLoginEnabled(): Boolean
|
||||
fun allowExternalUnifiedPushDistributors(): Boolean
|
||||
fun isScreenSharingEnabled(): Boolean
|
||||
fun isLocationSharingEnabled(): Boolean
|
||||
fun forceUsageOfOpusEncoder(): Boolean
|
||||
fun shouldStartDmOnFirstMessage(): Boolean
|
||||
fun isNewAppLayoutEnabled(): Boolean
|
||||
|
@ -45,6 +46,7 @@ class DefaultVectorFeatures : VectorFeatures {
|
|||
override fun isOnboardingCombinedLoginEnabled() = true
|
||||
override fun allowExternalUnifiedPushDistributors(): Boolean = Config.ALLOW_EXTERNAL_UNIFIED_PUSH_DISTRIBUTORS
|
||||
override fun isScreenSharingEnabled(): Boolean = true
|
||||
override fun isLocationSharingEnabled() = Config.ENABLE_LOCATION_SHARING
|
||||
override fun forceUsageOfOpusEncoder(): Boolean = false
|
||||
override fun shouldStartDmOnFirstMessage(): Boolean = false
|
||||
override fun isNewAppLayoutEnabled(): Boolean = false
|
||||
|
|
|
@ -67,7 +67,6 @@ import com.airbnb.mvrx.fragmentViewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.vanniktech.emoji.EmojiPopup
|
||||
import im.vector.app.BuildConfig
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.animations.play
|
||||
import im.vector.app.core.dialogs.ConfirmationDialogBuilder
|
||||
|
@ -125,6 +124,7 @@ import im.vector.app.core.utils.startInstallFromSourceIntent
|
|||
import im.vector.app.core.utils.toast
|
||||
import im.vector.app.databinding.DialogReportContentBinding
|
||||
import im.vector.app.databinding.FragmentTimelineBinding
|
||||
import im.vector.app.features.VectorFeatures
|
||||
import im.vector.app.features.analytics.extensions.toAnalyticsInteraction
|
||||
import im.vector.app.features.analytics.plan.Interaction
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
|
@ -275,7 +275,8 @@ class TimelineFragment @Inject constructor(
|
|||
private val callManager: WebRtcCallManager,
|
||||
private val audioMessagePlaybackTracker: AudioMessagePlaybackTracker,
|
||||
private val shareIntentHandler: ShareIntentHandler,
|
||||
private val clock: Clock
|
||||
private val clock: Clock,
|
||||
private val vectorFeatures: VectorFeatures,
|
||||
) :
|
||||
VectorBaseFragment<FragmentTimelineBinding>(),
|
||||
TimelineEventController.Callback,
|
||||
|
@ -1559,7 +1560,7 @@ class TimelineFragment @Inject constructor(
|
|||
attachmentTypeSelector = AttachmentTypeSelectorView(vectorBaseActivity, vectorBaseActivity.layoutInflater, this@TimelineFragment)
|
||||
attachmentTypeSelector.setAttachmentVisibility(
|
||||
AttachmentTypeSelectorView.Type.LOCATION,
|
||||
BuildConfig.enableLocationSharing
|
||||
vectorFeatures.isLocationSharingEnabled(),
|
||||
)
|
||||
attachmentTypeSelector.setAttachmentVisibility(
|
||||
AttachmentTypeSelectorView.Type.POLL, !isThreadTimeLine()
|
||||
|
|
Loading…
Reference in a new issue