Reword action button in source filter sheet (closes #2994)

This commit is contained in:
arkon 2020-04-30 20:22:52 -04:00
parent 543ca43e24
commit 8c0cafc793
3 changed files with 9 additions and 9 deletions

View File

@ -137,7 +137,7 @@ open class BrowseSourceController(bundle: Bundle) :
filterSheet = SourceFilterSheet( filterSheet = SourceFilterSheet(
activity!!, activity!!,
onSearchClicked = { onFilterClicked = {
val allDefault = presenter.sourceFilters == presenter.source.getFilterList() val allDefault = presenter.sourceFilters == presenter.source.getFilterList()
showProgressBar() showProgressBar()
adapter?.clear() adapter?.clear()

View File

@ -10,12 +10,12 @@ import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.util.view.inflate
import eu.kanade.tachiyomi.widget.SimpleNavigationView 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.reset_btn
import kotlinx.android.synthetic.main.source_filter_sheet.view.search_btn
class SourceFilterSheet( class SourceFilterSheet(
activity: Activity, activity: Activity,
onSearchClicked: () -> Unit, onFilterClicked: () -> Unit,
onResetClicked: () -> Unit onResetClicked: () -> Unit
) : BottomSheetDialog(activity) { ) : BottomSheetDialog(activity) {
@ -23,8 +23,8 @@ class SourceFilterSheet(
init { init {
filterNavView = FilterNavigationView(activity) filterNavView = FilterNavigationView(activity)
filterNavView.onSearchClicked = { filterNavView.onFilterClicked = {
onSearchClicked() onFilterClicked()
this.dismiss() this.dismiss()
} }
filterNavView.onResetClicked = onResetClicked filterNavView.onResetClicked = onResetClicked
@ -39,7 +39,7 @@ class SourceFilterSheet(
class FilterNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : class FilterNavigationView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
SimpleNavigationView(context, attrs) { SimpleNavigationView(context, attrs) {
var onSearchClicked = {} var onFilterClicked = {}
var onResetClicked = {} var onResetClicked = {}
val adapter: FlexibleAdapter<IFlexible<*>> = FlexibleAdapter<IFlexible<*>>(null) val adapter: FlexibleAdapter<IFlexible<*>> = FlexibleAdapter<IFlexible<*>>(null)
@ -52,7 +52,7 @@ class SourceFilterSheet(
val view = inflate(R.layout.source_filter_sheet) val view = inflate(R.layout.source_filter_sheet)
((view as ViewGroup).getChildAt(1) as ViewGroup).addView(recycler) ((view as ViewGroup).getChildAt(1) as ViewGroup).addView(recycler)
addView(view) addView(view)
search_btn.setOnClickListener { onSearchClicked() } filter_btn.setOnClickListener { onFilterClicked() }
reset_btn.setOnClickListener { onResetClicked() } reset_btn.setOnClickListener { onResetClicked() }
} }
} }

View File

@ -37,12 +37,12 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/search_btn" android:id="@+id/filter_btn"
style="@style/Theme.Widget.Button.FilledAccent" style="@style/Theme.Widget.Button.FilledAccent"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/action_search" android:text="@string/action_filter"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />