Searching in library now moves to the top of the list on text change

This commit is contained in:
Jays2Kings 2021-04-24 14:58:34 -04:00
parent 2d520026a1
commit 9572c9b7ee

View File

@ -1118,6 +1118,9 @@ class LibraryController(
}
fun search(query: String?): Boolean {
if (query != this.query && !query.isNullOrBlank()) {
binding.libraryGridRecycler.recycler.scrollToPosition(0)
}
this.query = query ?: ""
if (this.query.isNotBlank() && adapter.scrollableHeaders.isEmpty()) {
searchItem.string = this.query