mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 23:49:16 +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(
|
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()
|
||||||
|
@ -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() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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" />
|
||||||
|
Loading…
Reference in New Issue
Block a user