From 82aca60c6699760dfdc146477452d813079a311f Mon Sep 17 00:00:00 2001 From: yukonisen Date: Wed, 25 Dec 2024 21:35:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/components/SettingsEntry.kt | 14 +++++++------- .../home/exploration/home/ExplorationHomeScreen.kt | 6 ++---- .../ui/home/settings/SettingsScreen.kt | 4 ++-- .../ui/home/settings/list/AboutSettingsList.kt | 9 ++++++--- .../ui/home/settings/list/AppSettingsList.kt | 3 +++ .../ui/home/settings/list/DataSettingsList.kt | 4 ++++ .../ui/home/settings/list/DisplaySettingsList.kt | 3 +++ app/src/main/res/drawable/alt_route_24px.xml | 11 +++++++++++ app/src/main/res/drawable/archive_24px.xml | 10 ++++++++++ app/src/main/res/drawable/dark_mode_24px.xml | 10 ++++++++++ .../res/drawable/deployed_code_update_24px.xml | 10 ++++++++++ .../main/res/drawable/format_color_fill_24px.xml | 10 ++++++++++ app/src/main/res/drawable/group_24px.xml | 10 ++++++++++ app/src/main/res/drawable/handyman_24px.xml | 10 ++++++++++ app/src/main/res/drawable/input_24px.xml | 11 +++++++++++ app/src/main/res/drawable/translate_24px.xml | 10 ++++++++++ 16 files changed, 119 insertions(+), 16 deletions(-) create mode 100644 app/src/main/res/drawable/alt_route_24px.xml create mode 100644 app/src/main/res/drawable/archive_24px.xml create mode 100644 app/src/main/res/drawable/dark_mode_24px.xml create mode 100644 app/src/main/res/drawable/deployed_code_update_24px.xml create mode 100644 app/src/main/res/drawable/format_color_fill_24px.xml create mode 100644 app/src/main/res/drawable/group_24px.xml create mode 100644 app/src/main/res/drawable/handyman_24px.xml create mode 100644 app/src/main/res/drawable/input_24px.xml create mode 100644 app/src/main/res/drawable/translate_24px.xml diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/components/SettingsEntry.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/components/SettingsEntry.kt index 9db0c6b..aa4334a 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/components/SettingsEntry.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/components/SettingsEntry.kt @@ -96,13 +96,13 @@ fun SettingsSwitchEntry( Box( modifier = Modifier .fillMaxHeight() - .padding(end = 8.dp), + .padding(end = 12.dp), contentAlignment = Alignment.Center ) { Icon( modifier = Modifier.size(24.dp), painter = painterResource(iconRes), - tint = MaterialTheme.colorScheme.onSecondaryContainer, + tint = MaterialTheme.colorScheme.onSurfaceVariant, contentDescription = "Icon" ) } @@ -203,7 +203,7 @@ private fun SettingsSliderEntry( Icon( modifier = Modifier.size(24.dp), painter = painterResource(iconRes), - tint = MaterialTheme.colorScheme.onSecondaryContainer, + tint = MaterialTheme.colorScheme.onSurfaceVariant, contentDescription = "Icon" ) } @@ -277,13 +277,13 @@ fun SettingsMenuEntry( Box( modifier = Modifier .fillMaxHeight() - .padding(end = 8.dp), + .padding(end = 12.dp), contentAlignment = Alignment.Center ) { Icon( modifier = Modifier.size(24.dp), painter = painterResource(iconRes), - tint = MaterialTheme.colorScheme.onSecondaryContainer, + tint = MaterialTheme.colorScheme.onSurfaceVariant, contentDescription = "Icon" ) } @@ -405,13 +405,13 @@ fun SettingsClickableEntry( Box( modifier = Modifier .fillMaxHeight() - .padding(end = 8.dp), + .padding(end = 12.dp), contentAlignment = Alignment.Center ) { Icon( modifier = Modifier.size(24.dp), painter = painterResource(iconRes), - tint = MaterialTheme.colorScheme.onSecondaryContainer, + tint = MaterialTheme.colorScheme.onSurfaceVariant, contentDescription = "Icon" ) } diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/exploration/home/ExplorationHomeScreen.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/exploration/home/ExplorationHomeScreen.kt index fd31470..021ebc3 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/exploration/home/ExplorationHomeScreen.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/exploration/home/ExplorationHomeScreen.kt @@ -193,7 +193,7 @@ fun ExplorationPage( .padding(vertical = 4.dp) .fillMaxWidth() .height(46.dp) - .padding(start = 22.dp), + .padding(horizontal = 16.dp), verticalAlignment = Alignment.CenterVertically ) { Text( @@ -205,9 +205,7 @@ fun ExplorationPage( ) if (explorationBooksRow.expandable) { IconButton( - modifier = Modifier.size(40.dp) - .padding(end = 16.dp) - .padding(vertical = 6.dp), + modifier = Modifier.size(40.dp), onClick = { explorationBooksRow.expandedPageDataSourceId?.let { onClickExpand(it) diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/SettingsScreen.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/SettingsScreen.kt index 25b5eb3..c2b45a0 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/SettingsScreen.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/SettingsScreen.kt @@ -168,7 +168,7 @@ fun SettingsCategory( var expanded by remember { mutableStateOf(true) } Card( modifier = Modifier.fillMaxWidth() - .padding(vertical = 8.dp, horizontal = 14.dp), + .padding(vertical = 8.dp, horizontal = 8.dp), colors = CardDefaults.cardColors( containerColor = MaterialTheme.colorScheme.surfaceContainerLow ), @@ -218,7 +218,7 @@ fun SettingsCategory( } AnimatedVisibility(visible = expanded) { Box( - modifier = Modifier.padding(top = 0.dp, end = 14.dp, start = 14.dp, bottom = 14.dp) + modifier = Modifier.padding(top = 0.dp, end = 12.dp, start = 12.dp, bottom = 12.dp) ) { Column( modifier = Modifier.clip(RoundedCornerShape(16.dp)), diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AboutSettingsList.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AboutSettingsList.kt index 038945e..52a96f4 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AboutSettingsList.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AboutSettingsList.kt @@ -13,13 +13,13 @@ fun AboutSettingsList( settingState: SettingState) { val appInfo: String = buildString { appendLine(BuildConfig.APPLICATION_ID) - append(BuildConfig.VERSION_NAME).append(" (").append(BuildConfig.VERSION_CODE).append(")") + append("${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE}) - ") + .append(if (BuildConfig.DEBUG) "debug" else "release") } val buildInfo: String = buildString { appendLine(stringResource(R.string.info_build_date)) - appendLine(stringResource(R.string.info_build_host)) - append(if (BuildConfig.DEBUG) "DEV (DEBUG)" else "RELEASE") + append(stringResource(R.string.info_build_host)) } SettingsClickableEntry( title = stringResource(R.string.app_name), @@ -31,15 +31,18 @@ fun AboutSettingsList( } ) SettingsClickableEntry( + iconRes = R.drawable.handyman_24px, title = stringResource(R.string.settings_app_build), description = buildInfo, ) SettingsClickableEntry( + iconRes = R.drawable.archive_24px, title = stringResource(R.string.settings_github_repo), description = stringResource(R.string.settings_github_repo_desc), openUrl = "https://github.com/dmzz-yyhyy/LightNovelReader" ) SettingsClickableEntry( + iconRes = R.drawable.group_24px, title = stringResource(R.string.settings_communication), description = stringResource(R.string.settings_communication_desc), openUrl = "https://qm.qq.com/q/Tp80Hf9Oms" diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AppSettingsList.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AppSettingsList.kt index c5f3307..b582d44 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AppSettingsList.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/AppSettingsList.kt @@ -15,12 +15,14 @@ fun AppSettingsList( checkUpdate: () -> Unit ) { SettingsSwitchEntry( + iconRes = R.drawable.cloud_download_24px, title = stringResource(R.string.settings_auto_check_updates), description = stringResource(R.string.settings_auto_check_updates_desc), checked = settingState.checkUpdate, booleanUserData = settingState.checkUpdateUserData ) SettingsMenuEntry( + iconRes = R.drawable.alt_route_24px, title = stringResource(R.string.settings_update_channel), description = stringResource(R.string.settings_update_channel_desc), options = MenuOptions.UpdateChannelOptions, @@ -28,6 +30,7 @@ fun AppSettingsList( onOptionChange = settingState.updateChannelKeyUserData::asynchronousSet ) SettingsClickableEntry( + iconRes = R.drawable.deployed_code_update_24px, title = stringResource(R.string.settings_get_updates), description = stringResource(R.string.settings_get_updates_desc), onClick = { checkUpdate() } diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DataSettingsList.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DataSettingsList.kt index de86c46..88057a1 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DataSettingsList.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DataSettingsList.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager +import indi.dmzz_yyhyy.lightnovelreader.R import indi.dmzz_yyhyy.lightnovelreader.ui.components.ExportContext import indi.dmzz_yyhyy.lightnovelreader.ui.components.ExportDialog import indi.dmzz_yyhyy.lightnovelreader.ui.components.MutableExportContext @@ -111,16 +112,19 @@ fun DataSettingsList( } } SettingsClickableEntry( + iconRes = R.drawable.output_24px, title = "导出数据", description = "将当前应用内的用户数据导出为.lnr文件", onClick = { displayExportDialog = true } ) SettingsClickableEntry( + iconRes = R.drawable.input_24px, title = "导入数据", description = "从外部.lnr文件内导入数据至软件", onClick = { selectDataFile(importDataLauncher) } ) SettingsClickableEntry( + iconRes = R.drawable.public_24px, title = "切换数据源", description = "切换软件的网络数据提供源,但这会导致你的用户数据被暂存,将在下次切换到此数据源后恢复。但是你的缓存数据会被永久删除。", onClick = { displaySourceChangeDialog = true } diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DisplaySettingsList.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DisplaySettingsList.kt index 2f99e75..4820db7 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DisplaySettingsList.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/settings/list/DisplaySettingsList.kt @@ -14,6 +14,7 @@ fun DisplaySettingsList( settingState: SettingState ) { SettingsMenuEntry( + iconRes = R.drawable.dark_mode_24px, title = stringResource(R.string.settings_dark_theme), description = stringResource(R.string.settings_dark_theme_desc), options = MenuOptions.DarkModeOptions, @@ -21,6 +22,7 @@ fun DisplaySettingsList( onOptionChange = settingState.darkModeKeyUserData::asynchronousSet ) SettingsSwitchEntry( + iconRes = R.drawable.format_color_fill_24px, title = stringResource(R.string.settings_dynamic_colors), description = stringResource(R.string.settings_dynamic_colors_desc), checked = settingState.dynamicColorsKey, @@ -28,6 +30,7 @@ fun DisplaySettingsList( disabled = Build.VERSION.SDK_INT < Build.VERSION_CODES.S ) SettingsMenuEntry( + iconRes = R.drawable.translate_24px, title = stringResource(R.string.settings_characters_variant), description = stringResource(R.string.settings_characters_variant_desc), options = MenuOptions.AppLocaleOptions, diff --git a/app/src/main/res/drawable/alt_route_24px.xml b/app/src/main/res/drawable/alt_route_24px.xml new file mode 100644 index 0000000..748b552 --- /dev/null +++ b/app/src/main/res/drawable/alt_route_24px.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/archive_24px.xml b/app/src/main/res/drawable/archive_24px.xml new file mode 100644 index 0000000..a7d0bf2 --- /dev/null +++ b/app/src/main/res/drawable/archive_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/dark_mode_24px.xml b/app/src/main/res/drawable/dark_mode_24px.xml new file mode 100644 index 0000000..b578c20 --- /dev/null +++ b/app/src/main/res/drawable/dark_mode_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/deployed_code_update_24px.xml b/app/src/main/res/drawable/deployed_code_update_24px.xml new file mode 100644 index 0000000..9ae209f --- /dev/null +++ b/app/src/main/res/drawable/deployed_code_update_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/format_color_fill_24px.xml b/app/src/main/res/drawable/format_color_fill_24px.xml new file mode 100644 index 0000000..b224581 --- /dev/null +++ b/app/src/main/res/drawable/format_color_fill_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/group_24px.xml b/app/src/main/res/drawable/group_24px.xml new file mode 100644 index 0000000..556499a --- /dev/null +++ b/app/src/main/res/drawable/group_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/handyman_24px.xml b/app/src/main/res/drawable/handyman_24px.xml new file mode 100644 index 0000000..6255c60 --- /dev/null +++ b/app/src/main/res/drawable/handyman_24px.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/input_24px.xml b/app/src/main/res/drawable/input_24px.xml new file mode 100644 index 0000000..55c2537 --- /dev/null +++ b/app/src/main/res/drawable/input_24px.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/translate_24px.xml b/app/src/main/res/drawable/translate_24px.xml new file mode 100644 index 0000000..5792d2c --- /dev/null +++ b/app/src/main/res/drawable/translate_24px.xml @@ -0,0 +1,10 @@ + + +