Skip to content

Commit

Permalink
[#599] Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea authored and florentmaitre committed Sep 6, 2023
1 parent 64fb536 commit 9d539c1
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions docs/components/Buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,13 @@ Use the `OdsIconButton` composable:

```kotlin
OdsIconButton(
onClick = { },
painter = painterResource(id = R.drawable.ic_ui_light_mode),
contentDescription = stringResource(id = R.string.theme_changer_icon_content_description_light)
icon = OdsIconButtonIcon(
painterResource(id = R.drawable.ic_ui_light_mode),
stringResource(id = R.string.theme_changer_icon_content_description_light)
),
onClick = {
// Do something
},
)
```

Expand All @@ -258,9 +262,11 @@ Use the `OdsIconToggleButton` composable:
OdsIconToggleButton(
checked = false,
onCheckedChange = { },
uncheckedPainter = painterResource(R.drawable.ic_heart_outlined),
checkedPainter = painterResource(R.drawable.ic_heart),
painterDescription = "Add to favourites"
uncheckedIcon = OdsIconButtonIcon(
painterResource(R.drawable.ic_heart_outlined),
"Add to favorites"
),
checkedIcon = OdsIconButtonIcon(painterResource(R.drawable.ic_heart), "Remove from favorites")
)
```

Expand All @@ -278,10 +284,10 @@ Use the `OdsIconToggleButtonsRow` composable:

```kotlin
OdsIconToggleButtonsRow(
iconToggleButtons = listOf(
OdsIconToggleButtonsRowItem(painterResource(id = R.drawable.ic_restaurant), "Restaurant"),
OdsIconToggleButtonsRowItem(painterResource(id = R.drawable.ic_cooking_pot), "Cooking pot"),
OdsIconToggleButtonsRowItem(
icons = listOf(
OdsIconToggleButtonsRowIcon(painterResource(id = R.drawable.ic_restaurant), "Restaurant"),
OdsIconToggleButtonsRowIcon(painterResource(id = R.drawable.ic_cooking_pot), "Cooking pot"),
OdsIconToggleButtonsRowIcon(
painterResource(id = R.drawable.ic_coffee),
"Coffee",
enabled = false
Expand Down

0 comments on commit 9d539c1

Please sign in to comment.