Compose-Settings
Toggle table of contents
common
Target filter
common
Switch theme
Search in API
Skip to content
Compose-Settings
ui-tiles-extended
/
com.alorma.compose.settings.ui
/
SettingsSegmented
Settings
Segmented
@
Composable
fun
<
T
>
SettingsSegmented
(
title
:
@
Composable
(
)
->
Unit
,
items
:
List
<
T
>
,
selectedItem
:
T
?
,
onItemSelected
:
(
T
)
->
Unit
,
itemTitleMap
:
(
T
)
->
CharSequence
,
modifier
:
Modifier
=
Modifier
,
enabled
:
Boolean
=
LocalSettingsGroupEnabled.current
,
colors
:
SettingsTileColors
=
SettingsTileDefaults.colors()
,
buttonSpace
:
Dp
=
SegmentedButtonDefaults.BorderWidth
,
buttonShape
:
@
Composable
(
Int
)
->
Shape
=
{ index -> SegmentedButtonDefaults.itemShape( index = index, count = items.size, ) }
,
buttonColors
:
SegmentedButtonColors
=
SegmentedButtonDefaults.colors( activeContainerColor = colors .actionColor(enabled) .copy(alpha = 0.4f) .compositeOver(MaterialTheme.colorScheme.surfaceContainerLowest), inactiveContainerColor = colors.containerColor, activeContentColor = colors.subtitleColor(enabled), inactiveContentColor = colors.subtitleColor(enabled), activeBorderColor = colors.subtitleColor, inactiveBorderColor = colors.subtitleColor, disabledActiveContainerColor = colors .actionColor(enabled) .copy(alpha = 0.12f) .compositeOver(MaterialTheme.colorScheme.surfaceContainerLowest), disabledInactiveContainerColor = MaterialTheme.colorScheme.surface .copy(alpha = SettingsTileDefaults.DisabledAlpha) .compositeOver(colors.containerColor), disabledActiveContentColor = colors.subtitleColor(enabled), disabledInactiveContentColor = colors.subtitleColor(enabled), disabledActiveBorderColor = colors.subtitleColor(enabled), disabledInactiveBorderColor = colors.subtitleColor(enabled), )
,
buttonIcon
:
@
Composable
(
Boolean
)
->
Unit
=
{ selected -> SegmentedButtonDefaults.Icon(selected) }
,
subtitle
:
@
Composable
(
)
->
Unit
?
=
null
,
icon
:
@
Composable
(
)
->
Unit
?
=
null
,
shape
:
Shape
=
SettingsTileDefaults.shape()
,
tonalElevation
:
Dp
=
SettingsTileDefaults.Elevation
,
shadowElevation
:
Dp
=
SettingsTileDefaults.Elevation
)