From 843c9c7e57dcaf589e9a4ad9e0127130c6018fae Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 5 Dec 2022 15:12:16 -0500 Subject: [PATCH] Fix migrate options dialog not being selected when tapping text --- .../migration/search/MigrateSearchScreen.kt | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreen.kt index 150957f32..ba4148a36 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreen.kt @@ -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)