aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2022-01-03 15:19:51 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2022-01-03 15:19:51 -0600
commit6168604aa62be4bc547a6d0e1a26ef786d748c77 (patch)
tree6209b1045952fddfd6d3775e5352f0d5061fce49
parent1bcf0941e1174d0b119abd4e3523d53ef90d4f87 (diff)
downloadetbsa-trackermap-mobile-6168604aa62be4bc547a6d0e1a26ef786d748c77.tar.gz
etbsa-trackermap-mobile-6168604aa62be4bc547a6d0e1a26ef786d748c77.tar.bz2
etbsa-trackermap-mobile-6168604aa62be4bc547a6d0e1a26ef786d748c77.zip
Extra UI change to test some functionality
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt8
-rw-r--r--androidApp/src/main/res/layout/unit_map_fragment.xml6
2 files changed, 9 insertions, 5 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt
index 7212a23..4a0fab2 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt
@@ -55,12 +55,14 @@ class UnitMapFragment : Fragment() {
Log.d("UnitMapFragment", "Selected Unit: $selectedUnit")
binding.mapUnitCard.visibility = if (selectedUnit == null) View.GONE else View.VISIBLE
- selectedUnit?.position?.let { position ->
- if (position.latitude == null || position.longitude == null) {
+
+ selectedUnit?.let { unit ->
+ if (unit.position == null || unit.position!!.latitude == null || unit.position!!.longitude == null) {
return@let
}
- unitsMapFragment.focusOn(position.latitude!!, position.longitude!!)
+ binding.unitInfoTest.text = unit.device.contact
+ unitsMapFragment.focusOn(unit.position!!.latitude!!, unit.position!!.longitude!!)
}
}
}
diff --git a/androidApp/src/main/res/layout/unit_map_fragment.xml b/androidApp/src/main/res/layout/unit_map_fragment.xml
index 914558a..f2d54e6 100644
--- a/androidApp/src/main/res/layout/unit_map_fragment.xml
+++ b/androidApp/src/main/res/layout/unit_map_fragment.xml
@@ -3,7 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res-auto">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools">
<fragment
android:id="@+id/unitsMap"
@@ -34,9 +35,10 @@
android:orientation="vertical">
<TextView
+ android:id="@+id/unitInfoTest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="SELECTED UNIT"
+ tools:text="SELECTED UNIT"
android:gravity="center"/>
</LinearLayout>