aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt8
-rw-r--r--androidApp/src/main/res/layout/units_activity.xml27
2 files changed, 27 insertions, 8 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 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())
}
}
diff --git a/androidApp/src/main/res/layout/units_activity.xml b/androidApp/src/main/res/layout/units_activity.xml
index 475598f..9841086 100644
--- a/androidApp/src/main/res/layout/units_activity.xml
+++ b/androidApp/src/main/res/layout/units_activity.xml
@@ -44,16 +44,27 @@
app:layout_constraintStart_toEndOf="@id/userButton"
app:layout_constraintTop_toTopOf="@id/displayModeToggle">
- <com.google.android.material.textfield.TextInputEditText
- android:id="@+id/searchInput"
+ <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@null"
- android:hint="@string/units_search"
- android:imeOptions="actionSearch"
- android:inputType="text"
- android:lines="1"
- android:paddingHorizontal="16dp" />
+ app:endIconMode="clear_text"
+ app:boxBackgroundMode="none"
+ app:boxStrokeWidth="0dp"
+ app:hintEnabled="false">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/searchInput"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@null"
+ android:hint="@string/units_search"
+ android:imeOptions="actionSearch"
+ android:inputType="text"
+ android:lines="1"
+ android:paddingTop="12dp"
+ android:paddingHorizontal="16dp" />
+
+ </com.google.android.material.textfield.TextInputLayout>
</com.google.android.material.card.MaterialCardView>