From 2f5eb73d294fc99c3d8a5ace9812e90a3cb1c2d0 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 6 May 2023 12:18:52 -0400 Subject: [PATCH] Allow scrolling in restore confirmation dialog Fixes #9460 --- .../settings/screen/SettingsBackupScreen.kt | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 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 b28af09120..bc7acebca3 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 @@ -10,11 +10,14 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.StringRes import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.AlertDialog import androidx.compose.material3.Checkbox import androidx.compose.material3.MaterialTheme @@ -255,18 +258,30 @@ object SettingsBackupScreen : SearchableSettings { onDismissRequest = onDismissRequest, title = { Text(text = stringResource(R.string.pref_restore_backup)) }, text = { - val msg = buildString { - append(stringResource(R.string.backup_restore_content_full)) - if (err.sources.isNotEmpty()) { - append("\n\n").append(stringResource(R.string.backup_restore_missing_sources)) - err.sources.joinTo(this, separator = "\n- ", prefix = "\n- ") - } - if (err.trackers.isNotEmpty()) { - append("\n\n").append(stringResource(R.string.backup_restore_missing_trackers)) - err.trackers.joinTo(this, separator = "\n- ", prefix = "\n- ") + Column( + modifier = Modifier.verticalScroll(rememberScrollState()), + ) { + val msg = buildString { + append(stringResource(R.string.backup_restore_content_full)) + if (err.sources.isNotEmpty()) { + append("\n\n").append(stringResource(R.string.backup_restore_missing_sources)) + err.sources.joinTo( + this, + separator = "\n- ", + prefix = "\n- ", + ) + } + if (err.trackers.isNotEmpty()) { + append("\n\n").append(stringResource(R.string.backup_restore_missing_trackers)) + err.trackers.joinTo( + this, + separator = "\n- ", + prefix = "\n- ", + ) + } } + Text(text = msg) } - Text(text = msg) }, confirmButton = { TextButton( @@ -327,7 +342,7 @@ object SettingsBackupScreen : SearchableSettings { } @Composable - fun getAutomaticBackupGroup( + private fun getAutomaticBackupGroup( backupPreferences: BackupPreferences, ): Preference.PreferenceGroup { val context = LocalContext.current @@ -402,7 +417,7 @@ private data class MissingRestoreComponents( val trackers: List, ) -data class InvalidRestore( +private data class InvalidRestore( val uri: Uri, val message: String, )