forked from recloudstream/cloudstream
Fixed critical TV crash and made the bookmarks single select
This commit is contained in:
parent
c18856c8c3
commit
9ee0653ecf
3 changed files with 15 additions and 4 deletions
|
@ -770,9 +770,19 @@ class HomeFragment : Fragment() {
|
||||||
|
|
||||||
for ((chip, watch) in toggleList) {
|
for ((chip, watch) in toggleList) {
|
||||||
chip.isChecked = currentSet.contains(watch)
|
chip.isChecked = currentSet.contains(watch)
|
||||||
chip?.setOnCheckedChangeListener { _, _ ->
|
chip?.setOnCheckedChangeListener { _, isChecked ->
|
||||||
homeViewModel.loadStoredData(toggleList.filter { it.first?.isChecked == true }
|
if (isChecked) {
|
||||||
.map { it.second }.toSet())
|
homeViewModel.loadStoredData(
|
||||||
|
setOf(watch)
|
||||||
|
// If we filter all buttons then two can be checked at the same time
|
||||||
|
// Revert this if you want to go back to multi selection
|
||||||
|
// toggleList.filter { it.first?.isChecked == true }.map { it.second }.toSet()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// Else if all are unchecked -> Do not load data
|
||||||
|
else if (toggleList.all { it.first?.isChecked != true }) {
|
||||||
|
homeViewModel.loadStoredData(emptySet())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*chip?.setOnClickListener {
|
/*chip?.setOnClickListener {
|
||||||
|
|
||||||
|
|
|
@ -514,6 +514,7 @@
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
app:singleSelection="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
<com.lagradost.cloudstream3.widget.FlowLayout
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:id="@+id/result_tag"
|
android:id="@+id/result_tag"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
Loading…
Reference in a new issue