From 7455cef58381147c59898167e729cc0fa67901ac Mon Sep 17 00:00:00 2001 From: yukonisen Date: Sat, 31 Aug 2024 14:11:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BC=80=E5=85=B3=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lightnovelreader/ui/components/SettingsEntry.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 32725f6..4db2cce 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 @@ -59,18 +59,22 @@ fun SettingsSwitchEntry( onCheckedChange: (Boolean) -> Unit, ) { FilledCard( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .fillMaxWidth(), shape = RoundedCornerShape(6.dp) ) { Row( modifier = Modifier .fillMaxWidth() + .clickable { onCheckedChange(!checked) } .padding(18.dp, 10.dp, 20.dp, 12.dp), - verticalAlignment = Alignment.CenterVertically) { - Column ( + verticalAlignment = Alignment.CenterVertically + ) { + Column( Modifier .weight(2f) - .padding(end = 4.dp)) { + .padding(end = 4.dp) + ) { Text( text = title, style = MaterialTheme.typography.titleLarge, From e242894b4711a439086fd0184af1f0aacc6d4902 Mon Sep 17 00:00:00 2001 From: yukonisen Date: Sat, 31 Aug 2024 14:13:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 49207f6..0866c1c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -20,7 +20,7 @@ android { minSdk = 24 targetSdk = 34 // 版本号为x.y.z则versionCode为x*1000000+y*10000+z*100+debug版本号(开发需要时迭代, 两位数) - versionCode = 4_04_010 + versionCode = 4_04_012 versionName = "0.4.4" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" From 00e95d4a9646314225e4426a5c90fa20d64083d9 Mon Sep 17 00:00:00 2001 From: yukonisen Date: Sat, 31 Aug 2024 15:06:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B9=A6=E6=9E=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E6=96=B0=E5=A2=9E=E7=82=B9=E5=87=BB=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bookshelf/edit/EditBookshelfScreen.kt | 37 +++++++++++++++---- .../main/res/drawable/delete_forever_24px.xml | 10 +++++ 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 app/src/main/res/drawable/delete_forever_24px.xml diff --git a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/bookshelf/edit/EditBookshelfScreen.kt b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/bookshelf/edit/EditBookshelfScreen.kt index e61a1aa..cb4f025 100644 --- a/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/bookshelf/edit/EditBookshelfScreen.kt +++ b/app/src/main/kotlin/indi/dmzz_yyhyy/lightnovelreader/ui/home/bookshelf/edit/EditBookshelfScreen.kt @@ -3,9 +3,12 @@ package indi.dmzz_yyhyy.lightnovelreader.ui.home.bookshelf.edit import androidx.compose.foundation.clickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.collectIsFocusedAsState +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding @@ -79,7 +82,9 @@ fun EditBookshelfScreen( } Column { OutlinedTextField( - modifier = Modifier.fillMaxWidth().padding(20.dp), + modifier = Modifier + .fillMaxWidth() + .padding(20.dp), value = bookshelf.name, onValueChange = onNameChange, label = { Text("名称") }, @@ -110,14 +115,16 @@ fun EditBookshelfScreen( color = MaterialTheme.colorScheme.onSurfaceVariant ) SwitchSettingItem( + iconRes = R.drawable.cloud_download_24px, title = "自动缓存", description = "自动缓存新加入的书本完整内容", value = bookshelf.autoCache, onValueChange = onAutoCacheChange ) SwitchSettingItem( + iconRes = R.drawable.outline_schedule_24px, title = "更新通知提醒", - description = "如果书本有更新,通过系统通知提示我(限后台时)", + description = "在后台时,检查并通知书本更新", value = bookshelf.systemUpdateReminder, onValueChange = onSystemUpdateReminderChange ) @@ -125,8 +132,15 @@ fun EditBookshelfScreen( modifier = Modifier.clickable { dialogVisible = true }, - headlineContent = { Text(text = "删除此书架", style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.W500, fontSize = 16.sp) }, - supportingContent = { Text(text = "将此书架永久移除", style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.W500, fontSize = 12.sp, lineHeight = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) }, + leadingContent = { + Icon( + modifier = Modifier.padding(horizontal = 10.dp), + painter = painterResource(R.drawable.delete_forever_24px), + contentDescription = "Localized description", + ) + }, + headlineContent = { Text(text = "删除此书架", fontSize = 16.sp, modifier = Modifier.padding(bottom = 2.dp)) }, + supportingContent = { Text(text = "将此书架永久移除", fontSize = 14.sp, lineHeight = 15.sp) }, ) } } @@ -175,20 +189,29 @@ private fun TopBar( @Composable fun SwitchSettingItem( + iconRes: Int, title: String, description: String, value: Boolean, onValueChange: (Boolean) -> Unit, ) { ListItem( - headlineContent = { Text(text = title, style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.W500, fontSize = 16.sp) }, - supportingContent = { Text(text = description, style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.W500, fontSize = 12.sp, lineHeight = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant) }, + modifier = Modifier.clickable {onValueChange(!value)}, + headlineContent = { Text(text = title, fontSize = 16.sp, modifier = Modifier.padding(bottom = 2.dp)) }, + supportingContent = { Text(text = description, fontSize = 14.sp, lineHeight = 15.sp) }, trailingContent = { Switch( checked = value, onCheckedChange = onValueChange ) - } + }, + leadingContent = { + Icon( + modifier = Modifier.padding(horizontal = 10.dp), + painter = painterResource(iconRes), + contentDescription = "Localized description", + ) + }, ) } diff --git a/app/src/main/res/drawable/delete_forever_24px.xml b/app/src/main/res/drawable/delete_forever_24px.xml new file mode 100644 index 0000000..fe7d308 --- /dev/null +++ b/app/src/main/res/drawable/delete_forever_24px.xml @@ -0,0 +1,10 @@ + + +