mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Adding build config field
This commit is contained in:
parent
ae6040e01e
commit
9c6cd9f630
3 changed files with 16 additions and 10 deletions
|
@ -229,6 +229,7 @@ android {
|
|||
buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false"
|
||||
// Set to true if you want to enable strict mode in debug
|
||||
buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false"
|
||||
buildConfigField "Boolean", "ENABLE_LIVE_LOCATION_SHARING", "true"
|
||||
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
|
@ -238,6 +239,7 @@ android {
|
|||
|
||||
buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false"
|
||||
buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false"
|
||||
buildConfigField "Boolean", "ENABLE_LIVE_LOCATION_SHARING", "false"
|
||||
|
||||
postprocessing {
|
||||
removeUnusedCode true
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.airbnb.mvrx.fragmentViewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.mapbox.mapboxsdk.maps.MapView
|
||||
import im.vector.app.BuildConfig
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.extensions.exhaustive
|
||||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
|
@ -170,16 +171,19 @@ class LocationSharingFragment @Inject constructor(
|
|||
|
||||
private fun updateMap(state: LocationSharingViewState) {
|
||||
// first, update the options view
|
||||
when (state.areTargetAndUserLocationEqual) {
|
||||
// TODO activate USER_LIVE option when implemented
|
||||
true -> views.shareLocationOptionsPicker.render(
|
||||
LocationSharingOption.USER_CURRENT
|
||||
)
|
||||
false -> views.shareLocationOptionsPicker.render(
|
||||
LocationSharingOption.PINNED
|
||||
)
|
||||
else -> views.shareLocationOptionsPicker.render()
|
||||
val options: Set<LocationSharingOption> = when (state.areTargetAndUserLocationEqual) {
|
||||
true -> {
|
||||
if (BuildConfig.ENABLE_LIVE_LOCATION_SHARING) {
|
||||
setOf(LocationSharingOption.USER_CURRENT, LocationSharingOption.USER_LIVE)
|
||||
} else {
|
||||
setOf(LocationSharingOption.USER_CURRENT)
|
||||
}
|
||||
}
|
||||
false -> setOf(LocationSharingOption.PINNED)
|
||||
else -> emptySet()
|
||||
}
|
||||
views.shareLocationOptionsPicker.render(options)
|
||||
|
||||
// then, update the map using the height of the options view after it has been rendered
|
||||
views.shareLocationOptionsPicker.post {
|
||||
val mapState = state
|
||||
|
|
|
@ -58,7 +58,7 @@ class LocationSharingOptionPickerView @JvmOverloads constructor(
|
|||
applyBackground()
|
||||
}
|
||||
|
||||
fun render(vararg options: LocationSharingOption) {
|
||||
fun render(options: Set<LocationSharingOption> = emptySet()) {
|
||||
val optionsNumber = options.toSet().size
|
||||
val isPinnedVisible = options.contains(LocationSharingOption.PINNED)
|
||||
val isUserCurrentVisible = options.contains(LocationSharingOption.USER_CURRENT)
|
||||
|
|
Loading…
Reference in a new issue