Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

探索页面整体UI优化 #138

Merged
merged 4 commits into from
Dec 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
设置项新增图标
yukonisen committed Dec 25, 2024
commit 82aca60c6699760dfdc146477452d813079a311f
Original file line number Diff line number Diff line change
@@ -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"
)
}
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)),
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -15,19 +15,22 @@ 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,
selectedOptionKey = settingState.updateChannelKey,
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() }
Original file line number Diff line number Diff line change
@@ -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 }
Original file line number Diff line number Diff line change
@@ -14,20 +14,23 @@ 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,
selectedOptionKey = settingState.darkModeKey,
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,
booleanUserData = settingState.dynamicColorsKeyUserData,
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,
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/alt_route_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M440,880L440,680Q440,624 423,597Q406,570 378,544L435,487Q447,498 458,510.5Q469,523 480,537Q494,518 508.5,503.5Q523,489 538,475Q576,440 607,394Q638,348 640,233L577,296L520,240L680,80L840,240L784,296L720,233Q718,376 676,436.5Q634,497 592,535Q560,564 540,591.5Q520,619 520,680L520,880L440,880ZM248,327Q244,307 242.5,283Q241,259 240,233L176,296L120,240L280,80L440,240L383,296L320,234Q320,255 322,273.5Q324,292 326,308L248,327ZM334,503Q314,482 295.5,454Q277,426 263,385L340,366Q350,393 363,412Q376,431 391,446L334,503Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/archive_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,720L640,560L584,504L520,568L520,400L440,400L440,568L376,504L320,560L480,720ZM200,320L200,760Q200,760 200,760Q200,760 200,760L760,760Q760,760 760,760Q760,760 760,760L760,320L200,320ZM200,840Q167,840 143.5,816.5Q120,793 120,760L120,261Q120,247 124.5,234Q129,221 138,210L188,149Q199,135 215.5,127.5Q232,120 250,120L710,120Q728,120 744.5,127.5Q761,135 772,149L822,210Q831,221 835.5,234Q840,247 840,261L840,760Q840,793 816.5,816.5Q793,840 760,840L200,840ZM216,240L744,240L710,200Q710,200 710,200Q710,200 710,200L250,200Q250,200 250,200Q250,200 250,200L216,240ZM480,540L480,540L480,540Q480,540 480,540Q480,540 480,540L480,540Q480,540 480,540Q480,540 480,540Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/dark_mode_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,840Q330,840 225,735Q120,630 120,480Q120,330 225,225Q330,120 480,120Q494,120 507.5,121Q521,122 534,124Q493,153 468.5,199.5Q444,246 444,300Q444,390 507,453Q570,516 660,516Q715,516 761,491.5Q807,467 836,426Q838,439 839,452.5Q840,466 840,480Q840,630 735,735Q630,840 480,840ZM480,760Q568,760 638,711.5Q708,663 740,585Q720,590 700,593Q680,596 660,596Q537,596 450.5,509.5Q364,423 364,300Q364,280 367,260Q370,240 375,220Q297,252 248.5,322Q200,392 200,480Q200,596 282,678Q364,760 480,760ZM470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Q470,490 470,490Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/deployed_code_update_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M720,880L840,760L812,732L740,804L740,640L700,640L700,804L628,732L600,760L720,880ZM480,160L243,297L480,434L717,297L480,160Q480,160 480,160Q480,160 480,160ZM120,639L120,321Q120,299 130.5,281Q141,263 160,252L440,91Q450,86 459.5,83Q469,80 480,80Q491,80 501,83Q511,86 520,91L800,252Q819,263 829.5,281Q840,299 840,321L840,480Q822,480 800,480Q778,480 760,480L760,364L479,526L200,364L200,638Q200,638 200,638Q200,638 200,638L440,777Q440,798 440,823Q440,848 440,869Q440,869 440,869Q440,869 440,869L160,708Q141,697 130.5,679Q120,661 120,639ZM720,960Q637,960 578.5,901.5Q520,843 520,760Q520,677 578.5,618.5Q637,560 720,560Q803,560 861.5,618.5Q920,677 920,760Q920,843 861.5,901.5Q803,960 720,960ZM480,469Q480,469 480,469Q480,469 480,469Q480,469 480,469Q480,469 480,469Q480,469 480,469Q480,469 480,469L480,469Q480,469 480,469Q480,469 480,469L480,469Q480,469 480,469Q480,469 480,469L480,469Q480,469 480,469Q480,469 480,469L480,469Q480,469 480,469Q480,469 480,469Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/format_color_fill_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M247,56L304,0L647,343Q670,366 670,400Q670,434 647,457L457,647Q434,670 400,670Q366,670 343,647L153,457Q130,434 130,400Q130,366 153,343L343,152L247,56ZM400,209L209,400Q209,400 209,400Q209,400 209,400L591,400Q591,400 591,400Q591,400 591,400L400,209ZM760,680Q727,680 703.5,656.5Q680,633 680,600Q680,579 692.5,555Q705,531 720,510Q729,498 739,485Q749,472 760,460Q771,472 781,485Q791,498 800,510Q815,531 827.5,555Q840,579 840,600Q840,633 816.5,656.5Q793,680 760,680ZM80,960L80,800L880,800L880,960L80,960Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/group_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M40,800L40,688Q40,654 57.5,625.5Q75,597 104,582Q166,551 230,535.5Q294,520 360,520Q426,520 490,535.5Q554,551 616,582Q645,597 662.5,625.5Q680,654 680,688L680,800L40,800ZM760,800L760,680Q760,636 735.5,595.5Q711,555 666,526Q717,532 762,546.5Q807,561 846,582Q882,602 901,626.5Q920,651 920,680L920,800L760,800ZM360,480Q294,480 247,433Q200,386 200,320Q200,254 247,207Q294,160 360,160Q426,160 473,207Q520,254 520,320Q520,386 473,433Q426,480 360,480ZM760,320Q760,386 713,433Q666,480 600,480Q589,480 572,477.5Q555,475 544,472Q571,440 585.5,401Q600,362 600,320Q600,278 585.5,239Q571,200 544,168Q558,163 572,161.5Q586,160 600,160Q666,160 713,207Q760,254 760,320ZM120,720L600,720L600,688Q600,677 594.5,668Q589,659 580,654Q526,627 471,613.5Q416,600 360,600Q304,600 249,613.5Q194,627 140,654Q131,659 125.5,668Q120,677 120,688L120,720ZM360,400Q393,400 416.5,376.5Q440,353 440,320Q440,287 416.5,263.5Q393,240 360,240Q327,240 303.5,263.5Q280,287 280,320Q280,353 303.5,376.5Q327,400 360,400ZM360,720L360,720L360,720Q360,720 360,720Q360,720 360,720Q360,720 360,720Q360,720 360,720Q360,720 360,720Q360,720 360,720Q360,720 360,720Q360,720 360,720ZM360,320Q360,320 360,320Q360,320 360,320Q360,320 360,320Q360,320 360,320Q360,320 360,320Q360,320 360,320Q360,320 360,320Q360,320 360,320Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/handyman_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M754,879Q746,879 739,876.5Q732,874 726,868L522,664Q516,658 513.5,651Q511,644 511,636Q511,628 513.5,621Q516,614 522,608L607,523Q613,517 620,514.5Q627,512 635,512Q643,512 650,514.5Q657,517 663,523L867,727Q873,733 875.5,740Q878,747 878,755Q878,763 875.5,770Q873,777 867,783L782,868Q776,874 769,876.5Q762,879 754,879ZM754,784L783,755L636,608L607,637L754,784ZM205,880Q197,880 189.5,877Q182,874 176,868L92,784Q86,778 83,770.5Q80,763 80,755Q80,747 83,740Q86,733 92,727L304,515L389,515L423,481L258,316L201,316L80,195L193,82L314,203L314,260L479,425L595,309L552,266L608,210L495,210L467,182L609,40L637,68L637,181L693,125L835,267Q852,284 861,305.5Q870,327 870,351Q870,375 861,397Q852,419 835,436L750,351L694,407L652,365L445,572L445,656L233,868Q227,874 220,877Q213,880 205,880ZM205,784L375,614L375,585L346,585L176,755L205,784ZM205,784L176,755L176,755L191,769L205,784ZM754,784L754,784L783,755L783,755L754,784Z"/>
</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/input_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M160,800Q127,800 103.5,776.5Q80,753 80,720L80,600L160,600L160,720Q160,720 160,720Q160,720 160,720L800,720Q800,720 800,720Q800,720 800,720L800,240Q800,240 800,240Q800,240 800,240L160,240Q160,240 160,240Q160,240 160,240L160,360L80,360L80,240Q80,207 103.5,183.5Q127,160 160,160L800,160Q833,160 856.5,183.5Q880,207 880,240L880,720Q880,753 856.5,776.5Q833,800 800,800L160,800ZM460,660L404,602L487,520L80,520L80,440L487,440L404,358L460,300L640,480L460,660Z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/translate_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M476,880L658,400L742,400L924,880L840,880L797,758L603,758L560,880L476,880ZM160,760L104,704L306,502Q271,467 242.5,422Q214,377 190,320L274,320Q294,359 314,388Q334,417 362,446Q395,413 430.5,353.5Q466,294 484,240L40,240L40,160L320,160L320,80L400,80L400,160L680,160L680,240L564,240Q543,312 501,388Q459,464 418,504L514,602L484,684L362,559L160,760ZM628,688L772,688L700,484L628,688Z"/>
</vector>