aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-30 18:13:49 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-30 18:13:49 -0600
commit512e01c0ca36b336b3dc6437c6fb326614d020d0 (patch)
tree9c999cde5cfda6048896b544e6486df8901c7a26 /androidApp/src/main/java/mx/trackermap/TrackerMap
parent10e78b9e0311485982711857826ffa79e0d869f4 (diff)
downloadetbsa-trackermap-mobile-512e01c0ca36b336b3dc6437c6fb326614d020d0.tar.gz
etbsa-trackermap-mobile-512e01c0ca36b336b3dc6437c6fb326614d020d0.tar.bz2
etbsa-trackermap-mobile-512e01c0ca36b336b3dc6437c6fb326614d020d0.zip
Accessibility fixes and removed bindings from MapFragment
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt1
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt9
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt9
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)