Fix migrate options dialog not being selected when tapping text

This commit is contained in:
arkon 2022-12-05 15:12:16 -05:00
parent c88b79fa17
commit 843c9c7e57

View File

@ -1,7 +1,12 @@
package eu.kanade.tachiyomi.ui.browse.migration.search
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Checkbox
import androidx.compose.material3.Text
@ -130,12 +135,20 @@ fun MigrateDialog(
Text(text = stringResource(R.string.migration_dialog_what_to_include))
},
text = {
Column {
Column(
modifier = Modifier.verticalScroll(rememberScrollState()),
) {
items.forEachIndexed { index, title ->
val onChange: () -> Unit = {
selected[index] = !selected[index]
}
Row(
modifier = Modifier
.fillMaxWidth()
.clickable(onClick = onChange),
verticalAlignment = Alignment.CenterVertically,
) {
Checkbox(checked = selected[index], onCheckedChange = { selected[index] = !selected[index] })
Checkbox(checked = selected[index], onCheckedChange = { onChange() })
Text(text = title)
}
}
@ -143,15 +156,13 @@ fun MigrateDialog(
},
confirmButton = {
Row {
TextButton(
modifier = Modifier.weight(1f),
onClick = {
onClickTitle()
onDismissRequest()
},
) {
TextButton(onClick = {
onClickTitle()
onDismissRequest()
},) {
Text(text = stringResource(R.string.action_show_manga))
}
Spacer(modifier = Modifier.weight(1f))
TextButton(onClick = {
scope.launchIO {
screenModel.migrateManga(oldManga, newManga, false)