Skip to content

Commit

Permalink
Rename OudsContrastedSurface to OudsColoredSurface
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmaitre committed Dec 30, 2024
1 parent 1a8079b commit 71ebc66
Show file tree
Hide file tree
Showing 28 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Software description: Android library of reusable graphical components
*/

package com.orange.ouds.core.component.contrastedsurface
package com.orange.ouds.core.component.coloredsurface

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -44,7 +44,7 @@ import com.orange.ouds.theme.tokens.OudsSpaceKeyToken
* @param content The content of this colored surface.
*/
@Composable
fun OudsContrastedSurface(
fun OudsColoredSurface(
color: OudsColorKeyToken.Surface,
modifier: Modifier = Modifier,
shape: Shape = RectangleShape,
Expand Down Expand Up @@ -83,21 +83,21 @@ private fun contentColorFor(color: OudsColorKeyToken.Surface): Color {
@Suppress("PreviewShouldNotBeCalledRecursively")
@UiModePreviews.Default
@Composable
private fun PreviewOudsContrastedSurface(@PreviewParameter(OudsContrastedSurfacePreviewParameterProvider::class) parameter: OudsColorKeyToken.Surface) {
PreviewOudsContrastedSurface(darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter)
private fun PreviewOudsColoredSurface(@PreviewParameter(OudsColoredSurfacePreviewParameterProvider::class) parameter: OudsColorKeyToken.Surface) {
PreviewOudsColoredSurface(darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter)
}

@Composable
internal fun PreviewOudsContrastedSurface(darkThemeEnabled: Boolean, parameter: OudsColorKeyToken.Surface) = OudsPreview(darkThemeEnabled = darkThemeEnabled) {
OudsContrastedSurface(color = parameter) {
internal fun PreviewOudsColoredSurface(darkThemeEnabled: Boolean, parameter: OudsColorKeyToken.Surface) = OudsPreview(darkThemeEnabled = darkThemeEnabled) {
OudsColoredSurface(color = parameter) {
Text(
modifier = Modifier.padding(all = OudsSpaceKeyToken.Fixed.Medium.value),
text = parameter.name.removePrefix("OudsColorKeyToken."),
)
}
}

internal class OudsContrastedSurfacePreviewParameterProvider : BasicPreviewParameterProvider<OudsColorKeyToken.Surface>(*previewParameterValues.toTypedArray())
internal class OudsColoredSurfacePreviewParameterProvider : BasicPreviewParameterProvider<OudsColorKeyToken.Surface>(*previewParameterValues.toTypedArray())

private val previewParameterValues: List<OudsColorKeyToken.Surface>
get() = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Software description: Android library of reusable graphical components
*/

package com.orange.ouds.core.component.contrastedsurface
package com.orange.ouds.core.component.coloredsurface

import app.cash.paparazzi.Paparazzi
import com.android.ide.common.rendering.api.SessionParams
Expand All @@ -21,31 +21,31 @@ import org.junit.runner.RunWith
import org.junit.runners.Parameterized

@RunWith(Parameterized::class)
internal class OudsContrastedSurfaceTest(private val parameter: OudsColorKeyToken.Surface) {
internal class OudsColoredSurfaceTest(private val parameter: OudsColorKeyToken.Surface) {

companion object {
@JvmStatic
@Parameterized.Parameters
internal fun data() = OudsContrastedSurfacePreviewParameterProvider().values.toList()
internal fun data() = OudsColoredSurfacePreviewParameterProvider().values.toList()
}

@get:Rule
val paparazzi = Paparazzi(renderingMode = SessionParams.RenderingMode.SHRINK, maxPercentDifference = 0.0)

@Test
fun takeOudsContrastedSurfaceLightThemeSnapshot() {
fun takeOudsColoredSurfaceLightThemeSnapshot() {
paparazzi.snapshot {
PreviewOudsContrastedSurface(
PreviewOudsColoredSurface(
darkThemeEnabled = false,
parameter = parameter
)
}
}

@Test
fun takeOudsContrastedSurfaceDarkThemeSnapshot() {
fun takeOudsColoredSurfaceDarkThemeSnapshot() {
paparazzi.snapshot {
PreviewOudsContrastedSurface(
PreviewOudsColoredSurface(
darkThemeEnabled = true,
parameter = parameter
)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 71ebc66

Please sign in to comment.