Skip to content

Commit

Permalink
Update Catalog App
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinaRomanova committed Jul 31, 2023
1 parent 735fcf5 commit b91ef54
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private fun ButtonSample() {
var iconSide by remember { mutableStateOf(IconSide.START) }
var style by remember { mutableStateOf(ButtonStyle.Filled) }
var size by remember { mutableStateOf(ButtonSize.Medium) }
var intent by remember { mutableStateOf(ButtonIntent.Primary) }
var intent by remember { mutableStateOf(ButtonIntent.Main) }
var buttonText by remember { mutableStateOf("Filled Button") }

ConfigedButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -56,24 +57,29 @@ public val CheckboxExamples: List<Example> = listOf(
sourceUrl = CheckboxExampleSourceUrl,
) {
var checkboxState by remember { mutableStateOf(ToggleableState.Off) }
Row {
ToggleIntent.values().forEach { intent ->
Column {
Checkbox(
enabled = true,
state = checkboxState,
intent = intent,
onClick = {
checkboxState = when (checkboxState) {
ToggleableState.On -> ToggleableState.Off
ToggleableState.Off -> ToggleableState.Indeterminate
ToggleableState.Indeterminate -> ToggleableState.On
}
},
)
Checkbox(enabled = false, state = checkboxState, intent = intent, onClick = {})
}
}
LazyRow {
items(
ToggleIntent.values().count(),
itemContent = { index ->
val intent = ToggleIntent.values()[index]
Column {
Checkbox(
enabled = true,
state = checkboxState,
intent = intent,
onClick = {
checkboxState = when (checkboxState) {
ToggleableState.On -> ToggleableState.Off
ToggleableState.Off -> ToggleableState.Indeterminate
ToggleableState.Indeterminate -> ToggleableState.On
}
},
)
Checkbox(enabled = false, state = checkboxState, intent = intent, onClick = {})
}
},
)

}
},
Example(
Expand Down

0 comments on commit b91ef54

Please sign in to comment.