mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
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) {
|
||||
chip.isChecked = currentSet.contains(watch)
|
||||
chip?.setOnCheckedChangeListener { _, _ ->
|
||||
homeViewModel.loadStoredData(toggleList.filter { it.first?.isChecked == true }
|
||||
.map { it.second }.toSet())
|
||||
chip?.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
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 {
|
||||
|
||||
|
|
|
@ -514,6 +514,7 @@
|
|||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:layout_width="wrap_content"
|
||||
app:singleSelection="true"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@
|
|||
android:visibility="gone" />
|
||||
|
||||
|
||||
<com.lagradost.cloudstream3.widget.FlowLayout
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/result_tag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
|
Loading…
Reference in a new issue