mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 22:59:18 +01:00
Reword action button in source filter sheet (closes #2994)
This commit is contained in:
parent
543ca43e24
commit
8c0cafc793
@ -137,7 +137,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
|
||||
filterSheet = SourceFilterSheet(
|
||||
activity!!,
|
||||
onSearchClicked = {
|
||||
onFilterClicked = {
|
||||
val allDefault = presenter.sourceFilters == presenter.source.getFilterList()
|
||||
showProgressBar()
|
||||
adapter?.clear()
|
||||
|
@ -10,12 +10,12 @@ import eu.davidea.flexibleadapter.items.IFlexible
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.view.inflate
|
||||
import eu.kanade.tachiyomi.widget.SimpleNavigationView
|
||||
import kotlinx.android.synthetic.main.source_filter_sheet.view.filter_btn
|
||||
import kotlinx.android.synthetic.main.source_filter_sheet.view.reset_btn
|
||||
import kotlinx.android.synthetic.main.source_filter_sheet.view.search_btn
|
||||
|
||||
class SourceFilterSheet(
|
||||
activity: Activity,
|
||||
onSearchClicked: () -> Unit,
|
||||
onFilterClicked: () -> Unit,
|
||||
onResetClicked: () -> Unit
|
||||
) : BottomSheetDialog(activity) {
|
||||
|
||||
@ -23,8 +23,8 @@ class SourceFilterSheet(
|
||||
|
||||
init {
|
||||
filterNavView = FilterNavigationView(activity)
|
||||
filterNavView.onSearchClicked = {
|
||||
onSearchClicked()
|
||||
filterNavView.onFilterClicked = {
|
||||
onFilterClicked()
|
||||
this.dismiss()
|
||||
}
|
||||
filterNavView.onResetClicked = onResetClicked
|
||||
@ -39,7 +39,7 @@ class SourceFilterSheet(
|
||||
class FilterNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||
SimpleNavigationView(context, attrs) {
|
||||
|
||||
var onSearchClicked = {}
|
||||
var onFilterClicked = {}
|
||||
var onResetClicked = {}
|
||||
|
||||
val adapter: FlexibleAdapter<IFlexible<*>> = FlexibleAdapter<IFlexible<*>>(null)
|
||||
@ -52,7 +52,7 @@ class SourceFilterSheet(
|
||||
val view = inflate(R.layout.source_filter_sheet)
|
||||
((view as ViewGroup).getChildAt(1) as ViewGroup).addView(recycler)
|
||||
addView(view)
|
||||
search_btn.setOnClickListener { onSearchClicked() }
|
||||
filter_btn.setOnClickListener { onFilterClicked() }
|
||||
reset_btn.setOnClickListener { onResetClicked() }
|
||||
}
|
||||
}
|
||||
|
@ -37,12 +37,12 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/search_btn"
|
||||
android:id="@+id/filter_btn"
|
||||
style="@style/Theme.Widget.Button.FilledAccent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/action_search"
|
||||
android:text="@string/action_filter"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
Loading…
Reference in New Issue
Block a user