界面优化
This commit is contained in:
@@ -1,28 +1,31 @@
|
||||
package io.legado.app.ui.about
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.selection.SelectionContainer
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import io.legado.app.R
|
||||
import io.legado.app.ui.theme.LegadoTheme
|
||||
import io.legado.app.ui.widget.components.AppScaffold
|
||||
import io.legado.app.ui.widget.components.button.ConfirmDismissButtonsRow
|
||||
import io.legado.app.ui.widget.components.icon.AppIcons
|
||||
import io.legado.app.ui.widget.components.text.AppText
|
||||
import io.legado.app.ui.widget.components.topbar.GlassMediumFlexibleTopAppBar
|
||||
@@ -62,44 +65,51 @@ fun CrashReportScreen(
|
||||
.fillMaxSize()
|
||||
.padding(padding)
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
|
||||
Icon(
|
||||
imageVector = AppIcons.BugReport,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = LegadoTheme.colorScheme.error
|
||||
)
|
||||
AppText(
|
||||
text = stringResource(R.string.crash_report_message),
|
||||
style = LegadoTheme.typography.bodyMedium
|
||||
style = LegadoTheme.typography.titleMedium
|
||||
)
|
||||
|
||||
|
||||
SelectionContainer(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.fillMaxWidth()
|
||||
.background(
|
||||
color = LegadoTheme.colorScheme.surfaceContainerLow,
|
||||
shape = RoundedCornerShape(12.dp)
|
||||
)
|
||||
.padding(12.dp)
|
||||
.verticalScroll(rememberScrollState())
|
||||
.horizontalScroll(rememberScrollState())
|
||||
) {
|
||||
AppText(
|
||||
text = displayText,
|
||||
style = LegadoTheme.typography.bodySmall,
|
||||
fontFamily = FontFamily.Monospace
|
||||
style = LegadoTheme.typography.bodySmall.copy(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
letterSpacing = 0.sp,
|
||||
lineHeight = 16.sp
|
||||
),
|
||||
softWrap = false
|
||||
)
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||
) {
|
||||
OutlinedButton(
|
||||
onClick = onRestart,
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(text = stringResource(R.string.restart_app))
|
||||
}
|
||||
Button(
|
||||
onClick = onCopy,
|
||||
enabled = errorText.isNotBlank(),
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(text = stringResource(R.string.copy_text))
|
||||
}
|
||||
}
|
||||
ConfirmDismissButtonsRow(
|
||||
onDismiss = onRestart,
|
||||
onConfirm = onCopy,
|
||||
dismissText = stringResource(R.string.restart_app),
|
||||
confirmText = stringResource(R.string.copy_text),
|
||||
confirmEnabled = errorText.isNotBlank()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user