|
|
@@ -1,6 +1,5 @@
|
|
|
package io.legado.app.ui.about
|
|
|
|
|
|
-import android.content.res.Configuration
|
|
|
import androidx.compose.foundation.Image
|
|
|
import androidx.compose.foundation.background
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
@@ -25,7 +24,6 @@ import androidx.compose.material3.MaterialTheme.colorScheme
|
|
|
import androidx.compose.material3.MediumTopAppBar
|
|
|
import androidx.compose.material3.Scaffold
|
|
|
import androidx.compose.material3.Text
|
|
|
-import androidx.compose.material3.TopAppBar
|
|
|
import androidx.compose.material3.TopAppBarDefaults
|
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Alignment
|
|
|
@@ -36,11 +34,9 @@ import androidx.compose.ui.platform.LocalContext
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
import androidx.compose.ui.text.font.FontWeight
|
|
|
-import androidx.compose.ui.tooling.preview.Preview
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
import io.legado.app.R
|
|
|
-import io.legado.app.base.AppTheme
|
|
|
import io.legado.app.constant.AppConst.appInfo
|
|
|
import io.legado.app.ui.widget.components.SettingItem
|
|
|
import io.legado.app.ui.widget.components.SplicedColumnGroup
|
|
|
@@ -50,7 +46,7 @@ import io.legado.app.ui.widget.components.TextCard
|
|
|
@Composable
|
|
|
fun AboutScreen(
|
|
|
versionName: String = appInfo.versionName,
|
|
|
- onNavigateBack: () -> Unit = {},
|
|
|
+ onBack: () -> Unit = {},
|
|
|
onCheckUpdate: () -> Unit = {},
|
|
|
onOpenUrl: (String) -> Unit = {},
|
|
|
onShowMdFile: (String, String) -> Unit = { _, _ -> },
|
|
|
@@ -68,7 +64,7 @@ fun AboutScreen(
|
|
|
MediumTopAppBar(
|
|
|
title = { Text(stringResource(R.string.about)) },
|
|
|
navigationIcon = {
|
|
|
- IconButton(onClick = onNavigateBack) {
|
|
|
+ IconButton(onClick = onBack) {
|
|
|
Icon(
|
|
|
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
|
|
contentDescription = stringResource(R.string.back)
|
|
|
@@ -82,7 +78,6 @@ fun AboutScreen(
|
|
|
Column(
|
|
|
modifier = Modifier
|
|
|
.padding(padding)
|
|
|
- .padding(horizontal = 16.dp)
|
|
|
.verticalScroll(rememberScrollState())
|
|
|
) {
|
|
|
Image(
|
|
|
@@ -145,63 +140,60 @@ fun AboutScreen(
|
|
|
}
|
|
|
|
|
|
SplicedColumnGroup(
|
|
|
- title = "",
|
|
|
- content = listOf(
|
|
|
- {
|
|
|
- SettingItem(
|
|
|
- modifier = Modifier.background(colorScheme.surfaceBright),
|
|
|
- title = stringResource(R.string.contributors),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = {
|
|
|
- onOpenUrl("https://github.com/gedoor/legado/graphs/contributors")
|
|
|
- }
|
|
|
- )
|
|
|
- SettingItem(
|
|
|
- title = stringResource(R.string.privacy_policy),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = {
|
|
|
- onShowMdFile("隐私政策", "privacyPolicy.md")
|
|
|
- }
|
|
|
- )
|
|
|
- SettingItem(
|
|
|
- title = stringResource(R.string.license),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = {
|
|
|
- onShowMdFile("许可证", "LICENSE.md")
|
|
|
- }
|
|
|
- )
|
|
|
- SettingItem(
|
|
|
- title = stringResource(R.string.disclaimer),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = {
|
|
|
- onShowMdFile("免责声明", "disclaimer.md")
|
|
|
- }
|
|
|
- )
|
|
|
- SettingItem(
|
|
|
- title = stringResource(R.string.crash_log),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = onShowCrashLogs
|
|
|
- )
|
|
|
- SettingItem(
|
|
|
- title = stringResource(R.string.save_log),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = onSaveLog
|
|
|
- )
|
|
|
- SettingItem(
|
|
|
- title = stringResource(R.string.create_heap_dump),
|
|
|
- description = null,
|
|
|
- option = null,
|
|
|
- onClick = onCreateHeapDump
|
|
|
- )
|
|
|
+ modifier = Modifier.padding(horizontal = 16.dp),
|
|
|
+ title = ""
|
|
|
+ ){
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.contributors),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = {
|
|
|
+ onOpenUrl("https://github.com/gedoor/legado/graphs/contributors")
|
|
|
}
|
|
|
)
|
|
|
- )
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.privacy_policy),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = {
|
|
|
+ onShowMdFile("隐私政策", "privacyPolicy.md")
|
|
|
+ }
|
|
|
+ )
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.license),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = {
|
|
|
+ onShowMdFile("许可证", "LICENSE.md")
|
|
|
+ }
|
|
|
+ )
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.disclaimer),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = {
|
|
|
+ onShowMdFile("免责声明", "disclaimer.md")
|
|
|
+ }
|
|
|
+ )
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.crash_log),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = onShowCrashLogs
|
|
|
+ )
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.save_log),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = onSaveLog
|
|
|
+ )
|
|
|
+ SettingItem(
|
|
|
+ title = stringResource(R.string.create_heap_dump),
|
|
|
+ description = null,
|
|
|
+ option = null,
|
|
|
+ onClick = onCreateHeapDump
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|