From 9641ff132d520d54306a333cf31c1b26f08fe7a1 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Mon, 20 Jun 2022 13:58:28 +0300 Subject: [PATCH 1/8] Show live location sharing option even if labs flag is disabled. --- .../app/features/location/LocationSharingFragment.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt index 1b25f3fcec..e25520ed81 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt @@ -41,7 +41,6 @@ import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.room.detail.timeline.helper.MatrixItemColorProvider import im.vector.app.features.location.live.duration.ChooseLiveDurationBottomSheet import im.vector.app.features.location.option.LocationSharingOption -import im.vector.app.features.settings.VectorPreferences import org.matrix.android.sdk.api.util.MatrixItem import java.lang.ref.WeakReference import javax.inject.Inject @@ -53,7 +52,6 @@ class LocationSharingFragment @Inject constructor( private val urlMapProvider: UrlMapProvider, private val avatarRenderer: AvatarRenderer, private val matrixItemColorProvider: MatrixItemColorProvider, - private val vectorPreferences: VectorPreferences, ) : VectorBaseFragment(), LocationTargetChangeListener, VectorBaseBottomSheetDialogFragment.ResultListener { @@ -223,13 +221,7 @@ class LocationSharingFragment @Inject constructor( private fun updateMap(state: LocationSharingViewState) { // first, update the options view val options: Set = when (state.areTargetAndUserLocationEqual) { - true -> { - if (vectorPreferences.labsEnableLiveLocation()) { - setOf(LocationSharingOption.USER_CURRENT, LocationSharingOption.USER_LIVE) - } else { - setOf(LocationSharingOption.USER_CURRENT) - } - } + true -> setOf(LocationSharingOption.USER_CURRENT, LocationSharingOption.USER_LIVE) false -> setOf(LocationSharingOption.PINNED) else -> emptySet() } From b37dce7da7aa4df47d46fa27f343e429d3acdacf Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Mon, 20 Jun 2022 15:19:22 +0300 Subject: [PATCH 2/8] Create layout for promoting live location labs flag. --- ...heet_live_location_labs_flag_promotion.xml | 56 +++++++++++++++++++ vector/src/main/res/values/strings.xml | 6 ++ 2 files changed, 62 insertions(+) create mode 100644 vector/src/main/res/layout/bottom_sheet_live_location_labs_flag_promotion.xml diff --git a/vector/src/main/res/layout/bottom_sheet_live_location_labs_flag_promotion.xml b/vector/src/main/res/layout/bottom_sheet_live_location_labs_flag_promotion.xml new file mode 100644 index 0000000000..438e60a4d3 --- /dev/null +++ b/vector/src/main/res/layout/bottom_sheet_live_location_labs_flag_promotion.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + +