Making the layout file more generic

This commit is contained in:
Maxime NATUREL 2022-05-23 11:41:33 +02:00
parent b331521e93
commit 7bb73ffb57
2 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.R import im.vector.app.R
import im.vector.app.core.extensions.addChildFragment import im.vector.app.core.extensions.addChildFragment
import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentLiveLocationMapBinding import im.vector.app.databinding.FragmentSimpleContainerBinding
import im.vector.app.features.location.UrlMapProvider import im.vector.app.features.location.UrlMapProvider
import javax.inject.Inject import javax.inject.Inject
@ -36,15 +36,15 @@ import javax.inject.Inject
* Screen showing a map with all the current users sharing their live location in room. * Screen showing a map with all the current users sharing their live location in room.
*/ */
@AndroidEntryPoint @AndroidEntryPoint
class LocationLiveMapViewFragment : VectorBaseFragment<FragmentLiveLocationMapBinding>() { class LocationLiveMapViewFragment : VectorBaseFragment<FragmentSimpleContainerBinding>() {
@Inject @Inject
lateinit var urlMapProvider: UrlMapProvider lateinit var urlMapProvider: UrlMapProvider
private val args: LocationLiveMapViewArgs by args() private val args: LocationLiveMapViewArgs by args()
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLiveLocationMapBinding { override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSimpleContainerBinding {
return FragmentLiveLocationMapBinding.inflate(layoutInflater, container, false) return FragmentSimpleContainerBinding.inflate(layoutInflater, container, false)
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -67,7 +67,7 @@ class LocationLiveMapViewFragment : VectorBaseFragment<FragmentLiveLocationMapBi
?: run { ?: run {
val options = MapboxMapOptions.createFromAttributes(requireContext(), null) val options = MapboxMapOptions.createFromAttributes(requireContext(), null)
SupportMapFragment.newInstance(options) SupportMapFragment.newInstance(options)
.also { addChildFragment(R.id.liveLocationMapContainer, it, tag = MAP_FRAGMENT_TAG) } .also { addChildFragment(R.id.fragmentContainer, it, tag = MAP_FRAGMENT_TAG) }
} }
companion object { companion object {

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/liveLocationMapContainer" android:id="@+id/fragmentContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />