34 lines
1.1 KiB
Kotlin
34 lines
1.1 KiB
Kotlin
package plus.rua.project.ui
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
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.Modifier
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
private val WEEKDAY_LABELS = listOf("一", "二", "三", "四", "五", "六", "日")
|
|
|
|
/**
|
|
* 星期标题行,固定显示"一二三四五六日"。
|
|
*
|
|
* @param modifier 外部布局修饰符
|
|
*/
|
|
@Composable
|
|
fun WeekdayHeader(modifier: Modifier = Modifier) {
|
|
Row(modifier = modifier.fillMaxWidth().padding(vertical = 12.dp)) {
|
|
WEEKDAY_LABELS.forEach { label ->
|
|
Text(
|
|
text = label,
|
|
modifier = Modifier.weight(1f),
|
|
textAlign = TextAlign.Center,
|
|
style = MaterialTheme.typography.bodySmall,
|
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
|
)
|
|
}
|
|
}
|
|
}
|