diff options
author | Iván Ávalos <avalos@disroot.org> | 2021-12-30 18:13:49 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2021-12-30 18:13:49 -0600 |
commit | 964820d1e4416fd1d36e100f39ecc15bab480e90 (patch) | |
tree | 8f8a73707155aba915842fb5ae1d17785cea4824 /androidApp/src/main/java/mx/trackermap/TrackerMap/android | |
parent | a0e16d47a97c27cb84d6e4d5e626b99c0e08081a (diff) | |
download | etbsa-trackermap-mobile-964820d1e4416fd1d36e100f39ecc15bab480e90.tar.gz etbsa-trackermap-mobile-964820d1e4416fd1d36e100f39ecc15bab480e90.tar.bz2 etbsa-trackermap-mobile-964820d1e4416fd1d36e100f39ecc15bab480e90.zip |
Accessibility fixes and removed bindings from MapFragment
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android')
3 files changed, 10 insertions, 9 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt index 933316a..eb8dcbc 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt @@ -28,6 +28,7 @@ class DevicesFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { + super.onCreateView(inflater, container, savedInstanceState) _binding = DevicesFragmentBinding.inflate(inflater, container, false) return binding.root } diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt index f0ec769..289cc2d 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt @@ -19,8 +19,6 @@ import java.io.File @DelicateCoroutinesApi class MapFragment: GlobeMapFragment() { - private var _binding: MapFragmentBinding? = null - private val binding get() = _binding!! private val unitsViewModel: UnitsViewModel by viewModel() @@ -64,11 +62,6 @@ class MapFragment: GlobeMapFragment() { mapControl.animatePositionGeo(longitude, latitude, zoom, 1.0) } - override fun onDestroyView() { - super.onDestroyView() - _binding = null - } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) @@ -133,7 +126,7 @@ class MapFragment: GlobeMapFragment() { val latitude = position.latitude!! * Math.PI / 180 val longitude = position.longitude!! * Math.PI / 180 val zoom = 0.000008 - mapControl.animatePositionGeo(longitude, latitude, zoom, 1.0) + mapControl.setPositionGeo(longitude, latitude, zoom) } } } diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt index 452ece7..ff8929e 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt @@ -66,12 +66,19 @@ class UnitsActivity : AppCompatActivity() { else -> R.drawable.ic_baseline_map_24 } ) + binding.displayModeToggle.contentDescription = getString( + when (displayMode) { + UnitsViewModel.UnitsDisplayMode.LIST -> R.string.toggle_map + UnitsViewModel.UnitsDisplayMode.MAP -> R.string.toggle_list + else -> R.string.toggle_map + } + ) val newFragment = when (displayMode) { UnitsViewModel.UnitsDisplayMode.LIST -> devicesFragment UnitsViewModel.UnitsDisplayMode.MAP -> mapFragment - else -> DevicesFragment() + else -> devicesFragment } supportFragmentManager.commit { replace(R.id.displayContainer, newFragment) |