aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src/main/java/mx')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt1
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt1
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt9
3 files changed, 10 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
index 0fbf597..326fe79 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
@@ -63,6 +63,7 @@ class DevicesAdapter(
unitName = unitName,
unitIcon = unitIcon,
statusIcon = statusIcon,
+ ignitionIcon = ignitionIcon,
engineStopIcon = engineStopIcon,
gridLayout = gridLayout,
detailsButton = detailsButton,
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 5e2224b..2fbb25a 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
@@ -124,6 +124,7 @@ class UnitMapFragment : Fragment() {
UnitRenderData.UnitRenderViewHolder(
unitName = binding.unitName,
statusIcon = binding.statusIcon,
+ ignitionIcon = binding.ignitionIcon,
engineStopIcon = binding.engineStopIcon,
gridLayout = binding.gridLayout,
detailsButton = binding.detailsButton,
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt
index 9a9f85c..340371a 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt
@@ -29,7 +29,6 @@ import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.core.content.ContextCompat
import com.zerobranch.layout.SwipeLayout
-import kotlinx.serialization.json.longOrNull
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.client.models.UnitInformation
import mx.trackermap.TrackerMap.utils.Formatter
@@ -42,6 +41,7 @@ class UnitRenderData {
val unitName: TextView,
val unitIcon: ImageView? = null,
val statusIcon: ImageView,
+ val ignitionIcon: ImageView,
val engineStopIcon: ImageView,
val gridLayout: GridLayout,
val detailsButton: Button? = null,
@@ -106,6 +106,13 @@ class UnitRenderData {
}
}
+ /* Ignition icon */
+ ignitionIcon.visibility = if (unit.getIgnition()) {
+ View.VISIBLE
+ } else {
+ View.GONE
+ }
+
/* Engine stop */
when(unit.getEngineStop()) {
UnitInformation.EngineStop.ON -> {