aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-17 15:57:21 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-17 15:57:21 -0600
commit07d184c408aba980f331ecaa3e4baef80b6ce82c (patch)
treec12472290b7a6b0795fcfb6adc0b8ed9186e166d /androidApp/src/main/java/mx/trackermap/TrackerMap/android/details
parent7ab652acd172963b2f36085eb9be6927cb21fc71 (diff)
downloadetbsa-trackermap-mobile-07d184c408aba980f331ecaa3e4baef80b6ce82c.tar.gz
etbsa-trackermap-mobile-07d184c408aba980f331ecaa3e4baef80b6ce82c.tar.bz2
etbsa-trackermap-mobile-07d184c408aba980f331ecaa3e4baef80b6ce82c.zip
Fixed geofences retrieval on reports fragment
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/details')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt3
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt2
2 files changed, 4 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt
index 1f1bb15..e1a24ec 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt
@@ -128,6 +128,7 @@ class UnitReportsFragment : Fragment() {
when (report) {
is ReportController.Report.PositionsReport -> {
display(report.positions)
+ display(unitReportsViewModel.geofences.value!!)
showMap(true)
}
is ReportController.Report.EventsReport -> {
@@ -136,6 +137,7 @@ class UnitReportsFragment : Fragment() {
}
is ReportController.Report.StopsReport -> {
display(report.stops)
+ display(unitReportsViewModel.geofences.value!!)
showMap(true)
}
is ReportController.Report.XlsxReport -> {
@@ -301,6 +303,7 @@ class UnitReportsFragment : Fragment() {
}
private fun display(geofences: Array<Geofence>) {
+ Log.d("UnitReportsFragment", "Geofences: $geofences")
if (reportsMapFragment.hasStarted) {
Log.d("UnitReportsFragment", "Displaying geofences: $geofences")
reportsMapFragment.displayGeofences(geofences)
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt
index a957435..7d1e028 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt
@@ -25,7 +25,7 @@ class UnitReportsViewModel(
private val _reportPeriod: MutableLiveData<ReportDates.ReportPeriod> =
savedStateHandle.getLiveData("reportPeriod", null)
private val _report: MutableLiveData<ReportController.Report> = MutableLiveData()
- private val _geofences: MutableLiveData<Array<Geofence>> = MutableLiveData()
+ private val _geofences: MutableLiveData<Array<Geofence>> = MutableLiveData(emptyArray())
val deviceId: LiveData<Int> get() = _deviceId
val reportType: LiveData<ReportController.ReportType> get() = _reportType