Set options method

This commit is contained in:
Maxime Naturel 2022-03-01 17:43:34 +01:00
parent 1c6b31001f
commit 55c6383074
2 changed files with 11 additions and 10 deletions

View file

@ -59,6 +59,8 @@ class LocationSharingFragment @Inject constructor(
views.mapView.initialize(urlMapProvider.getMapUrl()) views.mapView.initialize(urlMapProvider.getMapUrl())
} }
// TODO change the options dynamically depending on the current chosen location
views.shareLocationContainer.setOptions(LocationSharingOption.PINNED)
views.shareLocationContainer.debouncedClicks { views.shareLocationContainer.debouncedClicks {
viewModel.handle(LocationSharingAction.OnShareLocation) viewModel.handle(LocationSharingAction.OnShareLocation)
} }

View file

@ -20,7 +20,9 @@ import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
import im.vector.app.databinding.ViewLocationSharingOptionPickerBinding import im.vector.app.databinding.ViewLocationSharingOptionPickerBinding
import im.vector.app.features.location.LocationSharingOption
/** /**
* Custom view to display the location sharing option picker. * Custom view to display the location sharing option picker.
@ -29,15 +31,12 @@ class LocationSharingOptionPickerView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) { ) : ConstraintLayout(context, attrs, defStyleAttr) {
/*private val binding = */ private val binding = ViewLocationSharingOptionPickerBinding.inflate(
init { LayoutInflater.from(context),
ViewLocationSharingOptionPickerBinding.inflate( this
LayoutInflater.from(context), )
this
)
}
/*fun setOptions(vararg options: LocationSharingOption) { fun setOptions(vararg options: LocationSharingOption) {
// TODO show only the options passed in argument binding.locationSharingOptionPinned.isVisible = options.contains(LocationSharingOption.PINNED)
}*/ }
} }