aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src/main')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt1
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt2
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt9
3 files changed, 6 insertions, 6 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt
index 3c2d6ce..bd3ab67 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt
@@ -55,6 +55,7 @@ class DevicesFragment : Fragment() {
@DelicateCoroutinesApi
private fun setupObservers() {
+ Log.d("DevicesFragment", "setupObservers()")
unitsViewModel.units.observe(viewLifecycleOwner) { units ->
Log.d("DevicesFragment", "Success $units")
binding.devicesList.swapAdapter(
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 70a0236..8dbd26c 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
@@ -2,6 +2,7 @@ package mx.trackermap.TrackerMap.android.map
import android.graphics.BitmapFactory
import android.os.Bundle
+import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -65,6 +66,7 @@ class MapFragment: GlobeMapFragment() {
@DelicateCoroutinesApi
private fun setupObservers() {
+ Log.d("MapFragment", "setupObservers()")
unitsViewModel.units.observe(viewLifecycleOwner) { units ->
/* Remove all markers */
markers.forEach {
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
index 935aea5..8a6f699 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
@@ -20,9 +20,6 @@ class UnitsActivity : AppCompatActivity() {
private val unitsViewModel: UnitsViewModel by viewModel()
- private val mapFragment = MapFragment()
- private val devicesFragment = DevicesFragment()
-
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@@ -71,9 +68,9 @@ class UnitsActivity : AppCompatActivity() {
val newFragment =
when (displayMode) {
- UnitsViewModel.UnitsDisplayMode.LIST -> devicesFragment
- UnitsViewModel.UnitsDisplayMode.MAP -> mapFragment
- else -> devicesFragment
+ UnitsViewModel.UnitsDisplayMode.LIST -> DevicesFragment()
+ UnitsViewModel.UnitsDisplayMode.MAP -> MapFragment()
+ else -> DevicesFragment()
}
supportFragmentManager.commit {
replace(R.id.displayContainer, newFragment)