diff options
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 7 |
1 files changed, 7 insertions, 0 deletions
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 e9b9010..30e34b3 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 @@ -6,6 +6,7 @@ import android.os.Bundle import android.util.Log import android.view.View import android.view.inputmethod.InputMethodManager +import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.TooltipCompat @@ -20,8 +21,10 @@ import mx.trackermap.TrackerMap.android.map.UnitMapFragment import mx.trackermap.TrackerMap.android.session.UserInformationActivity import mx.trackermap.TrackerMap.client.models.MapLayer import org.koin.androidx.viewmodel.ext.android.viewModel +import kotlin.time.ExperimentalTime @DelicateCoroutinesApi +@ExperimentalTime class UnitsActivity : AppCompatActivity() { private var _binding: UnitsActivityBinding? = null @@ -115,6 +118,9 @@ class UnitsActivity : AppCompatActivity() { } private fun setupObservers() { + unitsViewModel.units.observe(this) { + Toast.makeText(this, getString(R.string.shared_loading), Toast.LENGTH_SHORT).show() + } unitsViewModel.unitsDisplayMode.observe(this) { displayMode -> binding.displayModeToggle.setImageResource( when (displayMode) { @@ -162,6 +168,7 @@ class UnitsActivity : AppCompatActivity() { } private fun removeObservers() { + unitsViewModel.units.removeObservers(this) unitsViewModel.unitsDisplayMode.removeObservers(this) unitsViewModel.selectedUnit.removeObservers(this) } |