From 86b5601d7d9965bea7d57f04600b02f5432dc966 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 3 Jan 2023 19:49:37 -0600 Subject: [android] Changed way that online status is calculated, and added ignition icon --- .../mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt | 1 + .../java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt | 1 + .../mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt | 9 ++++++++- androidApp/src/main/res/drawable/device_ignition.xml | 5 +++++ androidApp/src/main/res/layout/unit_item.xml | 8 ++++++++ androidApp/src/main/res/layout/unit_map_fragment.xml | 8 ++++++++ androidApp/src/main/res/values-es-rMX/strings.xml | 1 + androidApp/src/main/res/values/strings.xml | 1 + 8 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 androidApp/src/main/res/drawable/device_ignition.xml (limited to 'androidApp') 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 -> { diff --git a/androidApp/src/main/res/drawable/device_ignition.xml b/androidApp/src/main/res/drawable/device_ignition.xml new file mode 100644 index 0000000..d2d8103 --- /dev/null +++ b/androidApp/src/main/res/drawable/device_ignition.xml @@ -0,0 +1,5 @@ + + + diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml index 6946d1d..03bef15 100644 --- a/androidApp/src/main/res/layout/unit_item.xml +++ b/androidApp/src/main/res/layout/unit_item.xml @@ -112,6 +112,14 @@ app:tint="?android:textColorPrimary" tools:ignore="ContentDescription" /> + + + + Estatus encendido Estatus apagado + Ignición apagada Paro de motor encendido Paro de motor apagado Nombre del conductor diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index 93dd45f..57eaf66 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -47,6 +47,7 @@ Status on Status off + Ignition on Engine stop on Engine stop off Driver name -- cgit v1.2.3 From 30d6ba82fc5a57bf50ca4edc6f9ef565c53b8af4 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 3 Jan 2023 20:00:17 -0600 Subject: [android] Fixed string translation --- androidApp/src/main/res/values-es-rMX/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'androidApp') diff --git a/androidApp/src/main/res/values-es-rMX/strings.xml b/androidApp/src/main/res/values-es-rMX/strings.xml index 8737f44..912a5d9 100644 --- a/androidApp/src/main/res/values-es-rMX/strings.xml +++ b/androidApp/src/main/res/values-es-rMX/strings.xml @@ -33,7 +33,7 @@ Estatus encendido Estatus apagado - Ignición apagada + Ignición encendida Paro de motor encendido Paro de motor apagado Nombre del conductor -- cgit v1.2.3 From 8655084132c95e0756645726a38f035a549ae2a4 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 3 Jan 2023 20:27:59 -0600 Subject: [android] Rebranding and bump to 1.3.4 --- androidApp/build.gradle.kts | 4 +-- .../TrackerMap/android/shared/UnitRenderData.kt | 29 +++++++--------------- androidApp/src/main/res/layout/unit_item.xml | 3 ++- .../src/main/res/layout/unit_map_fragment.xml | 3 ++- androidApp/src/main/res/values-es-rMX/strings.xml | 1 + androidApp/src/main/res/values/strings.xml | 1 + 6 files changed, 17 insertions(+), 24 deletions(-) (limited to 'androidApp') diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index f4fb316..200e889 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -11,8 +11,8 @@ android { applicationId = "net.etbsa.etbsa" minSdk = 21 targetSdk = 31 - versionCode = 1403 - versionName = "1.3.3" + versionCode = 1404 + versionName = "1.3.4" ndk { abiFilters.clear() //abiFilters += listOf("armeabi-v7a", "arm64-v8a") 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 340371a..6e96552 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 @@ -90,27 +90,16 @@ class UnitRenderData { } /* Status icon */ - when (unit.getStatus()) { - UnitInformation.Status.ONLINE -> { - statusIcon.setColorFilter( - ContextCompat.getColor(context, R.color.colorOnline) - ) - } - UnitInformation.Status.OFFLINE -> { - statusIcon.setColorFilter( - ContextCompat.getColor(context, R.color.colorOffline) - ) - } - else -> { - statusIcon.setColorFilter(Color.GRAY) - } - } - - /* Ignition icon */ - ignitionIcon.visibility = if (unit.getIgnition()) { - View.VISIBLE + if (unit.getIgnition()) { + statusIcon.setColorFilter( + ContextCompat.getColor(context, R.color.colorOnline) + ) + statusIcon.contentDescription = context.getString(R.string.unit_ignition_on) } else { - View.GONE + statusIcon.setColorFilter( + ContextCompat.getColor(context, R.color.colorOffline) + ) + statusIcon.contentDescription = context.getString(R.string.unit_ignition_off) } /* Engine stop */ diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml index 03bef15..d0f827b 100644 --- a/androidApp/src/main/res/layout/unit_item.xml +++ b/androidApp/src/main/res/layout/unit_item.xml @@ -118,7 +118,8 @@ android:layout_height="wrap_content" android:layout_marginEnd="5dp" android:src="@drawable/device_ignition" - android:contentDescription="@string/unit_ignition_on" /> + android:contentDescription="@string/unit_ignition_on" + android:visibility="gone" /> + tools:ignore="ContentDescription" + android:visibility="gone" /> Estatus encendido Estatus apagado Ignición encendida + Ignición apagada Paro de motor encendido Paro de motor apagado Nombre del conductor diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index a946cf8..3177ad6 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -48,6 +48,7 @@ Status on Status off Ignition on + Ignition off Engine stop on Engine stop off Driver name -- cgit v1.2.3 From 14b00cea68f5213f574e37b463cd142208b3dbaa Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 3 Jan 2023 20:46:41 -0600 Subject: [android] Bump version to 1.3.5 --- androidApp/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'androidApp') diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 200e889..73b9759 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -11,11 +11,11 @@ android { applicationId = "net.etbsa.etbsa" minSdk = 21 targetSdk = 31 - versionCode = 1404 - versionName = "1.3.4" + versionCode = 1405 + versionName = "1.3.5" ndk { abiFilters.clear() - //abiFilters += listOf("armeabi-v7a", "arm64-v8a") + abiFilters += listOf("armeabi-v7a", "arm64-v8a") } } buildTypes { -- cgit v1.2.3