Add status bars padding and refine month header layout

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
xfy 2026-05-14 13:49:01 +08:00
parent eb8b16047a
commit d7f09fb1f7
2 changed files with 13 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package plus.rua.project.ui
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
@ -23,7 +24,7 @@ fun CalendarMonthView(
var currentYear by remember { mutableIntStateOf(viewModel.currentYear) }
var currentMonth by remember { mutableIntStateOf(viewModel.currentMonth) }
Column(modifier = modifier.fillMaxSize()) {
Column(modifier = modifier.fillMaxSize().statusBarsPadding()) {
MonthHeader(
year = currentYear,
month = currentMonth,

View File

@ -6,8 +6,10 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@Composable
fun MonthHeader(
@ -19,11 +21,17 @@ fun MonthHeader(
Row(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 12.dp)
.padding(horizontal = 16.dp, vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "${year}${month}月 第${weekNumber}",
style = MaterialTheme.typography.titleMedium
text = "${year}${month}",
style = MaterialTheme.typography.titleLarge
)
Text(
text = "${weekNumber}",
style = MaterialTheme.typography.bodySmall,
fontSize = 13.sp
)
}
}