Close button behavior change on search
This commit is contained in:
parent
896c917348
commit
4c4d477fe3
2 changed files with 8 additions and 4 deletions
|
|
@ -50,9 +50,13 @@ fun HomeScreen(
|
|||
viewModel.filterSearch(criteria = it)
|
||||
},
|
||||
onCloseTap = {
|
||||
if (viewModel.search == null) {
|
||||
focusManager.clearFocus(force = true)
|
||||
keyboard?.hide()
|
||||
searchScaffoldState.collapse()
|
||||
} else {
|
||||
viewModel.filterSearch(null)
|
||||
}
|
||||
},
|
||||
onAvatarTap = {
|
||||
homeViewModel.showProfileDialog()
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class BookSearchViewModel @Inject constructor(
|
|||
.cachedIn(viewModelScope + Dispatchers.IO)
|
||||
}
|
||||
|
||||
fun filterSearch(criteria: String) {
|
||||
fun filterSearch(criteria: String?) {
|
||||
this.search = criteria
|
||||
searchSource?.invalidate()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue