package com.dong.maxhap.demos.material

import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@Composable
internal fun TextSamples() {
    var size by remember { mutableStateOf(16f) }
    var bold by remember { mutableStateOf(false) }
    Column(Modifier.padding(12.dp)) {
        Text("普通文本", fontSize = size.sp, fontWeight = if (bold) FontWeight.Bold else FontWeight.Normal)
        Text("副标题", style = MaterialTheme.typography.subtitle1)
        Text("标题", style = MaterialTheme.typography.h6)
        Text("正文", style = MaterialTheme.typography.body1)
        Text("按钮", style = MaterialTheme.typography.button)
        Text("说明文字", style = MaterialTheme.typography.caption)
        Spacer(Modifier.height(8.dp))
        Text("字体大小: ${size.toInt()}sp"); Slider(value = size, onValueChange = { size = it }, valueRange = 12f..36f)
        Row { Checkbox(checked = bold, onCheckedChange = { bold = it }); Text("加粗") }
    }
}
