aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
diff options
context:
space:
mode:
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.kt8
1 files changed, 8 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 6e9bc83..c895f31 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
@@ -2,6 +2,7 @@ package mx.trackermap.TrackerMap.android.units
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
+import androidx.core.widget.doAfterTextChanged
import androidx.fragment.app.commit
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.android.databinding.UnitsActivityBinding
@@ -35,6 +36,13 @@ class UnitsActivity : AppCompatActivity() {
binding.displayModeToggle.setOnClickListener {
unitsViewModel.toggleDisplayMode()
}
+ binding.searchInput.doAfterTextChanged {
+ unitsViewModel.searchQuery.value = it.toString()
+ }
+ binding.searchInput.setOnEditorActionListener { _, _, _ ->
+ unitsViewModel.search()
+ true
+ }
}
private fun setupObservers() {