From dfe5dd6a425ac2418e33e0b64911b6f914eb514c Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Mon, 17 Jan 2022 23:09:46 -0600 Subject: Pass overlay top margin and whether should show layer toggle as arguments for MapWrapperFragment, and refactored stuff --- .../TrackerMap/android/details/reports/UnitReportsFragment.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/details') diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt index 2fb94f3..51d2f6d 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt @@ -39,9 +39,7 @@ class UnitReportsFragment : Fragment() { private val binding get() = _binding!! private val unitReportsViewModel: UnitReportsViewModel by viewModel() - private val mapFragment: MapWrapperFragment by lazy { - MapWrapperFragment() - } + private lateinit var mapFragment: MapWrapperFragment override fun onCreateView( inflater: LayoutInflater, @@ -84,6 +82,9 @@ class UnitReportsFragment : Fragment() { private fun initializeMap() { Log.d("UnitReportsFragment", "initializeMap()") + mapFragment = MapWrapperFragment.newInstance( + showLayerToggle = true + ) childFragmentManager.commit { replace(R.id.reportsMapContainer, mapFragment) } -- cgit v1.2.3