Explicitly show "No results found" in global search instead of hiding row

This commit is contained in:
arkon
2020-07-18 17:46:29 -04:00
parent d2e2ebbe45
commit d3ebedeef2
2 changed files with 18 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.view.visible
import kotlinx.android.synthetic.main.global_search_controller_card.no_results_found
import kotlinx.android.synthetic.main.global_search_controller_card.progress
import kotlinx.android.synthetic.main.global_search_controller_card.recycler
import kotlinx.android.synthetic.main.global_search_controller_card.source_card
@ -58,15 +59,15 @@ class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) :
when {
results == null -> {
progress.visible()
showHolder()
showResultsHolder()
}
results.isEmpty() -> {
progress.gone()
hideHolder()
showNoResults()
}
else -> {
progress.gone()
showHolder()
showResultsHolder()
}
}
if (results !== lastBoundResults) {
@ -101,13 +102,13 @@ class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) :
return null
}
private fun showHolder() {
title_wrapper.visible()
private fun showResultsHolder() {
no_results_found.gone()
source_card.visible()
}
private fun hideHolder() {
title_wrapper.gone()
private fun showNoResults() {
no_results_found.visible()
source_card.gone()
}
}