aboutsummaryrefslogtreecommitdiff
path: root/androidApp
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-12 17:36:31 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-12 17:36:31 -0600
commitb9a9eeeb9f104b6fe11a5bc523cad189b293160c (patch)
tree49e1c136d5d1c3460dbb6c91e025c5ea359ddc72 /androidApp
parent9b5850870bef2770f281d51b5c96ac9103ab3667 (diff)
downloadetbsa-trackermap-mobile-b9a9eeeb9f104b6fe11a5bc523cad189b293160c.tar.gz
etbsa-trackermap-mobile-b9a9eeeb9f104b6fe11a5bc523cad189b293160c.tar.bz2
etbsa-trackermap-mobile-b9a9eeeb9f104b6fe11a5bc523cad189b293160c.zip
Improved reports design
Diffstat (limited to 'androidApp')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt22
-rw-r--r--androidApp/src/main/res/values/colors.xml3
2 files changed, 18 insertions, 7 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt
index 9bda9d4..1b736d1 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt
@@ -7,6 +7,7 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
import androidx.core.graphics.drawable.toBitmap
import com.mousebird.maply.*
@@ -126,24 +127,29 @@ class MapFragment : GlobeMapFragment() {
}.toTypedArray()
val vectorInfo = VectorInfo()
- vectorInfo.setColor(Color.GREEN)
+ vectorInfo.setColor(ContextCompat.getColor(context!!, R.color.colorReport))
vectorInfo.setLineWidth(20.0f)
/* Draw markers for positions */
val screenMarkers = markers.mapIndexed { i, marker ->
val screenMarker = ScreenMarker()
- val markerSize = Point2d(144.0, 144.0)
-
screenMarker.loc = Point2d.FromDegrees(marker.longitude, marker.latitude)
screenMarker.image = if (isReport) {
- // For reports, position, start and end markers must be shown differently
+ // For reports, position, start and end, icons must be different
when (i) {
0 -> getIcon(MarkerType.REPORT_START)
markers.size - 1 -> getIcon(MarkerType.REPORT_END)
else -> getIcon(MarkerType.REPORT_POSITION)
}
} else getIcon(marker.type)
- screenMarker.size = markerSize
+ screenMarker.size = if (isReport) {
+ // For reports, position, start and end, size must be different
+ when (i) {
+ 0 -> Point2d(144.0, 144.0)
+ markers.size - 1 -> Point2d(144.0, 144.0)
+ else -> Point2d(82.0, 82.0)
+ }
+ } else Point2d(144.0, 144.0)
screenMarker.userObject = marker.id
screenMarker.selectable = true
if (!isReport) {
@@ -196,12 +202,14 @@ class MapFragment : GlobeMapFragment() {
clear(true)
+ val color = ContextCompat.getColor(context!!, R.color.colorGeofence)
+
val vectorInfo = VectorInfo()
- vectorInfo.setColor(Color.BLUE)
+ vectorInfo.setColor(color)
vectorInfo.setLineWidth(10.0f)
val labelInfo = LabelInfo()
- labelInfo.textColor = Color.BLUE
+ labelInfo.textColor = color
val shapes = mutableListOf<Shape>()
val vectors = mutableListOf<VectorObject>()
diff --git a/androidApp/src/main/res/values/colors.xml b/androidApp/src/main/res/values/colors.xml
index 0ebcff7..ee5d167 100644
--- a/androidApp/src/main/res/values/colors.xml
+++ b/androidApp/src/main/res/values/colors.xml
@@ -6,6 +6,9 @@
<color name="background">#FDFDFD</color>
<color name="darkBackground">#ECEFF3</color>
+ <color name="colorGeofence">#1976D2</color>
+ <color name="colorReport">#388E3C</color>
+
<color name="colorOnline">#388E3C</color>
<color name="colorOffline">#D32F2F</color>
</resources> \ No newline at end of file