aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2021-12-16 02:38:42 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2021-12-16 02:38:42 -0600
commit6ed24f2be979187d90ab3250d02d8b71fc570535 (patch)
tree782a8e1f583f13ebfa05c9c9cd89f4e93b0ab2b2 /androidApp/src/main/java/mx/trackermap/TrackerMap
parent84c797ac104c0fff96ba6793cefaa5ba0b4887fc (diff)
downloadetbsa-trackermap-mobile-6ed24f2be979187d90ab3250d02d8b71fc570535.tar.gz
etbsa-trackermap-mobile-6ed24f2be979187d90ab3250d02d8b71fc570535.tar.bz2
etbsa-trackermap-mobile-6ed24f2be979187d90ab3250d02d8b71fc570535.zip
Adds a very basic UI to display details
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt9
1 files changed, 9 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt
index 7a0ed16..1af8ec3 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt
@@ -41,6 +41,15 @@ class UnitInformationFragment : Fragment() {
private fun setupObservers() {
unitInformationViewModel.unit.observe(this) { unitInformation ->
Log.d("UnitInformationFragment", "Unit Information Fetched - $unitInformation")
+ unitInformation?.let {
+ binding.deviceName.text = it.device.name
+ binding.driverDetail.text = it.device.contact
+ binding.speedDetail.text = "${it.position?.speed?.times(1.852) ?: "--"} Km/h"
+ binding.addressDetail.text = it.position?.address ?: "Unknown location"
+ binding.latitudeDetail.text = it.position?.latitude.toString()
+ binding.longitudeDetail.text = it.position?.longitude.toString()
+ binding.protocolDetail.text = it.position?.protocol ?: "--"
+ }
}
}