From e4292719d3b3d3dff6d0f80ca59fa250d33d2180 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sun, 16 Oct 2022 23:52:34 +0700 Subject: [PATCH] CreateBackupDialog: Select all options by default (#8215) --- .../settings/screen/SettingsBackupScreen.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt index fb49422b03..02da01b1b0 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt @@ -22,12 +22,12 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateListOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue +import androidx.compose.runtime.toMutableStateList import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalClipboardManager @@ -135,19 +135,19 @@ class SettingsBackupScreen : SearchableSettings { onConfirm: (flag: Int) -> Unit, onDismissRequest: () -> Unit, ) { - val flags = remember { mutableStateListOf() } + val choices = remember { + mapOf( + BackupConst.BACKUP_CATEGORY to R.string.categories, + BackupConst.BACKUP_CHAPTER to R.string.chapters, + BackupConst.BACKUP_TRACK to R.string.track, + BackupConst.BACKUP_HISTORY to R.string.history, + ) + } + val flags = remember { choices.keys.toMutableStateList() } AlertDialog( onDismissRequest = onDismissRequest, title = { Text(text = stringResource(R.string.backup_choice)) }, text = { - val choices = remember { - mapOf( - BackupConst.BACKUP_CATEGORY to R.string.categories, - BackupConst.BACKUP_CHAPTER to R.string.chapters, - BackupConst.BACKUP_TRACK to R.string.track, - BackupConst.BACKUP_HISTORY to R.string.history, - ) - } Column { CreateBackupDialogItem( isSelected = true,