fix(ui): redesign main screens for Myne-style
- CustomTopAppBar: centered title, surface color (no shadow), 64dp height. - HomeScreen: reduced top bar from 4+ icons to 2 (palette + overflow menu). - Settings moved into overflow menu (was separate icon). - Recent files limit moved into overflow menu (was separate icon). - Card elevation reduced (6/2dp → 4/1dp) for flatter Myne look. - surfaceContainerHigh → surfaceContainerLow for softer card background. - LibraryScreen cards: same elevation/background treatment. - ':app:assembleOssDebug' passes, APK updated on download page.
This commit is contained in:
parent
2556824538
commit
7411f1bfb5
3 changed files with 45 additions and 44 deletions
|
|
@ -855,10 +855,10 @@ fun RecentFileCard(
|
|||
.combinedClickable(onClick = onClick, onLongClick = onLongClick),
|
||||
shape = MaterialTheme.shapes.large,
|
||||
colors = androidx.compose.material3.CardDefaults.elevatedCardColors(
|
||||
containerColor = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||
),
|
||||
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
||||
defaultElevation = if (isSelected) 6.dp else 2.dp
|
||||
defaultElevation = if (isSelected) 4.dp else 1.dp
|
||||
)
|
||||
) {
|
||||
Column(modifier = Modifier.fillMaxWidth()) {
|
||||
|
|
@ -1109,7 +1109,6 @@ fun DefaultTopAppBar(
|
|||
var showLimitMenu by remember { mutableStateOf(false) }
|
||||
val context = LocalContext.current
|
||||
var hideReaderAiFeatures by remember { mutableStateOf(loadHideReaderAiFeatures(context)) }
|
||||
|
||||
CustomTopAppBar(title = { }, navigationIcon = {
|
||||
IconButton(onClick = onDrawerClick) {
|
||||
BadgedBox(
|
||||
|
|
@ -1122,38 +1121,9 @@ fun DefaultTopAppBar(
|
|||
}
|
||||
}
|
||||
}, actions = {
|
||||
IconButton(onClick = onSettingsClick) {
|
||||
Icon(Icons.Default.Settings, contentDescription = stringResource(R.string.settings))
|
||||
IconButton(onClick = onAppThemeClick) {
|
||||
Icon(painterResource(id = R.drawable.palette), contentDescription = stringResource(R.string.content_desc_app_theme))
|
||||
}
|
||||
Box {
|
||||
IconButton(onClick = onAppThemeClick) {
|
||||
Icon(painterResource(id = R.drawable.palette), contentDescription = stringResource(R.string.content_desc_app_theme))
|
||||
}
|
||||
}
|
||||
// Recent Files Limit Menu
|
||||
Box {
|
||||
IconButton(onClick = { showLimitMenu = true }) {
|
||||
Icon(Icons.Default.FormatListNumbered, contentDescription = stringResource(R.string.options_recent_limit))
|
||||
}
|
||||
DropdownMenu(
|
||||
expanded = showLimitMenu, onDismissRequest = { showLimitMenu = false }
|
||||
) {
|
||||
val limitOptions = listOf(0, 10, 20, 50, 100)
|
||||
limitOptions.forEach { limit ->
|
||||
DropdownMenuItem(
|
||||
text = { Text(if (limit == 0) stringResource(R.string.options_no_limit) else stringResource(R.string.options_files_limit, limit)) },
|
||||
onClick = {
|
||||
onRecentFilesLimitChange(limit)
|
||||
showLimitMenu = false
|
||||
},
|
||||
trailingIcon = if (uiState.recentFilesLimit == limit) {
|
||||
{ Icon(Icons.Default.Check, contentDescription = stringResource(R.string.content_desc_selected)) }
|
||||
} else null
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Options Menu (MoreVert)
|
||||
Box {
|
||||
IconButton(onClick = { showOptionsMenu = true }) {
|
||||
|
|
@ -1161,13 +1131,23 @@ fun DefaultTopAppBar(
|
|||
}
|
||||
DropdownMenu(
|
||||
expanded = showOptionsMenu, onDismissRequest = { showOptionsMenu = false }) {
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.about_title)) }, onClick = {
|
||||
onAboutClick()
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.settings)) }, onClick = {
|
||||
onSettingsClick()
|
||||
showOptionsMenu = false
|
||||
})
|
||||
|
||||
DropdownMenuItem(text = { Text(stringResource(if (uiState.recentFilesLimit == 0) R.string.options_no_limit else R.string.options_files_limit, uiState.recentFilesLimit)) }, onClick = {
|
||||
showLimitMenu = true
|
||||
showOptionsMenu = false
|
||||
})
|
||||
|
||||
HorizontalDivider()
|
||||
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.about_title)) }, onClick = {
|
||||
onAboutClick()
|
||||
showOptionsMenu = false
|
||||
})
|
||||
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.options_enable_multi_tab_reading)) }, onClick = {
|
||||
onTabsToggle(!uiState.isTabsEnabled)
|
||||
showOptionsMenu = false
|
||||
|
|
@ -1241,6 +1221,7 @@ fun DefaultTopAppBar(
|
|||
onClearCache()
|
||||
showOptionsMenu = false
|
||||
})
|
||||
|
||||
DropdownMenuItem(text = { Text(stringResource(R.string.options_clear_reflow_cache)) }, onClick = {
|
||||
onClearReflowCache()
|
||||
showOptionsMenu = false
|
||||
|
|
@ -1278,6 +1259,27 @@ fun DefaultTopAppBar(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Recent Files Limit Submenu
|
||||
if (showLimitMenu) {
|
||||
DropdownMenu(
|
||||
expanded = showLimitMenu, onDismissRequest = { showLimitMenu = false }
|
||||
) {
|
||||
val limitOptions = listOf(0, 10, 20, 50, 100)
|
||||
limitOptions.forEach { limit ->
|
||||
DropdownMenuItem(
|
||||
text = { Text(if (limit == 0) stringResource(R.string.options_no_limit) else stringResource(R.string.options_files_limit, limit)) },
|
||||
onClick = {
|
||||
onRecentFilesLimitChange(limit)
|
||||
showLimitMenu = false
|
||||
},
|
||||
trailingIcon = if (uiState.recentFilesLimit == limit) {
|
||||
{ Icon(Icons.Default.Check, contentDescription = stringResource(R.string.content_desc_selected)) }
|
||||
} else null
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1630,7 +1630,7 @@ private fun ShelfListItem(
|
|||
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||
),
|
||||
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
||||
defaultElevation = if (isSelected) 8.dp else 2.dp
|
||||
defaultElevation = if (isSelected) 4.dp else 1.dp
|
||||
),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
|
@ -1709,7 +1709,7 @@ private fun LibraryListItem(
|
|||
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||
),
|
||||
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
||||
defaultElevation = if (isSelected) 6.dp else 2.dp
|
||||
defaultElevation = if (isSelected) 4.dp else 1.dp
|
||||
),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
|
|
|||
|
|
@ -337,14 +337,14 @@ fun CustomTopAppBar(
|
|||
) {
|
||||
Surface(
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||
shadowElevation = 2.dp
|
||||
color = MaterialTheme.colorScheme.surface,
|
||||
shadowElevation = 0.dp
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.statusBarsPadding()
|
||||
.height(56.dp)
|
||||
.height(64.dp)
|
||||
.padding(horizontal = 4.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
|
|
@ -352,9 +352,8 @@ fun CustomTopAppBar(
|
|||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(start = 12.dp),
|
||||
contentAlignment = Alignment.CenterStart
|
||||
.weight(1f),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
ProvideTextStyle(value = MaterialTheme.typography.titleLarge) {
|
||||
title()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue