mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Close search bar when clicking on clear filter button if filter is empty
This commit is contained in:
parent
00b92a61b4
commit
e9f0bed2d2
2 changed files with 6 additions and 2 deletions
|
|
@ -201,7 +201,12 @@ open class AbstractMainViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
@UiThread
|
||||
fun clearFilter() {
|
||||
searchFilter.value = ""
|
||||
if (searchFilter.value.orEmpty().isEmpty()) {
|
||||
searchBarVisible.value = false
|
||||
focusSearchBarEvent.value = Event(false)
|
||||
} else {
|
||||
searchFilter.value = ""
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@
|
|||
<ImageView
|
||||
android:id="@+id/clear_field"
|
||||
android:onClick="@{() -> viewModel.clearFilter()}"
|
||||
android:enabled="@{viewModel.searchFilter.length() > 0}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:padding="15dp"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue