Add status bars padding and refine month header layout
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
eb8b16047a
commit
d7f09fb1f7
@ -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,
|
||||
|
||||
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user