一些界面优化
This commit is contained in:
@@ -398,12 +398,18 @@ private fun BookInfoTransparentTopAppBar(
|
||||
TopBarNavigationButton(onClick = onBackPressed)
|
||||
},
|
||||
actions = {
|
||||
BookInfoTopBarActions(
|
||||
state = state,
|
||||
showMenu = showMenu,
|
||||
onShowMenuChange = onShowMenuChange,
|
||||
onMenuAction = onMenuAction,
|
||||
)
|
||||
Box(modifier = Modifier.padding(end = 12.dp)) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
BookInfoTopBarActions(
|
||||
state = state,
|
||||
showMenu = showMenu,
|
||||
onShowMenuChange = onShowMenuChange,
|
||||
onMenuAction = onMenuAction,
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
scrollBehavior = (scrollBehavior as? M3GlassScrollBehavior)?.m3Behavior,
|
||||
colors = topBarColors,
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.compose.animation.core.FastOutSlowInEasing
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -187,6 +188,7 @@ private fun BookshelfManageScreen(
|
||||
var deleteOriginalBookFile by remember { mutableStateOf(state.deleteBookOriginal) }
|
||||
val exportBookPathKey = remember { "exportBookPath" }
|
||||
val exportTypes = remember { arrayListOf("txt", "epub") }
|
||||
val commonCharsets = remember { listOf("UTF-8", "GBK", "GB2312", "GB18030", "Big5", "UTF-16") }
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val exportFolderText = stringResource(R.string.export_folder)
|
||||
val exportAllText = stringResource(R.string.export_all)
|
||||
@@ -496,6 +498,7 @@ private fun BookshelfManageScreen(
|
||||
}
|
||||
},
|
||||
dropDownMenuContent = { dismiss ->
|
||||
var showCharsetMenu by remember { mutableStateOf(false) }
|
||||
RoundDropdownMenuItem(
|
||||
text = stringResource(R.string.download_all),
|
||||
onClick = {
|
||||
@@ -531,14 +534,37 @@ private fun BookshelfManageScreen(
|
||||
showExportTypeDialog = true
|
||||
}
|
||||
)
|
||||
RoundDropdownMenuItem(
|
||||
text = "${stringResource(R.string.export_charset)} (${state.exportConfig.exportCharset})",
|
||||
onClick = {
|
||||
dismiss()
|
||||
exportCharsetInput = state.exportConfig.exportCharset
|
||||
showCharsetDialog = true
|
||||
Box {
|
||||
RoundDropdownMenuItem(
|
||||
text = "${stringResource(R.string.export_charset)} (${state.exportConfig.exportCharset})",
|
||||
onClick = { showCharsetMenu = true }
|
||||
)
|
||||
RoundDropdownMenu(
|
||||
expanded = showCharsetMenu,
|
||||
onDismissRequest = { showCharsetMenu = false }
|
||||
) { subDismiss ->
|
||||
commonCharsets.forEach { charset ->
|
||||
RoundDropdownMenuItem(
|
||||
text = charset,
|
||||
isSelected = state.exportConfig.exportCharset == charset,
|
||||
onClick = {
|
||||
viewModel.dispatch(BookshelfManageScreenIntent.SetExportCharset(charset))
|
||||
subDismiss()
|
||||
dismiss()
|
||||
}
|
||||
)
|
||||
}
|
||||
PillDivider()
|
||||
RoundDropdownMenuItem(
|
||||
text = "自定义...",
|
||||
onClick = {
|
||||
subDismiss()
|
||||
exportCharsetInput = state.exportConfig.exportCharset
|
||||
showCharsetDialog = true
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
PillDivider()
|
||||
RoundDropdownMenuItem(
|
||||
text = "替换净化",
|
||||
|
||||
@@ -70,6 +70,7 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.semantics.role
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.constraintlayout.compose.ConstraintLayout
|
||||
@@ -832,7 +833,9 @@ fun ThemeConfigScreen(
|
||||
}
|
||||
}
|
||||
},
|
||||
modifier = Modifier.fillMaxSize()
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(12.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -889,7 +892,11 @@ fun ThemeModeSelector(
|
||||
|
||||
Spacer(Modifier.size(ToggleButtonDefaults.IconSpacing))
|
||||
|
||||
Text(text = label)
|
||||
Text(
|
||||
text = label,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ import io.legado.app.ui.main.homepage.modules.RankingModule
|
||||
import io.legado.app.ui.main.homepage.modules.WaterfallItem
|
||||
import io.legado.app.ui.config.themeConfig.ThemeConfig
|
||||
import io.legado.app.ui.theme.LegadoTheme
|
||||
import io.legado.app.ui.theme.adaptiveContentPadding
|
||||
import io.legado.app.ui.theme.adaptiveContentPaddingBookshelf
|
||||
import io.legado.app.ui.widget.components.AppPullToRefresh
|
||||
import io.legado.app.ui.widget.components.AppScaffold
|
||||
@@ -386,10 +387,9 @@ private fun ModuleList(
|
||||
modifier = modifier,
|
||||
verticalItemSpacing = 16.dp,
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
contentPadding = adaptiveContentPaddingBookshelf(
|
||||
contentPadding = adaptiveContentPadding(
|
||||
top = paddingValues.calculateTopPadding(),
|
||||
bottom = if (ThemeConfig.useFloatingBottomBar || ThemeConfig.enableBlur) 120.dp else 8.dp,
|
||||
horizontal = 4.dp
|
||||
bottom = if (ThemeConfig.useFloatingBottomBar || ThemeConfig.enableBlur) 120.dp else 8.dp
|
||||
),
|
||||
) {
|
||||
processedModules.forEach { moduleUi ->
|
||||
|
||||
@@ -333,11 +333,11 @@ fun RssSourceGridItem(
|
||||
leadingIcon = {
|
||||
MenuItemIcon(
|
||||
Icons.Default.Delete,
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
tint = LegadoTheme.colorScheme.error
|
||||
)
|
||||
},
|
||||
text = stringResource(R.string.delete),
|
||||
color = MaterialTheme.colorScheme.error,
|
||||
color = LegadoTheme.colorScheme.error,
|
||||
onClick = {
|
||||
onDelete()
|
||||
showMenu = false
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ fun RoundDropdownMenuItem(
|
||||
}
|
||||
} else {
|
||||
val colorScheme = rememberOpaqueColorScheme()
|
||||
val selectedContentColor = colorScheme.onPrimaryContainer
|
||||
val selectedContentColor = colorScheme.primary
|
||||
val defaultContentColor = colorScheme.onSurface
|
||||
val contentColor = if (enabled) {
|
||||
when {
|
||||
|
||||
Reference in New Issue
Block a user