修复订阅规则的崩溃问题

This commit is contained in:
HapeLee committed 2026-05-29 01:02:16 +08:00
1 parent 9742171bf2
commit 7f8b2c205b
1 file changed
+19 -5
@@ -4,6 +4,8 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
@@ -47,7 +49,6 @@ import io.legado.app.ui.widget.components.EmptyMessage
import io.legado.app.ui.widget.components.alert.AppAlertDialog import io.legado.app.ui.widget.components.alert.AppAlertDialog
import io.legado.app.ui.widget.components.button.series.SmallPlainButton import io.legado.app.ui.widget.components.button.series.SmallPlainButton
import io.legado.app.ui.widget.components.card.SelectionItemCard import io.legado.app.ui.widget.components.card.SelectionItemCard
import io.legado.app.ui.widget.components.checkBox.CheckboxGroupContainer
import io.legado.app.ui.widget.components.checkBox.CheckboxItem import io.legado.app.ui.widget.components.checkBox.CheckboxItem
import io.legado.app.ui.widget.components.menuItem.RoundDropdownMenuItem import io.legado.app.ui.widget.components.menuItem.RoundDropdownMenuItem
import io.legado.app.ui.widget.components.rules.RuleListScaffold import io.legado.app.ui.widget.components.rules.RuleListScaffold
@@ -244,16 +245,29 @@ fun RuleSubEditDialog(
modifier = Modifier.padding(top = 8.dp) modifier = Modifier.padding(top = 8.dp)
) )
CheckboxGroupContainer(columns = 2) { Column(
typeArray.forEachIndexed { index, text -> modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
item { verticalArrangement = Arrangement.spacedBy(4.dp)
) {
typeArray.indices.chunked(2).forEach { indices ->
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
indices.forEach { index ->
Box(modifier = Modifier.weight(1f)) {
CheckboxItem( CheckboxItem(
title = text, title = typeArray[index],
checked = (index == type), checked = (index == type),
onCheckedChange = { if (it) type = index } onCheckedChange = { if (it) type = index }
) )
} }
} }
if (indices.size < 2) {
Spacer(modifier = Modifier.weight(1f))
}
}
}
} }
} }
}, },