diff --git a/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt b/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt index 559c1c71..1787876b 100644 --- a/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt +++ b/core/src/main/java/com/orange/ouds/core/component/button/OudsButton.kt @@ -90,6 +90,8 @@ import kotlinx.parcelize.Parcelize * Has no effect when [style] is equal to [OudsButton.Style.Loading]. * @param style The button style. * @param hierarchy The button hierarchy. + * + * @sample com.orange.ouds.core.component.samples.OudsButtonWithTextSample */ @Composable fun OudsButton( @@ -123,6 +125,8 @@ fun OudsButton( * Has no effect when [style] is equal to [OudsButton.Style.Loading]. * @param style The button style. * @param hierarchy The button hierarchy. + * + * @sample com.orange.ouds.core.component.samples.OudsButtonWithIconSample */ @Composable fun OudsButton( @@ -157,6 +161,8 @@ fun OudsButton( * Has no effect when [style] is equal to [OudsButton.Style.Loading]. * @param style The button style. * @param hierarchy The button hierarchy. + * + * @sample com.orange.ouds.core.component.samples.OudsButtonWithIconAndTextSample */ @Composable fun OudsButton( diff --git a/core/src/main/java/com/orange/ouds/core/component/coloredbox/OudsColoredBox.kt b/core/src/main/java/com/orange/ouds/core/component/coloredbox/OudsColoredBox.kt index 08c6dbdb..3ff574f4 100644 --- a/core/src/main/java/com/orange/ouds/core/component/coloredbox/OudsColoredBox.kt +++ b/core/src/main/java/com/orange/ouds/core/component/coloredbox/OudsColoredBox.kt @@ -47,7 +47,7 @@ import com.orange.ouds.theme.tokens.OudsSpaceKeyToken * @param propagateMinConstraints Whether the incoming min constraints should be passed to content. * @param content The content of this colored box. * - * @sample com.orange.ouds.core.component.samples.SimpleOudsColoredBox + * @sample com.orange.ouds.core.component.samples.OudsColoredBoxSample */ @Composable fun OudsColoredBox( diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsButtonSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsButtonSamples.kt new file mode 100644 index 00000000..07655ca7 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsButtonSamples.kt @@ -0,0 +1,48 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.core.component.samples + +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.painterResource +import com.orange.ouds.core.component.button.OudsButton + +@Composable +fun OudsButtonWithTextSample() { + OudsButton( + text = "Text", + onClick = { /* Do something! */ } + ) +} + +@Composable +fun OudsButtonWithIconSample() { + OudsButton( + icon = OudsButton.Icon( + painterResource(id = android.R.drawable.star_on), + "Icon content description" + ), + onClick = { /* Do something! */ } + ) +} + +@Composable +fun OudsButtonWithIconAndTextSample() { + OudsButton( + icon = OudsButton.Icon( + painterResource(id = android.R.drawable.star_on), + "Icon content description" + ), + text = "Text", + onClick = { /* Do something! */ } + ) +} diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsColoredBoxSample.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsColoredBoxSamples.kt similarity index 96% rename from core/src/main/java/com/orange/ouds/core/component/samples/OudsColoredBoxSample.kt rename to core/src/main/java/com/orange/ouds/core/component/samples/OudsColoredBoxSamples.kt index f1665584..bb448654 100644 --- a/core/src/main/java/com/orange/ouds/core/component/samples/OudsColoredBoxSample.kt +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsColoredBoxSamples.kt @@ -18,7 +18,7 @@ import com.orange.ouds.core.component.coloredbox.OudsColoredBox import com.orange.ouds.theme.tokens.OudsColorKeyToken @Composable -fun SimpleOudsColoredBox() { +fun OudsColoredBoxSample() { OudsColoredBox(color = OudsColorKeyToken.Surface.Status.Info.Emphasized) { // From this point LocalContentColor is automatically adjusted to maximize the contrast with OudsColorKeyToken.Surface.Status.Info.Emphasized Text("Text")