Skip to content

Commit

Permalink
Show downloaded only banner in all views
Browse files Browse the repository at this point in the history
  • Loading branch information
arkon committed Oct 3, 2020
1 parent 4b78ff3 commit 7194f65
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ class LibraryController(
}
}

if (preferences.downloadedOnly().get()) {
binding.downloadedOnly.isVisible = true
}

binding.btnGlobalSearch.clicks()
.onEach {
router.pushController(
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ class MainActivity : BaseActivity<MainActivityBinding>() {
preferences.extensionUpdatesCount()
.asImmediateFlow { setExtensionsBadge() }
.launchIn(scope)

preferences.downloadedOnly()
.asImmediateFlow { binding.downloadedOnly.isVisible = it }
.launchIn(scope)
}

override fun onNewIntent(intent: Intent) {
Expand Down
18 changes: 0 additions & 18 deletions app/src/main/res/layout/library_controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@
android:layout_height="match_parent"
android:orientation="vertical">

<FrameLayout
android:id="@+id/downloaded_only"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/green"
android:visibility="gone"
tools:visibility="visible">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:text="@string/label_downloaded_only"
android:textColor="@color/md_white_1000" />

</FrameLayout>

<Button
android:id="@+id/btn_global_search"
style="@style/Theme.Widget.Button"
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -25,6 +26,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<FrameLayout
android:id="@+id/downloaded_only"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/green"
android:visibility="gone"
tools:visibility="visible">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="4dp"
android:text="@string/label_downloaded_only"
android:textColor="@color/md_white_1000" />

</FrameLayout>

</eu.kanade.tachiyomi.widget.ElevationAppBarLayout>

<com.bluelinelabs.conductor.ChangeHandlerFrameLayout
Expand Down

0 comments on commit 7194f65

Please sign in to comment.