|
@@ -3,20 +3,18 @@ package io.legado.app.ui.about
|
|
|
import android.content.res.Configuration
|
|
import android.content.res.Configuration
|
|
|
import androidx.compose.foundation.Image
|
|
import androidx.compose.foundation.Image
|
|
|
import androidx.compose.foundation.background
|
|
import androidx.compose.foundation.background
|
|
|
-import androidx.compose.foundation.horizontalScroll
|
|
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
import androidx.compose.foundation.layout.Column
|
|
import androidx.compose.foundation.layout.Column
|
|
|
import androidx.compose.foundation.layout.Row
|
|
import androidx.compose.foundation.layout.Row
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
import androidx.compose.foundation.layout.height
|
|
|
import androidx.compose.foundation.layout.padding
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
|
+import androidx.compose.foundation.layout.width
|
|
|
import androidx.compose.foundation.layout.wrapContentWidth
|
|
import androidx.compose.foundation.layout.wrapContentWidth
|
|
|
import androidx.compose.foundation.rememberScrollState
|
|
import androidx.compose.foundation.rememberScrollState
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
import androidx.compose.material.icons.Icons
|
|
import androidx.compose.material.icons.Icons
|
|
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
|
|
-import androidx.compose.material3.ButtonGroup
|
|
|
|
|
-import androidx.compose.material3.ButtonGroupDefaults
|
|
|
|
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|
|
import androidx.compose.material3.FilledTonalIconButton
|
|
import androidx.compose.material3.FilledTonalIconButton
|
|
@@ -26,7 +24,6 @@ import androidx.compose.material3.MaterialTheme
|
|
|
import androidx.compose.material3.MaterialTheme.colorScheme
|
|
import androidx.compose.material3.MaterialTheme.colorScheme
|
|
|
import androidx.compose.material3.Scaffold
|
|
import androidx.compose.material3.Scaffold
|
|
|
import androidx.compose.material3.Text
|
|
import androidx.compose.material3.Text
|
|
|
-import androidx.compose.material3.TextButton
|
|
|
|
|
import androidx.compose.material3.TopAppBar
|
|
import androidx.compose.material3.TopAppBar
|
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Alignment
|
|
import androidx.compose.ui.Alignment
|
|
@@ -35,8 +32,10 @@ import androidx.compose.ui.layout.ContentScale
|
|
|
import androidx.compose.ui.platform.LocalContext
|
|
import androidx.compose.ui.platform.LocalContext
|
|
|
import androidx.compose.ui.res.painterResource
|
|
import androidx.compose.ui.res.painterResource
|
|
|
import androidx.compose.ui.res.stringResource
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
|
+import androidx.compose.ui.text.font.FontWeight
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
import androidx.compose.ui.unit.dp
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
|
+import androidx.compose.ui.unit.sp
|
|
|
import io.legado.app.R
|
|
import io.legado.app.R
|
|
|
import io.legado.app.base.AppTheme
|
|
import io.legado.app.base.AppTheme
|
|
|
import io.legado.app.constant.AppConst.appInfo
|
|
import io.legado.app.constant.AppConst.appInfo
|
|
@@ -61,61 +60,6 @@ fun PreviewAboutScreen() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
|
|
|
|
-@Composable
|
|
|
|
|
-fun ButtonGroup(
|
|
|
|
|
- onOpenUrl: (String) -> Unit,
|
|
|
|
|
- onCheckUpdate: () -> Unit
|
|
|
|
|
-) {
|
|
|
|
|
-
|
|
|
|
|
- ButtonGroup(
|
|
|
|
|
- modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
- overflowIndicator = { menuState ->
|
|
|
|
|
- ButtonGroupDefaults.OverflowIndicator(menuState = menuState)
|
|
|
|
|
- },
|
|
|
|
|
- verticalAlignment = Alignment.CenterVertically
|
|
|
|
|
- ) {
|
|
|
|
|
- clickableItem(
|
|
|
|
|
- onClick = { onOpenUrl("https://example.com") },
|
|
|
|
|
- weight = 1f,
|
|
|
|
|
- icon = {
|
|
|
|
|
- Icon(
|
|
|
|
|
- painter = painterResource(R.drawable.ic_web_outline),
|
|
|
|
|
- contentDescription = stringResource(R.string.back),
|
|
|
|
|
- tint = colorScheme.onSurface
|
|
|
|
|
- )
|
|
|
|
|
- },
|
|
|
|
|
- label = ""
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- clickableItem(
|
|
|
|
|
- onClick = { onOpenUrl("https://github.com/HapeLee/legado-with-MD3") },
|
|
|
|
|
- weight = 1f,
|
|
|
|
|
- icon = {
|
|
|
|
|
- Icon(
|
|
|
|
|
- painter = painterResource(R.drawable.ic_github),
|
|
|
|
|
- contentDescription = stringResource(R.string.back),
|
|
|
|
|
- tint = colorScheme.onSurface
|
|
|
|
|
- )
|
|
|
|
|
- },
|
|
|
|
|
- label = ""
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- clickableItem(
|
|
|
|
|
- onClick = { onCheckUpdate() },
|
|
|
|
|
- weight = 1f,
|
|
|
|
|
- icon = {
|
|
|
|
|
- Icon(
|
|
|
|
|
- painter = painterResource(R.drawable.ic_import),
|
|
|
|
|
- contentDescription = stringResource(R.string.back),
|
|
|
|
|
- tint = colorScheme.onSurface
|
|
|
|
|
- )
|
|
|
|
|
- },
|
|
|
|
|
- label = ""
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
|
|
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
|
|
|
@Composable
|
|
@Composable
|
|
|
fun AboutScreen(
|
|
fun AboutScreen(
|
|
@@ -148,19 +92,23 @@ fun AboutScreen(
|
|
|
Column(
|
|
Column(
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
.padding(padding)
|
|
.padding(padding)
|
|
|
- .padding(16.dp)
|
|
|
|
|
|
|
+ .padding(horizontal = 16.dp)
|
|
|
.verticalScroll(rememberScrollState())
|
|
.verticalScroll(rememberScrollState())
|
|
|
) {
|
|
) {
|
|
|
Image(
|
|
Image(
|
|
|
painter = painterResource(R.drawable.ic_launcher_foreground),
|
|
painter = painterResource(R.drawable.ic_launcher_foreground),
|
|
|
- contentDescription = "",
|
|
|
|
|
|
|
+ contentDescription = null,
|
|
|
contentScale = ContentScale.Crop,
|
|
contentScale = ContentScale.Crop,
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
- .fillMaxWidth()
|
|
|
|
|
- .wrapContentWidth(Alignment.CenterHorizontally)
|
|
|
|
|
|
|
+ .height(120.dp)
|
|
|
|
|
+ .width(160.dp)
|
|
|
|
|
+ .align(Alignment.CenterHorizontally)
|
|
|
)
|
|
)
|
|
|
Text(
|
|
Text(
|
|
|
- text = stringResource(R.string.app_name), style = MaterialTheme.typography.bodyLarge,
|
|
|
|
|
|
|
+ text = stringResource(R.string.app_name),
|
|
|
|
|
+ style = MaterialTheme.typography.bodyLarge,
|
|
|
|
|
+ fontSize = 18.sp,
|
|
|
|
|
+ fontWeight = FontWeight.Bold,
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
|
.wrapContentWidth(Alignment.CenterHorizontally))
|
|
.wrapContentWidth(Alignment.CenterHorizontally))
|
|
@@ -172,12 +120,15 @@ fun AboutScreen(
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
|
.wrapContentWidth(Alignment.CenterHorizontally)
|
|
.wrapContentWidth(Alignment.CenterHorizontally)
|
|
|
- )
|
|
|
|
|
|
|
+ .padding(vertical = 4.dp))
|
|
|
Text(
|
|
Text(
|
|
|
- text = stringResource(R.string.about_description), style = MaterialTheme.typography.bodyLarge,
|
|
|
|
|
|
|
+ text = stringResource(R.string.about_description),
|
|
|
|
|
+ style = MaterialTheme.typography.bodyLarge,
|
|
|
|
|
+ fontSize = 12.sp,
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
|
- .wrapContentWidth(Alignment.CenterHorizontally))
|
|
|
|
|
|
|
+ .wrapContentWidth(Alignment.CenterHorizontally)
|
|
|
|
|
+ .padding(bottom = 4.dp))
|
|
|
Row (modifier = Modifier
|
|
Row (modifier = Modifier
|
|
|
.fillMaxWidth(),
|
|
.fillMaxWidth(),
|
|
|
horizontalArrangement = Arrangement.Center){
|
|
horizontalArrangement = Arrangement.Center){
|
|
@@ -204,51 +155,58 @@ fun AboutScreen(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SplicedColumnGroup(
|
|
SplicedColumnGroup(
|
|
|
- title = stringResource(R.string.about),
|
|
|
|
|
|
|
+ title = "",
|
|
|
content = listOf(
|
|
content = listOf(
|
|
|
{
|
|
{
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
modifier = Modifier.background(colorScheme.surfaceBright),
|
|
modifier = Modifier.background(colorScheme.surfaceBright),
|
|
|
title = stringResource(R.string.contributors),
|
|
title = stringResource(R.string.contributors),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = {
|
|
onClick = {
|
|
|
onOpenUrl("https://github.com/gedoor/legado/graphs/contributors")
|
|
onOpenUrl("https://github.com/gedoor/legado/graphs/contributors")
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
title = stringResource(R.string.privacy_policy),
|
|
title = stringResource(R.string.privacy_policy),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = {
|
|
onClick = {
|
|
|
onShowMdFile("隐私政策", "privacyPolicy.md")
|
|
onShowMdFile("隐私政策", "privacyPolicy.md")
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
title = stringResource(R.string.license),
|
|
title = stringResource(R.string.license),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = {
|
|
onClick = {
|
|
|
onShowMdFile("许可证", "LICENSE.md")
|
|
onShowMdFile("许可证", "LICENSE.md")
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
title = stringResource(R.string.disclaimer),
|
|
title = stringResource(R.string.disclaimer),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = {
|
|
onClick = {
|
|
|
onShowMdFile("免责声明", "disclaimer.md")
|
|
onShowMdFile("免责声明", "disclaimer.md")
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
title = stringResource(R.string.crash_log),
|
|
title = stringResource(R.string.crash_log),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = onShowCrashLogs
|
|
onClick = onShowCrashLogs
|
|
|
)
|
|
)
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
title = stringResource(R.string.save_log),
|
|
title = stringResource(R.string.save_log),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = onSaveLog
|
|
onClick = onSaveLog
|
|
|
)
|
|
)
|
|
|
SettingItem(
|
|
SettingItem(
|
|
|
title = stringResource(R.string.create_heap_dump),
|
|
title = stringResource(R.string.create_heap_dump),
|
|
|
- description = "",
|
|
|
|
|
|
|
+ description = null,
|
|
|
|
|
+ option = null,
|
|
|
onClick = onCreateHeapDump
|
|
onClick = onCreateHeapDump
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|