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),
|
.combinedClickable(onClick = onClick, onLongClick = onLongClick),
|
||||||
shape = MaterialTheme.shapes.large,
|
shape = MaterialTheme.shapes.large,
|
||||||
colors = androidx.compose.material3.CardDefaults.elevatedCardColors(
|
colors = androidx.compose.material3.CardDefaults.elevatedCardColors(
|
||||||
containerColor = MaterialTheme.colorScheme.surfaceContainerHigh
|
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||||
),
|
),
|
||||||
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
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()) {
|
Column(modifier = Modifier.fillMaxWidth()) {
|
||||||
|
|
@ -1109,7 +1109,6 @@ fun DefaultTopAppBar(
|
||||||
var showLimitMenu by remember { mutableStateOf(false) }
|
var showLimitMenu by remember { mutableStateOf(false) }
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
var hideReaderAiFeatures by remember { mutableStateOf(loadHideReaderAiFeatures(context)) }
|
var hideReaderAiFeatures by remember { mutableStateOf(loadHideReaderAiFeatures(context)) }
|
||||||
|
|
||||||
CustomTopAppBar(title = { }, navigationIcon = {
|
CustomTopAppBar(title = { }, navigationIcon = {
|
||||||
IconButton(onClick = onDrawerClick) {
|
IconButton(onClick = onDrawerClick) {
|
||||||
BadgedBox(
|
BadgedBox(
|
||||||
|
|
@ -1122,38 +1121,9 @@ fun DefaultTopAppBar(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, actions = {
|
}, actions = {
|
||||||
IconButton(onClick = onSettingsClick) {
|
|
||||||
Icon(Icons.Default.Settings, contentDescription = stringResource(R.string.settings))
|
|
||||||
}
|
|
||||||
Box {
|
|
||||||
IconButton(onClick = onAppThemeClick) {
|
IconButton(onClick = onAppThemeClick) {
|
||||||
Icon(painterResource(id = R.drawable.palette), contentDescription = stringResource(R.string.content_desc_app_theme))
|
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)
|
// Options Menu (MoreVert)
|
||||||
Box {
|
Box {
|
||||||
IconButton(onClick = { showOptionsMenu = true }) {
|
IconButton(onClick = { showOptionsMenu = true }) {
|
||||||
|
|
@ -1161,13 +1131,23 @@ fun DefaultTopAppBar(
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = showOptionsMenu, onDismissRequest = { showOptionsMenu = false }) {
|
expanded = showOptionsMenu, onDismissRequest = { showOptionsMenu = false }) {
|
||||||
DropdownMenuItem(text = { Text(stringResource(R.string.about_title)) }, onClick = {
|
DropdownMenuItem(text = { Text(stringResource(R.string.settings)) }, onClick = {
|
||||||
onAboutClick()
|
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
|
showOptionsMenu = false
|
||||||
})
|
})
|
||||||
|
|
||||||
HorizontalDivider()
|
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 = {
|
DropdownMenuItem(text = { Text(stringResource(R.string.options_enable_multi_tab_reading)) }, onClick = {
|
||||||
onTabsToggle(!uiState.isTabsEnabled)
|
onTabsToggle(!uiState.isTabsEnabled)
|
||||||
showOptionsMenu = false
|
showOptionsMenu = false
|
||||||
|
|
@ -1241,6 +1221,7 @@ fun DefaultTopAppBar(
|
||||||
onClearCache()
|
onClearCache()
|
||||||
showOptionsMenu = false
|
showOptionsMenu = false
|
||||||
})
|
})
|
||||||
|
|
||||||
DropdownMenuItem(text = { Text(stringResource(R.string.options_clear_reflow_cache)) }, onClick = {
|
DropdownMenuItem(text = { Text(stringResource(R.string.options_clear_reflow_cache)) }, onClick = {
|
||||||
onClearReflowCache()
|
onClearReflowCache()
|
||||||
showOptionsMenu = false
|
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
|
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||||
),
|
),
|
||||||
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
||||||
defaultElevation = if (isSelected) 8.dp else 2.dp
|
defaultElevation = if (isSelected) 4.dp else 1.dp
|
||||||
),
|
),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|
@ -1709,7 +1709,7 @@ private fun LibraryListItem(
|
||||||
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
containerColor = MaterialTheme.colorScheme.surfaceContainerLow
|
||||||
),
|
),
|
||||||
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
elevation = androidx.compose.material3.CardDefaults.elevatedCardElevation(
|
||||||
defaultElevation = if (isSelected) 6.dp else 2.dp
|
defaultElevation = if (isSelected) 4.dp else 1.dp
|
||||||
),
|
),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|
|
||||||
|
|
@ -337,14 +337,14 @@ fun CustomTopAppBar(
|
||||||
) {
|
) {
|
||||||
Surface(
|
Surface(
|
||||||
modifier = modifier.fillMaxWidth(),
|
modifier = modifier.fillMaxWidth(),
|
||||||
color = MaterialTheme.colorScheme.surfaceVariant,
|
color = MaterialTheme.colorScheme.surface,
|
||||||
shadowElevation = 2.dp
|
shadowElevation = 0.dp
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.statusBarsPadding()
|
.statusBarsPadding()
|
||||||
.height(56.dp)
|
.height(64.dp)
|
||||||
.padding(horizontal = 4.dp),
|
.padding(horizontal = 4.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
|
|
@ -352,9 +352,8 @@ fun CustomTopAppBar(
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f),
|
||||||
.padding(start = 12.dp),
|
contentAlignment = Alignment.Center
|
||||||
contentAlignment = Alignment.CenterStart
|
|
||||||
) {
|
) {
|
||||||
ProvideTextStyle(value = MaterialTheme.typography.titleLarge) {
|
ProvideTextStyle(value = MaterialTheme.typography.titleLarge) {
|
||||||
title()
|
title()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue