From 7194f6520327d5419cfbe1fd226e094bf227f13b Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 3 Oct 2020 10:48:53 -0400 Subject: [PATCH] Show downloaded only banner in all views --- .../tachiyomi/ui/library/LibraryController.kt | 4 ---- .../kanade/tachiyomi/ui/main/MainActivity.kt | 4 ++++ .../main/res/layout/library_controller.xml | 18 ------------------ app/src/main/res/layout/main_activity.xml | 19 +++++++++++++++++++ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 8aa545f3d..5661defaa 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -193,10 +193,6 @@ class LibraryController( } } - if (preferences.downloadedOnly().get()) { - binding.downloadedOnly.isVisible = true - } - binding.btnGlobalSearch.clicks() .onEach { router.pushController( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 43517b221..0ced7540e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -165,6 +165,10 @@ class MainActivity : BaseActivity() { preferences.extensionUpdatesCount() .asImmediateFlow { setExtensionsBadge() } .launchIn(scope) + + preferences.downloadedOnly() + .asImmediateFlow { binding.downloadedOnly.isVisible = it } + .launchIn(scope) } override fun onNewIntent(intent: Intent) { diff --git a/app/src/main/res/layout/library_controller.xml b/app/src/main/res/layout/library_controller.xml index 1bae7b217..b60444697 100644 --- a/app/src/main/res/layout/library_controller.xml +++ b/app/src/main/res/layout/library_controller.xml @@ -10,24 +10,6 @@ android:layout_height="match_parent" android:orientation="vertical"> - - - - - -