From 661ee54644f47c5ed7b5b0a2bd7afc1369b1d382 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 26 Apr 2020 16:03:51 -0400 Subject: [PATCH] Fix empty view still showing on browse source Using the browse icon for empty view with http sources --- .../ui/source/browse/BrowseSourceController.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt index d7c9e74c16..6f165b1ec3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceController.kt @@ -401,16 +401,22 @@ open class BrowseSourceController(bundle: Bundle) : val actions = emptyList().toMutableList() actions += if (presenter.source is LocalSource) { - EmptyView.Action(R.string.local_source_help_guide, View.OnClickListener { openLocalSourceHelpGuide() }) + EmptyView.Action(R.string.local_source_help_guide, + View.OnClickListener { openLocalSourceHelpGuide() }) } else { EmptyView.Action(R.string.retry, retryAction) } if (presenter.source is HttpSource) { - actions += EmptyView.Action(R.string.open_in_webview, View.OnClickListener { openInWebView() }) + actions += EmptyView.Action(R.string.open_in_webview, + View.OnClickListener { openInWebView() }) } - empty_view.show(R.drawable.ic_local_library_24dp, message, actions) + empty_view.show( + if (presenter.source is HttpSource) R.drawable.ic_browse_24dp else R.drawable.ic_local_library_24dp, + message, + actions + ) } else { snack = source_layout?.snack(message, Snackbar.LENGTH_INDEFINITE) { setAction(R.string.retry, retryAction) @@ -506,6 +512,7 @@ open class BrowseSourceController(bundle: Bundle) : * Shows the progress bar. */ private fun showProgressBar() { + empty_view.gone() progress?.visible() snack?.dismiss() snack = null @@ -515,6 +522,7 @@ open class BrowseSourceController(bundle: Bundle) : * Hides active progress bars. */ private fun hideProgressBar() { + empty_view.gone() progress?.gone() }