add empty state for gallery

This commit is contained in:
Johan von Forstner
2020-04-13 14:25:20 +02:00
parent cc5dd148fc
commit c0c766c450
6 changed files with 1267 additions and 7 deletions

View File

@@ -155,6 +155,7 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac
vm.chargerSparse.observe(viewLifecycleOwner, Observer {
if (it != null) {
bottomSheetBehavior.state = BottomSheetBehaviorGoogleMapsLike.STATE_COLLAPSED
binding.fabDirections.show()
} else {
bottomSheetBehavior.state = BottomSheetBehaviorGoogleMapsLike.STATE_HIDDEN
}
@@ -184,6 +185,7 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac
binding.gallery.apply {
adapter = GalleryAdapter(context, galleryClickListener)
itemAnimator = null
layoutManager =
LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
addItemDecoration(
@@ -196,12 +198,14 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac
binding.detailView.connectors.apply {
adapter = ConnectorAdapter()
itemAnimator = null
layoutManager =
LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
}
binding.detailView.details.apply {
adapter = DetailAdapter()
itemAnimator = null
layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
addItemDecoration(

View File

@@ -48,7 +48,7 @@ class ChargerIconGenerator(val context: Context) {
return value.byteCount
}
}
val oversize = 1.5f
val oversize = 1f // increase to add padding for overshoot scale animation
val icon = R.drawable.ic_map_marker_charging
init {