Skip to content

Commit

Permalink
Fix bug: Loading progress and search empty result icon overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Jul 29, 2024
1 parent 63fec4f commit 7ad5c08
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,18 @@ class NotesFragment: Fragment() {
binding.edtSearch.addTextChangedListener(
onTextChanged = { text, _, _, _ ->
binding.pbLoading.visible()
binding.groupSearchResultEmpty.gone()

if (!binding.edtSearch.isFocused && text.isNullOrEmpty()) return@addTextChangedListener

notesViewModel.searchNote(keyword = text.toString()) { notes ->
binding.pbLoading.gone()
if (notes.isEmpty()) {
binding.groupSearchResultEmpty.visible()
} else {
binding.groupSearchResultEmpty.gone()
}
notesAdapter?.updateData(notes, fromSearch = true, keyword = text.toString())
binding.pbLoading.gone()
}
})
}
Expand Down

0 comments on commit 7ad5c08

Please sign in to comment.