@@ -22,6 +22,7 @@ import com.huanshankeji.compose.material3.ext.*
2222import com.huanshankeji.compose.material3.ext.Card
2323import com.huanshankeji.compose.material3.ext.ElevatedCard
2424import com.huanshankeji.compose.material3.ext.OutlinedCard
25+ import com.huanshankeji.compose.material3.labs.*
2526import com.huanshankeji.compose.material3.lazy.ext.List
2627import com.huanshankeji.compose.material3.lazy.ext.ListItemComponents
2728import com.huanshankeji.compose.ui.Modifier
@@ -232,5 +233,197 @@ fun Material3(/*modifier: Modifier = Modifier*/
232233 LinearProgressIndicator ({ 0.5f })
233234 CircularProgressIndicator ()
234235 CircularProgressIndicator ({ 0.5f })
236+
237+ // New components added
238+
239+ // RadioButton
240+ Row {
241+ RadioButton (
242+ selected = checked,
243+ onClick = { viewModel.checkedState.value = true }
244+ )
245+ RadioButton (
246+ selected = ! checked,
247+ onClick = { viewModel.checkedState.value = false }
248+ )
249+ }
250+
251+ // HorizontalDivider
252+ HorizontalDivider ()
253+
254+ // Slider
255+ var sliderValue by remember { mutableStateOf(0.5f ) }
256+ Column {
257+ Text (" Slider value: ${(sliderValue * 100 ).toInt()} %" )
258+ Slider (
259+ value = sliderValue,
260+ onValueChange = { sliderValue = it },
261+ valueRange = 0f .. 1f
262+ )
263+ }
264+
265+ // Badge
266+ Row {
267+ Badge {
268+ Text (" 3" )
269+ }
270+ Badge {
271+ Text (" New" )
272+ }
273+ }
274+
275+ // Chips
276+ Row {
277+ AssistChip (
278+ onClick = { println (" Assist chip clicked" ) },
279+ label = { Text (" Assist" ) }
280+ )
281+ FilterChip (
282+ selected = checked,
283+ onClick = onCheckedChange.let { { it(! checked) } },
284+ label = { Text (" Filter" ) }
285+ )
286+ InputChip (
287+ selected = checked,
288+ onClick = onCheckedChange.let { { it(! checked) } },
289+ label = { Text (" Input" ) }
290+ )
291+ SuggestionChip (
292+ onClick = { println (" Suggestion chip clicked" ) },
293+ label = { Text (" Suggest" ) }
294+ )
295+ }
296+
297+ // Chips with icons
298+ Row {
299+ AssistChip (
300+ onClick = { println (" Assist chip with icon clicked" ) },
301+ label = { Text (" Assist" ) },
302+ leadingIcon = { Icon (Icons .Default .Add , null ) }
303+ )
304+ FilterChip (
305+ selected = checked,
306+ onClick = onCheckedChange.let { { it(! checked) } },
307+ label = { Text (" Filter" ) },
308+ leadingIcon = { Icon (Icons .Default .Add , null ) }
309+ )
310+ }
311+
312+ // Dialog
313+ var showDialog by remember { mutableStateOf(false ) }
314+ Button (onClick = { showDialog = true }) {
315+ Text (" Show Dialog" )
316+ }
317+ if (showDialog) {
318+ AlertDialog (
319+ onDismissRequest = { showDialog = false },
320+ confirmButton = {
321+ Button (onClick = { showDialog = false }) {
322+ Text (" OK" )
323+ }
324+ },
325+ dismissButton = {
326+ Button (onClick = { showDialog = false }) {
327+ Text (" Cancel" )
328+ }
329+ },
330+ title = { Text (" Alert Dialog" ) },
331+ text = { Text (" This is a demo alert dialog with headline, content, and action buttons." ) }
332+ )
333+ }
334+
335+ // Tabs
336+ var selectedTabIndex by remember { mutableStateOf(0 ) }
337+ Column {
338+ TabRow (selectedTabIndex = selectedTabIndex) {
339+ Tab (
340+ selected = selectedTabIndex == 0 ,
341+ onClick = { selectedTabIndex = 0 },
342+ text = { Text (" Tab 1" ) }
343+ )
344+ Tab (
345+ selected = selectedTabIndex == 1 ,
346+ onClick = { selectedTabIndex = 1 },
347+ text = { Text (" Tab 2" ) },
348+ icon = { Icon (Icons .Default .Add , null ) }
349+ )
350+ Tab (
351+ selected = selectedTabIndex == 2 ,
352+ onClick = { selectedTabIndex = 2 },
353+ text = { Text (" Tab 3" ) }
354+ )
355+ }
356+ Text (" Selected tab: ${selectedTabIndex + 1 } " , Modifier .padding(16 .dp))
357+ }
358+
359+ // Select components
360+ var selectedValue by remember { mutableStateOf(" Option 1" ) }
361+ Column {
362+ Text (" Selected: $selectedValue " )
363+ FilledSelect (
364+ value = selectedValue,
365+ onValueChange = { selectedValue = it },
366+ label = " Choose option"
367+ ) {
368+ SelectOption (" Option 1" , " Option 1" )
369+ SelectOption (" Option 2" , " Option 2" )
370+ SelectOption (" Option 3" , " Option 3" )
371+ }
372+ }
373+ Column {
374+ OutlinedSelect (
375+ value = selectedValue,
376+ onValueChange = { selectedValue = it },
377+ label = " Choose option"
378+ ) {
379+ SelectOption (" Option 1" , " Option 1" )
380+ SelectOption (" Option 2" , " Option 2" )
381+ SelectOption (" Option 3" , " Option 3" )
382+ }
383+ }
384+
385+ // Labs components - SegmentedButton
386+ var selectedSegment by remember { mutableStateOf(0 ) }
387+ SegmentedButtonSet {
388+ SegmentedButton (
389+ selected = selectedSegment == 0 ,
390+ onClick = { selectedSegment = 0 },
391+ label = { Text (" Day" ) }
392+ )
393+ SegmentedButton (
394+ selected = selectedSegment == 1 ,
395+ onClick = { selectedSegment = 1 },
396+ label = { Text (" Week" ) }
397+ )
398+ SegmentedButton (
399+ selected = selectedSegment == 2 ,
400+ onClick = { selectedSegment = 2 },
401+ label = { Text (" Month" ) }
402+ )
403+ }
404+
405+ // ListItem
406+ ListItem {
407+ Text (" This is a list item" )
408+ }
409+ ListItem (multiline = true ) {
410+ Text (" This is a multiline list item with more content" )
411+ }
412+
413+ // NavigationDrawer (simplified demo)
414+ var drawerOpened by remember { mutableStateOf(false ) }
415+ Button (onClick = { drawerOpened = ! drawerOpened }) {
416+ Text (if (drawerOpened) " Close Drawer" else " Open Drawer" )
417+ }
418+ if (drawerOpened) {
419+ NavigationDrawer (opened = drawerOpened) {
420+ Column (Modifier .padding(16 .dp)) {
421+ Text (" Drawer Content" )
422+ Button (onClick = { drawerOpened = false }) {
423+ Text (" Close" )
424+ }
425+ }
426+ }
427+ }
235428 }
236429}
0 commit comments