diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-12 17:36:31 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-12 17:36:31 -0600 |
commit | f528b208dd4bcd9cf3cf881ea93ead71b9322240 (patch) | |
tree | 49e1c136d5d1c3460dbb6c91e025c5ea359ddc72 /androidApp/src/main/java | |
parent | 90d9c04e66f7e7564ee1639d6b01bb34fe05239d (diff) | |
download | etbsa-trackermap-mobile-f528b208dd4bcd9cf3cf881ea93ead71b9322240.tar.gz etbsa-trackermap-mobile-f528b208dd4bcd9cf3cf881ea93ead71b9322240.tar.bz2 etbsa-trackermap-mobile-f528b208dd4bcd9cf3cf881ea93ead71b9322240.zip |
Improved reports design
Diffstat (limited to 'androidApp/src/main/java')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 22 |
1 files changed, 15 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>() |