aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-30 19:13:13 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-30 19:13:13 -0600
commitc11d9d0aaa0428e93df978642a54ba466ccf4e93 (patch)
treec31c1af4d1e1fb724f1309f5f9b765e805e81832 /androidApp/src
parent512e01c0ca36b336b3dc6437c6fb326614d020d0 (diff)
downloadetbsa-trackermap-mobile-c11d9d0aaa0428e93df978642a54ba466ccf4e93.tar.gz
etbsa-trackermap-mobile-c11d9d0aaa0428e93df978642a54ba466ccf4e93.tar.bz2
etbsa-trackermap-mobile-c11d9d0aaa0428e93df978642a54ba466ccf4e93.zip
Implemented datetime formatting
Diffstat (limited to 'androidApp/src')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt10
1 files changed, 4 insertions, 6 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 ffe6ca7..33dd5b9 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
@@ -1,17 +1,13 @@
package mx.trackermap.TrackerMap.android.devices
import android.graphics.Color
-import android.graphics.ColorFilter
-import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import android.view.ViewStructure
-import androidx.core.content.res.ResourcesCompat
import androidx.recyclerview.widget.RecyclerView
-import kotlinx.serialization.json.JsonNull
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.android.databinding.UnitItemBinding
+import mx.trackermap.TrackerMap.utils.Formatter
import mx.trackermap.TrackerMap.client.models.UnitInformation
enum class Action {
@@ -73,7 +69,9 @@ class DevicesAdapter(
driverName.text = unit.device.contact
unitSpeed.text = context.getString(R.string.unit_speed_format, unit.position?.speed?.toInt() ?: 0)
lastAddress.text = unit.position?.address
- lastDate.text = "yyyy/mm/dd, hh:mm"
+ unit.position?.fixTime?.let {
+ lastDate.text = Formatter.formatDate(it)
+ }
actionCallback?.let { callback ->
unitCard.setOnClickListener { callback(unit, Action.CLICK) }
detailsButton.setOnClickListener { callback(unit, Action.DETAILS) }