From 0409f221b208facf6cba9ec7e322d4f1d5e251b8 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 13 Jan 2022 01:46:16 -0600 Subject: Made search filter cleanable --- .../java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap') 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 5a9f9ad..24d0e4b 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.util.Log import android.view.View import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.PopupMenu +import androidx.core.content.ContextCompat import androidx.core.widget.doAfterTextChanged import androidx.fragment.app.commit import kotlinx.coroutines.DelicateCoroutinesApi @@ -69,6 +70,13 @@ class UnitsActivity : AppCompatActivity() { } binding.searchInput.doAfterTextChanged { Log.d("UnitsActivity", "Search changed to ${it.toString()}") + /*binding.searchInput.setCompoundDrawablesRelativeWithIntrinsicBounds( + null, null, + if (it?.isEmpty() == true) null + else ContextCompat.getDrawable(this, R.drawable.icon_back), + null, + )*/ + binding.searchInput unitsViewModel.search(it.toString()) } } -- cgit v1.2.3