From 46684702a157070e0bcd879af72bfd4aade72180 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 25 Jul 2022 09:46:41 +0200 Subject: [PATCH] Hiding bottom sheet when no more lives --- .../location/live/map/LocationLiveMapViewFragment.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt b/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt index e19580f13b..bbb838a41a 100644 --- a/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt +++ b/vector/src/main/java/im/vector/app/features/location/live/map/LocationLiveMapViewFragment.kt @@ -22,6 +22,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.graphics.drawable.toBitmap +import androidx.core.view.isGone +import androidx.core.view.isVisible import androidx.lifecycle.lifecycleScope import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState @@ -57,7 +59,6 @@ import javax.inject.Inject /** * Screen showing a map with all the current users sharing their live location in a room. */ - @AndroidEntryPoint class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment() { @@ -173,7 +174,13 @@ class LocationLiveMapViewFragment @Inject constructor() : VectorBaseFragment) { - bottomSheetController.setData(userLocations) + if (userLocations.isEmpty()) { + views.bottomSheet.isGone = true + // TODO show Live location ended view + } else { + views.bottomSheet.isVisible = true + bottomSheetController.setData(userLocations) + } } private fun updateMap(userLiveLocations: List) {