Made saved searches always available
Replace filtersheet with saved searches version if no filters are avalible
This commit is contained in:
parent
f5f7971cb5
commit
1713dd4ea0
@ -164,10 +164,15 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
}
|
||||
|
||||
open fun initFilterSheet() {
|
||||
if (presenter.sourceFilters.isEmpty() || mode == Mode.RECOMMENDS) {
|
||||
if (mode == Mode.RECOMMENDS) {
|
||||
return
|
||||
}
|
||||
|
||||
if (presenter.sourceFilters.isEmpty()) {
|
||||
filterSheet?.hideFilterButton()
|
||||
binding.fabFilter.text = activity!!.getString(R.string.eh_saved_searches)
|
||||
}
|
||||
|
||||
filterSheet = SourceFilterSheet(
|
||||
activity!!,
|
||||
onFilterClicked = {
|
||||
|
@ -14,6 +14,7 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.items.IFlexible
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.inflate
|
||||
import eu.kanade.tachiyomi.widget.SimpleNavigationView
|
||||
import exh.EXHSavedSearch
|
||||
@ -66,6 +67,10 @@ class SourceFilterSheet(
|
||||
filterNavView.setSavedSearches(searches)
|
||||
}
|
||||
|
||||
fun hideFilterButton() {
|
||||
filterNavView.hideFilterButton()
|
||||
}
|
||||
|
||||
class FilterNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||
SimpleNavigationView(context, attrs) {
|
||||
|
||||
@ -126,6 +131,10 @@ class SourceFilterSheet(
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFilterButton() {
|
||||
filter_btn.gone()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val MAX_SAVED_SEARCHES = 500 // if you want more than this, fuck you, i guess
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
@ -46,6 +47,7 @@
|
||||
android:tint="?attr/colorAccent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/filter_btn"
|
||||
tools:layout_constraintEnd_toStartf="parent"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintStart_toEndOf="@+id/reset_btn"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@ -58,6 +60,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/action_filter"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
@ -98,6 +98,7 @@
|
||||
<string name="eh_force_sync_reset_title">Are you sure?</string>
|
||||
<string name="eh_force_sync_reset_message">Resetting the sync state can cause your next sync to be extremely slow.</string>
|
||||
<string name="eh_show_update_statistics_dialog">Collecting statistics…</string>
|
||||
<string name="eh_saved_searches">Saved Searches</string>
|
||||
|
||||
<!-- AZ -->
|
||||
<string name="az_recommends">See Recommendations</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user