From 16be469ecb9f2e87f9da38fc6f54930dc8daaf5c Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 22 Jan 2021 22:47:01 -0500 Subject: [PATCH] Surface tracking search errors properly --- app/src/main/AndroidManifest.xml | 2 ++ .../kanade/tachiyomi/ui/manga/track/TrackController.kt | 1 + .../kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt | 9 ++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 61423e947c..e4da666eac 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,10 +2,12 @@ + + diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt index 07f762bc60..6e615d58c3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackController.kt @@ -99,6 +99,7 @@ class TrackController : @Suppress("UNUSED_PARAMETER") fun onSearchResultsError(error: Throwable) { Timber.e(error) + activity?.toast(error.message) getSearchDialog()?.onSearchResultsError() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt index c3238f3696..e2328c5800 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt @@ -5,7 +5,6 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import androidx.core.os.bundleOf -import androidx.core.view.isInvisible import androidx.core.view.isVisible import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.customview.customView @@ -105,22 +104,22 @@ class TrackSearchDialog : DialogController { private fun search(query: String) { val binding = binding ?: return binding.progress.isVisible = true - binding.trackSearchList.isInvisible = true + binding.trackSearchList.isVisible = false trackController.presenter.search(query, service) } fun onSearchResults(results: List) { selectedItem = null val binding = binding ?: return - binding.progress.isInvisible = true + binding.progress.isVisible = false binding.trackSearchList.isVisible = true adapter?.setItems(results) } fun onSearchResultsError() { val binding = binding ?: return - binding.progress.isVisible = true - binding.trackSearchList.isInvisible = true + binding.progress.isVisible = false + binding.trackSearchList.isVisible = false adapter?.setItems(emptyList()) }