diff --git a/NOTICE.txt b/NOTICE.txt index b4e4c57d7..cb7dfe612 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -112,6 +112,9 @@ theme-orange/src/main/res/drawable/ic_orange_component_link_previous.xml theme-orange/src/main/res/drawable/ic_orange_component_radio_button_selected.xml theme-orange/src/main/res/drawable/ic_orange_component_switch_selected_switch.xml theme-orange/src/main/res/drawable/ic_orange_component_tag_close.xml +theme-orange/src/main/res/drawable/ic_orange_functional_actions_delete.xml +theme-orange/src/main/res/drawable/ic_orange_functional_navigation_form_chevron_left.xml +theme-orange/src/main/res/drawable/ic_orange_functional_navigation_menu.xml theme-sosh/src/main/res/drawable/ic_sosh_component_alert_important_fill.xml theme-sosh/src/main/res/drawable/ic_sosh_component_alert_info_fill.xml @@ -126,6 +129,9 @@ theme-sosh/src/main/res/drawable/ic_sosh_component_link_previous.xml theme-sosh/src/main/res/drawable/ic_sosh_component_radio_button_selected.xml theme-sosh/src/main/res/drawable/ic_sosh_component_switch_selected_switch.xml theme-sosh/src/main/res/drawable/ic_sosh_component_tag_close.xml +theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_delete.xml +theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_form_chevron_left.xml +theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_menu.xml theme-sosh/src/main/res/font/sosh_black.ttf theme-sosh/src/main/res/font/sosh_bold.ttf theme-sosh/src/main/res/font/sosh_medium.ttf @@ -145,6 +151,9 @@ theme-wireframe/src/main/res/drawable/ic_wireframe_component_link_previous.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_radio_button_selected.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_switch_selected_switch.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_tag_close.xml +theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_delete.xml +theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_form_chevron_left.xml +theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_menu.xml End of the parts list under Orange SA Copyright diff --git a/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt b/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt index 0ba119b6b..0a7efd03f 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/BottomBar.kt @@ -12,6 +12,7 @@ package com.orange.ouds.app.ui +import android.os.Build import androidx.annotation.StringRes import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.animateColorAsState @@ -24,10 +25,12 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.foundation.layout.displayCutout import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.windowInsetsBottomHeight +import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -46,7 +49,7 @@ import com.orange.ouds.core.theme.OudsTheme @Composable fun BottomBar(currentRoute: String, navigateToRoute: (String) -> Unit, modifier: Modifier = Modifier, visible: Boolean = true) { - Column { + Column(modifier = Modifier.windowInsetsPadding(WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal))) { val systemNavigationBackgroundColor = OudsTheme.colorScheme.background.secondary //TODO Temporary color. Waiting for Material colors from Maxime. AnimatedVisibility( visible = visible, @@ -63,7 +66,7 @@ fun BottomBar(currentRoute: String, navigateToRoute: (String) -> Unit, modifier: ) }, modifier = modifier.consumeWindowInsets(WindowInsets.navigationBars.only(WindowInsetsSides.Bottom)), - translucent = true + translucent = Build.VERSION.SDK_INT > Build.VERSION_CODES.S_V2 ) } val systemNavigationBarBackgroundColor by animateColorAsState(if (visible) systemNavigationBackgroundColor else MaterialTheme.colorScheme.surface) diff --git a/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt index a4ae523a6..a001c975c 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt @@ -99,18 +99,20 @@ fun MainScreen( var changeThemeDialogVisible by rememberSaveable { mutableStateOf(false) } var changeThemeSettingsDialogVisible by rememberSaveable { mutableStateOf(false) } - val hazeState = rememberHazeState(blurEnabled = true) - OudsTheme( theme = mainState.themeState.currentTheme, darkThemeEnabled = isSystemInDarkTheme, ) { + val hazeState = rememberHazeState(blurEnabled = true) + val hazeStyle = HazeStyle(tint = null, blurRadius = OudsTheme.components.bar.blurRadius.dp) + CompositionLocalProvider(LocalThemeDrawableResources provides ThemeDrawableResources(mainState.themeState.currentTheme)) { Scaffold( contentWindowInsets = ScaffoldDefaults.contentWindowInsets.union(WindowInsets.displayCutout), topBar = { val context = LocalContext.current TopBar( + modifier = Modifier.hazeEffect(state = hazeState, style = hazeStyle), topBarState = mainState.topBarState, upPress = mainState.navigationState::upPress, onActionClick = { action -> @@ -124,10 +126,7 @@ fun MainScreen( }, bottomBar = { BottomBar( - modifier = Modifier.hazeEffect( - state = hazeState, - style = HazeStyle(tint = null, blurRadius = OudsTheme.components.navigationBar.blurRadius.dp) - ), + modifier = Modifier.hazeEffect(state = hazeState, style = hazeStyle), currentRoute = mainState.navigationState.currentRoute.orEmpty(), navigateToRoute = { route -> mainState.navigationState.navigateToBottomBarRoute(route) @@ -137,7 +136,7 @@ fun MainScreen( } ) { innerPadding -> val paddingValues = PaddingValues( - top = innerPadding.calculateTopPadding(), + top = 0.dp, bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding(), start = innerPadding.calculateStartPadding(LocalLayoutDirection.current), end = innerPadding.calculateEndPadding(LocalLayoutDirection.current) diff --git a/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt b/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt index a4a54ad0a..45af274eb 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/TopBar.kt @@ -12,42 +12,39 @@ package com.orange.ouds.app.ui -import androidx.compose.foundation.Image +import android.os.Build import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.displayCutout import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.windowInsetsPadding -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.semantics.isTraversalGroup -import androidx.compose.ui.semantics.semantics -import androidx.compose.ui.semantics.traversalIndex import androidx.compose.ui.tooling.preview.PreviewLightDark import com.orange.ouds.app.R +import com.orange.ouds.app.ui.utilities.LightDarkResourceId import com.orange.ouds.app.ui.utilities.LocalThemeDrawableResources import com.orange.ouds.app.ui.utilities.composable.AppPreview -import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.app.ui.utilities.painterResource +import com.orange.ouds.core.component.OudsTopAppBar +import com.orange.ouds.core.component.OudsTopAppBarAction +import com.orange.ouds.core.component.OudsTopAppBarNavigationIcon @Composable fun TopBar( topBarState: TopBarState, upPress: () -> Unit, - onActionClick: (TopBarAction) -> Unit + onActionClick: (TopBarAction) -> Unit, + modifier: Modifier = Modifier ) { TopBar( + modifier = modifier, title = topBarState.title, showNavigationIcon = topBarState.showNavigationIcon, actions = topBarState.actions, @@ -63,33 +60,20 @@ private fun TopBar( title: String, actions: List, upPress: () -> Unit, - onActionClick: (TopBarAction) -> Unit + onActionClick: (TopBarAction) -> Unit, + modifier: Modifier = Modifier ) { - TopAppBar( - modifier = Modifier - .semantics { isTraversalGroup = true } - .windowInsetsPadding(WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal)), - navigationIcon = { - if (showNavigationIcon) { - IconButton(onClick = upPress) { - Image( - imageVector = Icons.AutoMirrored.Filled.ArrowBack, - contentDescription = stringResource(id = R.string.app_common_back_a11y), - colorFilter = ColorFilter.tint(OudsTheme.colorScheme.content.default) - ) - } - } - }, - title = { - Text( - text = title, - color = OudsTheme.colorScheme.content.default, - modifier = Modifier.semantics { traversalIndex = -1f }, - style = OudsTheme.typography.heading.medium + OudsTopAppBar( + modifier = modifier.windowInsetsPadding(WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal)), + translucent = Build.VERSION.SDK_INT > Build.VERSION_CODES.S_V2, + title = title, + navigationIcon = if (showNavigationIcon) OudsTopAppBarNavigationIcon.Back(onClick = upPress) else null, + actions = actions.map { action -> + OudsTopAppBarAction.Icon( + painter = action.painter, + contentDescription = action.contentDescription, + onClick = { onActionClick(action) } ) - }, - actions = { - actions.map { it.TopBarIconButton(onActionClick = onActionClick) } } ) } @@ -97,40 +81,25 @@ private fun TopBar( enum class TopBarAction { ChangeThemeSettings, ChangeTheme, ChangeMode; - @Composable - fun TopBarIconButton(onActionClick: (TopBarAction) -> Unit) = when (this) { - ChangeThemeSettings -> ChangeThemeSettingsAction(onActionClick) - ChangeTheme -> ChangeThemeAction(onActionClick) - ChangeMode -> ChangeModeAction(onActionClick) - } -} - -@Composable -private fun ChangeThemeSettingsAction(onClick: (TopBarAction) -> Unit) { - IconButton(onClick = { onClick(TopBarAction.ChangeThemeSettings) }) { - Icon( - painter = painterResource(id = LocalThemeDrawableResources.current.filters), - contentDescription = stringResource(id = R.string.app_topBar_themeSettings_button_a11y) - ) - } -} - -@Composable -private fun ChangeThemeAction(onClick: (TopBarAction) -> Unit) { - IconButton(onClick = { onClick(TopBarAction.ChangeTheme) }) { - Icon(painter = painterResource(id = R.drawable.ic_solar_palette), contentDescription = stringResource(id = R.string.app_topBar_theme_button_a11y)) - } -} + val painter: Painter + @Composable + get() = when (this) { + ChangeThemeSettings -> painterResource(id = LocalThemeDrawableResources.current.filters) + ChangeTheme -> painterResource(id = R.drawable.ic_solar_palette) + ChangeMode -> painterResource(LightDarkResourceId(R.drawable.ic_ui_light_mode, R.drawable.ic_ui_dark_mode)) + } -@Composable -private fun ChangeModeAction(onClick: (TopBarAction) -> Unit) { - val isSystemInDarkTheme = isSystemInDarkTheme() - val painterRes = if (isSystemInDarkTheme) R.drawable.ic_ui_light_mode else R.drawable.ic_ui_dark_mode - val iconDesc = if (isSystemInDarkTheme) R.string.app_topBar_lightMode_button_a11y else R.string.app_topBar_darkMode_button_a11y + val contentDescription: String + @Composable + get() { + val id = when (this) { + ChangeThemeSettings -> R.string.app_topBar_themeSettings_button_a11y + ChangeTheme -> R.string.app_topBar_theme_button_a11y + ChangeMode -> if (isSystemInDarkTheme()) R.string.app_topBar_lightMode_button_a11y else R.string.app_topBar_darkMode_button_a11y + } - IconButton(onClick = { onClick(TopBarAction.ChangeMode) }) { - Icon(painter = painterResource(id = painterRes), contentDescription = stringResource(id = iconDesc)) - } + return stringResource(id = id) + } } @PreviewLightDark diff --git a/app/src/main/java/com/orange/ouds/app/ui/about/AboutFileScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/about/AboutFileScreen.kt index 301efd300..5d2eccf3d 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/about/AboutFileScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/about/AboutFileScreen.kt @@ -18,7 +18,12 @@ import android.webkit.WebResourceRequest import android.webkit.WebView import android.webkit.WebViewClient import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.only +import androidx.compose.foundation.layout.statusBars import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext @@ -26,6 +31,7 @@ import androidx.compose.ui.viewinterop.AndroidView import com.orange.ouds.app.ui.utilities.composable.Screen import com.orange.ouds.app.ui.utilities.injectLightDarkModeCss import com.orange.ouds.app.ui.utilities.launchUrl +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.theme.OudsTheme import java.io.BufferedReader import java.nio.charset.StandardCharsets @@ -37,11 +43,14 @@ private const val FilePath = "file:///android_res/$FileResourceDir/" internal fun AboutFileScreen(fileMenuItem: AboutFileMenuItem) { val context = LocalContext.current val horizontalPadding = OudsTheme.grids.margin.value - val verticalPadding = OudsTheme.spaces.fixed.medium.value + val topPadding = topBarsTopPadding + OudsTheme.spaces.fixed.medium + val bottomPadding = OudsTheme.spaces.fixed.medium.value val isSystemInDarkTheme = isSystemInDarkTheme() Screen { AndroidView( - modifier = Modifier.fillMaxSize(), + modifier = Modifier + .fillMaxSize() + .consumeWindowInsets(WindowInsets.statusBars.only(WindowInsetsSides.Top)), factory = { WebView(context).apply { @SuppressLint("SetJavaScriptEnabled") @@ -49,7 +58,7 @@ internal fun AboutFileScreen(fileMenuItem: AboutFileMenuItem) { webViewClient = object : WebViewClient() { override fun onPageFinished(view: WebView?, url: String?) { super.onPageFinished(view, url) - view?.loadUrl("javascript:(function(){ document.body.style.padding = '${verticalPadding}px ${horizontalPadding}px' })();") + view?.loadUrl("javascript:(function(){ document.body.style.paddingTop = '${topPadding.value}px'; document.body.style.paddingBottom = '${bottomPadding}px'; document.body.style.paddingLeft = '${horizontalPadding}px'; document.body.style.paddingRight = '${horizontalPadding}px'; })();") view?.injectLightDarkModeCss(isSystemInDarkTheme) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/about/AboutMaterialComponentsScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/about/AboutMaterialComponentsScreen.kt index af498f242..d74f91f86 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/about/AboutMaterialComponentsScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/about/AboutMaterialComponentsScreen.kt @@ -146,7 +146,9 @@ import androidx.compose.ui.tooling.preview.PreviewLightDark import androidx.compose.ui.unit.dp import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets import com.orange.ouds.app.ui.utilities.listItemHorizontalPadding +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.theme.OudsTheme import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch @@ -167,7 +169,8 @@ fun AboutMaterialComponentsScreen() { modifier = Modifier .fillMaxSize() .verticalScroll(rememberScrollState()) - .padding(bottom = OudsTheme.spaces.fixed.medium) + .consumeTopBarsTopWindowInsets() + .padding(top = topBarsTopPadding, bottom = OudsTheme.spaces.fixed.medium) ) { // APP BARS diff --git a/app/src/main/java/com/orange/ouds/app/ui/about/AboutScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/about/AboutScreen.kt index c9f20034e..5b263ebd3 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/about/AboutScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/about/AboutScreen.kt @@ -22,11 +22,18 @@ import androidx.annotation.StringRes import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.asPaddingValues +import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.foundation.layout.only +import androidx.compose.foundation.layout.statusBars import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.ListItem import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext @@ -42,7 +49,9 @@ import com.orange.ouds.app.BuildConfig import com.orange.ouds.app.R import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets import com.orange.ouds.app.ui.utilities.listItemHorizontalPadding +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.component.OudsNavigationBarHeight import com.orange.ouds.core.theme.OudsTheme @@ -80,7 +89,13 @@ class AboutAppSettingsItem(id: Int, @StringRes labelRes: Int) : AboutMenuItem(id fun AboutScreen(onMenuItemClick: (id: Int) -> Unit) { val context = LocalContext.current Screen { - LazyColumn(modifier = Modifier.padding(bottom = OudsNavigationBarHeight)) { + LazyColumn( + modifier = Modifier.consumeTopBarsTopWindowInsets(), + contentPadding = PaddingValues( + top = topBarsTopPadding, + bottom = OudsTheme.spaces.fixed.medium + OudsNavigationBarHeight + ) + ) { item { val version = stringResource(R.string.app_about_version_label, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE.toLong()) val issueNumbers: IntArray? = BuildConfig.ISSUE_NUMBERS diff --git a/app/src/main/java/com/orange/ouds/app/ui/about/AboutVersionsScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/about/AboutVersionsScreen.kt index e3195ab87..9ad20f1e0 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/about/AboutVersionsScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/about/AboutVersionsScreen.kt @@ -13,11 +13,19 @@ package com.orange.ouds.app.ui.about import androidx.annotation.StringRes +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.asPaddingValues +import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.statusBars import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.ListItem import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -25,7 +33,9 @@ import androidx.compose.ui.tooling.preview.PreviewLightDark import com.orange.ouds.app.R import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets import com.orange.ouds.app.ui.utilities.listItemHorizontalPadding +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.theme.OudsTheme import com.orange.ouds.theme.OudsVersion import kotlin.reflect.full.declaredMemberProperties @@ -33,7 +43,13 @@ import kotlin.reflect.full.declaredMemberProperties @Composable fun AboutVersionsScreen() { Screen { - LazyColumn { + LazyColumn( + modifier = Modifier.consumeTopBarsTopWindowInsets(), + contentPadding = PaddingValues( + top = topBarsTopPadding, + bottom = OudsTheme.spaces.fixed.medium + ) + ) { item { VersionsSectionTitle(titleRes = R.string.app_about_versions_tokens_label) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/Component.kt b/app/src/main/java/com/orange/ouds/app/ui/components/Component.kt index dac14fe06..4e8a86fa6 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/Component.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/Component.kt @@ -33,6 +33,7 @@ import com.orange.ouds.app.ui.components.switch.SwitchItemDemoScreen import com.orange.ouds.app.ui.components.tag.InputTagDemoScreen import com.orange.ouds.app.ui.components.tag.TagDemoScreen import com.orange.ouds.app.ui.components.textinput.TextInputDemoScreen +import com.orange.ouds.app.ui.components.topappbar.TopAppBarDemoScreen import com.orange.ouds.app.ui.utilities.previewCompatibleClass val components = Component::class.sealedSubclasses.mapNotNull { it.objectInstance } @@ -135,6 +136,13 @@ sealed class Component( { TextInputIllustration() }, demoScreen = { TextInputDemoScreen() } ) + + data object TopAppBar : Component( + R.string.app_components_topAppBar_label, + R.string.app_components_topAppBar_description_text, + { TopAppBarIllustration() }, + demoScreen = { TopAppBarDemoScreen() } + ) } sealed class Variant( diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentCode.kt b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentCode.kt index fd33c5fac..29c3e96cf 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentCode.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentCode.kt @@ -13,7 +13,10 @@ package com.orange.ouds.app.ui.components import androidx.annotation.DrawableRes +import androidx.annotation.PluralsRes import androidx.annotation.StringRes +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.toArgb import com.orange.ouds.app.ui.utilities.Code import com.orange.ouds.app.ui.utilities.FunctionCall import com.orange.ouds.core.component.OudsColoredBoxColor @@ -36,11 +39,22 @@ fun FunctionCall.Builder.painterArgument(@DrawableRes id: Int) { } } +fun FunctionCall.Builder.colorArgument(name: String, color: Color) { + constructorCallArgument(name) { + isMultiline = false + rawArgument(null, "0x${color.toArgb().toHexString()}") + } +} + fun FunctionCall.Builder.stringArgument(name: String, @StringRes id: Int) = formattableArgument(name) { "\"${it.getString(id)}\"" } fun FunctionCall.Builder.contentDescriptionArgument(@StringRes id: Int) = stringArgument(Argument.ContentDescription, id) fun FunctionCall.Builder.contentDescriptionArgument(@StringRes id: Int, vararg formatArgs: Any) = - stringResourceArgument(Argument.ContentDescription, id, formatArgs) + stringResourceArgument(Argument.ContentDescription, id, *formatArgs) + +fun FunctionCall.Builder.contentDescriptionArgument(@PluralsRes id: Int, count: Int, vararg formatArgs: Any) = + pluralStringResourceArgument(Argument.ContentDescription, id, count, *formatArgs) + fun FunctionCall.Builder.enabledArgument(value: Boolean) = typedArgument(Argument.Enabled, value) diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentIllustrations.kt b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentIllustrations.kt index 98d6b5360..2f371ca12 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentIllustrations.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentIllustrations.kt @@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.input.rememberTextFieldState +import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.Modifier @@ -30,7 +31,6 @@ import androidx.compose.ui.unit.dp import com.orange.ouds.app.R import com.orange.ouds.app.ui.components.coloredbackground.ColoredBackgroundDemoStateDefaults import com.orange.ouds.app.ui.utilities.LocalThemeDrawableResources -import com.orange.ouds.app.ui.utilities.ThemeDrawableResources import com.orange.ouds.app.ui.utilities.composable.Illustration import com.orange.ouds.core.component.OudsBadge import com.orange.ouds.core.component.OudsBadgeSize @@ -51,6 +51,9 @@ import com.orange.ouds.core.component.OudsSwitch import com.orange.ouds.core.component.OudsTag import com.orange.ouds.core.component.OudsTagStatus import com.orange.ouds.core.component.OudsTextInput +import com.orange.ouds.core.component.OudsTopAppBar +import com.orange.ouds.core.component.OudsTopAppBarAction +import com.orange.ouds.core.component.OudsTopAppBarNavigationIcon import com.orange.ouds.core.theme.isOudsInDarkTheme @Composable @@ -192,6 +195,23 @@ fun TextInputIllustration() = ComponentIllustration { ) } +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun TopAppBarIllustration() = ComponentIllustration { + OudsTopAppBar( + modifier = Modifier.padding(horizontal = 12.dp), + title = stringResource(id = R.string.app_components_common_label_label), + navigationIcon = OudsTopAppBarNavigationIcon.Back {}, + actions = listOf( + OudsTopAppBarAction.Icon( + painter = painterResource(LocalThemeDrawableResources.current.tipsAndTricks), + contentDescription = "", + onClick = {} + ) + ) + ) +} + @Composable private fun ComponentIllustration(content: @Composable () -> Unit) { CompositionLocalProvider( diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentVariantsScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentVariantsScreen.kt index 5b96544f6..c6aab601e 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentVariantsScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentVariantsScreen.kt @@ -14,11 +14,18 @@ package com.orange.ouds.app.ui.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.asPaddingValues +import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.statusBars import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -28,13 +35,21 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.DetailScreenHeader import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.theme.OudsTheme import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider @Composable fun ComponentVariantsScreen(component: Component, onVariantClick: (id: Long) -> Unit) { Screen { - LazyColumn(contentPadding = PaddingValues(bottom = OudsTheme.spaces.fixed.medium)) { + LazyColumn( + modifier = Modifier.consumeTopBarsTopWindowInsets(), + contentPadding = PaddingValues( + top = topBarsTopPadding, + bottom = OudsTheme.spaces.fixed.medium + ) + ) { item { DetailScreenHeader( modifier = Modifier.padding(bottom = OudsTheme.spaces.fixed.medium), diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt index 2441e43fe..310326dc9 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/ComponentsScreen.kt @@ -14,9 +14,7 @@ package com.orange.ouds.app.ui.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll @@ -27,6 +25,8 @@ import androidx.compose.ui.tooling.preview.PreviewLightDark import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.LargeCard import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.component.OudsNavigationBarHeight import com.orange.ouds.core.theme.OudsTheme @@ -45,6 +45,8 @@ private fun ComponentsScreen(components: List, onComponentClick: (Lon modifier = Modifier .fillMaxSize() .verticalScroll(rememberScrollState()) + .consumeTopBarsTopWindowInsets() + .padding(top = topBarsTopPadding) .padding(vertical = OudsTheme.spaces.fixed.medium, horizontal = OudsTheme.grids.margin) .padding(bottom = OudsNavigationBarHeight), verticalArrangement = Arrangement.spacedBy(OudsTheme.spaces.fixed.medium) diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/coloredbackground/ColoredBackgroundDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/coloredbackground/ColoredBackgroundDemoScreen.kt index 8450f6f39..e4b319e8a 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/coloredbackground/ColoredBackgroundDemoScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/coloredbackground/ColoredBackgroundDemoScreen.kt @@ -126,18 +126,23 @@ private fun Code.Builder.coloredBackgroundDemoCodeSnippet(state: ColoredBackgrou trailingLambda = true typedArgument("color", color) lambdaArgument(null) { - functionCall("Text") { - typedArgument("text", color.name.toSentenceCase()) - rawArgument("color", "OudsTheme.colorScheme.content.default") - } - functionCall("OudsButton") { - labelArgument(R.string.app_components_button_label) - onClickArgument {} - } - functionCall("OudsLink") { - labelArgument(R.string.app_components_link_label) - typedArgument("arrow", OudsLinkArrow.Next) - onClickArgument {} + functionCall("Column") { + trailingLambda = true + lambdaArgument(null) { + functionCall("Text") { + typedArgument("text", color.name.toSentenceCase()) + rawArgument("color", "OudsTheme.colorScheme.content.default") + } + functionCall("OudsButton") { + labelArgument(R.string.app_components_button_label) + onClickArgument {} + } + functionCall("OudsLink") { + labelArgument(R.string.app_components_link_label) + typedArgument("arrow", OudsLinkArrow.Next) + onClickArgument {} + } + } } } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoScreen.kt index a79e42ec8..4b7e7b68d 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoScreen.kt @@ -13,7 +13,6 @@ package com.orange.ouds.app.ui.components.navigationbar import android.content.Context -import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.compose.foundation.layout.PaddingValues import androidx.compose.runtime.Composable @@ -25,6 +24,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewLightDark import com.orange.ouds.app.R import com.orange.ouds.app.ui.components.Component +import com.orange.ouds.app.ui.components.contentDescriptionArgument import com.orange.ouds.app.ui.components.labelArgument import com.orange.ouds.app.ui.components.navigationbar.NavigationBarDemoState.Companion.ItemBadgeCount import com.orange.ouds.app.ui.components.navigationbar.NavigationBarDemoState.Companion.MaxNavigationBarItemCount @@ -34,6 +34,7 @@ import com.orange.ouds.app.ui.utilities.Code import com.orange.ouds.app.ui.utilities.LocalThemeDrawableResources import com.orange.ouds.app.ui.utilities.ThemeDrawableResourceProvider import com.orange.ouds.app.ui.utilities.ThemeDrawableResources +import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.CustomizationFilterChips import com.orange.ouds.app.ui.utilities.composable.DemoScreen import com.orange.ouds.core.component.OudsNavigationBar @@ -41,7 +42,7 @@ import com.orange.ouds.core.component.OudsNavigationBarItem import com.orange.ouds.core.component.OudsNavigationBarItemBadge import com.orange.ouds.core.component.OudsNavigationBarItemIcon import com.orange.ouds.core.theme.OudsTheme -import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.theme.OudsVersion @Composable fun NavigationBarDemoScreen() { @@ -53,7 +54,8 @@ fun NavigationBarDemoScreen() { bottomSheetContent = { NavigationBarDemoBottomSheetContent(state = state) }, codeSnippet = { navigationBarDemoCodeSnippet(state = state, context = context, themeDrawableResources = themeDrawableResources) }, demoContent = { NavigationBarDemoContent(state = state) }, - demoContentPaddingValues = PaddingValues(horizontal = OudsTheme.spaces.fixed.none) + demoContentPaddingValues = PaddingValues(horizontal = OudsTheme.spaces.fixed.none), + version = OudsVersion.Component.Bar ) } @@ -87,9 +89,6 @@ private fun NavigationBarDemoContent(state: NavigationBarDemoState) { items = navigationBarItems.take(itemCount).mapIndexed { index, item -> val label = stringResource(id = item.labelRes) val isLastItem = index == itemCount - 1 - val standardBadgeContentDescription = stringResource(id = R.string.app_components_common_unreadNotificationsBadge_a11y) - val countBadgeContentDescription = - pluralStringResource(id = R.plurals.app_components_common_unreadMessageCountBadge_a11y, count = ItemBadgeCount, ItemBadgeCount) OudsNavigationBarItem( selected = selectedItemId == index, onClick = { selectedItemId = index }, @@ -98,9 +97,9 @@ private fun NavigationBarDemoContent(state: NavigationBarDemoState) { badge = if (isLastItem) { when (lastItemBadge) { NavigationBarDemoState.ItemBadge.None -> null - NavigationBarDemoState.ItemBadge.Standard -> OudsNavigationBarItemBadge(standardBadgeContentDescription) + NavigationBarDemoState.ItemBadge.Standard -> OudsNavigationBarItemBadge(stringResource(id = R.string.app_components_common_unreadNotificationsBadge_a11y)) NavigationBarDemoState.ItemBadge.Count -> OudsNavigationBarItemBadge( - contentDescription = countBadgeContentDescription, + contentDescription = pluralStringResource(id = R.plurals.app_components_common_unreadMessageCountBadge_a11y, count = ItemBadgeCount, ItemBadgeCount), count = ItemBadgeCount ) } @@ -130,6 +129,15 @@ private fun Code.Builder.navigationBarDemoCodeSnippet(state: NavigationBarDemoSt } if (isLastItem && lastItemBadge != NavigationBarDemoState.ItemBadge.None) { functionCallArgument("badge", OudsNavigationBarItemBadge::class.simpleName.orEmpty()) { + when (lastItemBadge) { + NavigationBarDemoState.ItemBadge.None -> {} + NavigationBarDemoState.ItemBadge.Standard -> contentDescriptionArgument(id = R.string.app_components_common_unreadNotificationsBadge_a11y) + NavigationBarDemoState.ItemBadge.Count -> contentDescriptionArgument( + id = R.plurals.app_components_common_unreadMessageCountBadge_a11y, + count = ItemBadgeCount, + ItemBadgeCount + ) + } if (lastItemBadge == NavigationBarDemoState.ItemBadge.Count) { typedArgument("count", ItemBadgeCount) } @@ -143,15 +151,15 @@ private fun Code.Builder.navigationBarDemoCodeSnippet(state: NavigationBarDemoSt } enum class NavigationBarItem(val iconResourceProvider: ThemeDrawableResourceProvider, @StringRes val labelRes: Int) { - Home( { it.home }, R.string.app_components_navigationBar_homeItem_label), - Notification( { it.notificationAlert }, R.string.app_components_navigationBar_notificationsItem_label), - Shop( { it.shop }, R.string.app_components_navigationBar_shopItem_label), - Account( { it.avatar }, R.string.app_components_navigationBar_accountItem_label), - Settings( { it.settings }, R.string.app_components_navigationBar_settingsItem_label), + Home({ it.home }, R.string.app_components_navigationBar_homeItem_label), + Notification({ it.notificationAlert }, R.string.app_components_navigationBar_notificationsItem_label), + Shop({ it.shop }, R.string.app_components_navigationBar_shopItem_label), + Account({ it.avatar }, R.string.app_components_navigationBar_accountItem_label), + Settings({ it.settings }, R.string.app_components_navigationBar_settingsItem_label), } @PreviewLightDark @Composable -private fun PreviewNavigationBarDemoScreen() = OudsPreview { +private fun PreviewNavigationBarDemoScreen() = AppPreview { NavigationBarDemoScreen() } \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoState.kt b/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoState.kt index 365b9e778..8e0f8b7e5 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoState.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/navigationbar/NavigationBarDemoState.kt @@ -66,7 +66,7 @@ class NavigationBarDemoState( var lastItemBadge: ItemBadge by mutableStateOf(lastItemBadge) enum class ItemBadge(@StringRes val labelRes: Int) { - None(R.string.app_components_navigationBar_itemBadgeNone_label), + None(R.string.app_components_common_none_label), Standard(R.string.app_components_badge_standardType_label), Count(R.string.app_components_badge_countType_label) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/tag/TagDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/tag/TagDemoScreen.kt index fd88a2079..b11609714 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/tag/TagDemoScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/tag/TagDemoScreen.kt @@ -40,7 +40,7 @@ import com.orange.ouds.app.ui.utilities.nestedName import com.orange.ouds.app.ui.utilities.toSentenceCase import com.orange.ouds.core.component.OudsTag import com.orange.ouds.core.component.OudsTagAppearance -import com.orange.ouds.core.component.OudsTagIcon +import com.orange.ouds.core.component.OudsTagAsset import com.orange.ouds.core.component.OudsTagLoader import com.orange.ouds.core.component.OudsTagSize import com.orange.ouds.core.component.OudsTagStatus @@ -156,7 +156,7 @@ private fun TagDemoContent(state: TagDemoState) { with(state) { val content: @Composable (OudsTagSize, Boolean) -> Unit = { size, visible -> val loader = if (hasLoader) OudsTagLoader(null) else null - val customIcon = OudsTagIcon.Custom(painter = painterResource(LocalThemeDrawableResources.current.tipsAndTricks)) + val icon = OudsTagAsset.Icon(painter = painterResource(LocalThemeDrawableResources.current.tipsAndTricks)) val alpha = if (visible) 1f else 0f OudsTag( modifier = Modifier.alpha(alpha), @@ -165,33 +165,33 @@ private fun TagDemoContent(state: TagDemoState) { status = when (status) { is OudsTagStatus.Neutral -> when (layout) { TagDemoState.Layout.TextOnly -> OudsTagStatus.Neutral() - TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Neutral(icon = OudsTagIcon.Bullet) - TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Neutral(icon = customIcon) + TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Neutral(asset = OudsTagAsset.Bullet) + TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Neutral(asset = icon) } is OudsTagStatus.Accent -> when (layout) { TagDemoState.Layout.TextOnly -> OudsTagStatus.Accent() - TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Accent(icon = OudsTagIcon.Bullet) - TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Accent(icon = customIcon) + TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Accent(asset = OudsTagAsset.Bullet) + TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Accent(asset = icon) } is OudsTagStatus.Positive -> when (layout) { TagDemoState.Layout.TextOnly -> OudsTagStatus.Positive() - TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Positive(icon = OudsTagIcon.Bullet) - TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Positive(icon = OudsTagIcon.Default) + TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Positive(asset = OudsTagAsset.Bullet) + TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Positive(asset = OudsTagAsset.Icon.Default) } is OudsTagStatus.Warning -> when (layout) { TagDemoState.Layout.TextOnly -> OudsTagStatus.Warning() - TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Warning(icon = OudsTagIcon.Bullet) - TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Warning(icon = OudsTagIcon.Default) + TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Warning(asset = OudsTagAsset.Bullet) + TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Warning(asset = OudsTagAsset.Icon.Default) } is OudsTagStatus.Negative -> when (layout) { TagDemoState.Layout.TextOnly -> OudsTagStatus.Negative() - TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Negative(icon = OudsTagIcon.Bullet) - TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Negative(icon = OudsTagIcon.Default) + TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Negative(asset = OudsTagAsset.Bullet) + TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Negative(asset = OudsTagAsset.Icon.Default) } is OudsTagStatus.Info -> when (layout) { TagDemoState.Layout.TextOnly -> OudsTagStatus.Info() - TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Info(icon = OudsTagIcon.Bullet) - TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Info(icon = OudsTagIcon.Default) + TagDemoState.Layout.TextAndBullet -> OudsTagStatus.Info(asset = OudsTagAsset.Bullet) + TagDemoState.Layout.TextAndIcon -> OudsTagStatus.Info(asset = OudsTagAsset.Icon.Default) } }, size = size, @@ -219,15 +219,15 @@ private fun Code.Builder.tagDemoCodeSnippet(state: TagDemoState, themeDrawableRe functionCallArgument("status", status::class.java.nestedName) { when (layout) { TagDemoState.Layout.TextOnly -> {} - TagDemoState.Layout.TextAndBullet -> typedArgument("icon", OudsTagIcon.Bullet) + TagDemoState.Layout.TextAndBullet -> typedArgument("asset", OudsTagAsset.Bullet) TagDemoState.Layout.TextAndIcon -> { when (status) { is OudsTagStatus.Neutral, is OudsTagStatus.Accent -> - constructorCallArgument("icon") { + constructorCallArgument("asset") { painterArgument(themeDrawableResources.tipsAndTricks) } is OudsTagStatus.Positive, is OudsTagStatus.Warning, is OudsTagStatus.Info, is OudsTagStatus.Negative -> - typedArgument("icon", OudsTagIcon.Default) + typedArgument("asset", OudsTagAsset.Icon.Default) } } } diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/topappbar/TopAppBarDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/topappbar/TopAppBarDemoScreen.kt new file mode 100644 index 000000000..e0258a472 --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/topappbar/TopAppBarDemoScreen.kt @@ -0,0 +1,274 @@ +/* + * 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.app.ui.components.topappbar + +import android.R.attr.label +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.pluralStringResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.PreviewLightDark +import com.orange.ouds.app.R +import com.orange.ouds.app.ui.components.Component +import com.orange.ouds.app.ui.components.colorArgument +import com.orange.ouds.app.ui.components.contentDescriptionArgument +import com.orange.ouds.app.ui.components.onClickArgument +import com.orange.ouds.app.ui.components.painterArgument +import com.orange.ouds.app.ui.components.topappbar.TopAppBarDemoState.Companion.ActionIconBadgeCount +import com.orange.ouds.app.ui.utilities.Code +import com.orange.ouds.app.ui.utilities.LocalThemeDrawableResources +import com.orange.ouds.app.ui.utilities.ThemeDrawableResources +import com.orange.ouds.app.ui.utilities.composable.AppPreview +import com.orange.ouds.app.ui.utilities.composable.CustomizationFilterChips +import com.orange.ouds.app.ui.utilities.composable.CustomizationSwitchItem +import com.orange.ouds.app.ui.utilities.composable.CustomizationTextField +import com.orange.ouds.app.ui.utilities.composable.DemoScreen +import com.orange.ouds.app.ui.utilities.nestedName +import com.orange.ouds.core.component.OudsCenterAlignedTopAppBar +import com.orange.ouds.core.component.OudsLargeTopAppBar +import com.orange.ouds.core.component.OudsMediumTopAppBar +import com.orange.ouds.core.component.OudsTopAppBar +import com.orange.ouds.core.component.OudsTopAppBarAction +import com.orange.ouds.core.component.OudsTopAppBarActionBadge +import com.orange.ouds.core.component.OudsTopAppBarNavigationIcon +import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.foundation.extensions.orElse +import com.orange.ouds.theme.OudsVersion + +@Composable +fun TopAppBarDemoScreen() { + val state = rememberTopAppBarDemoState() + val themeDrawableResources = LocalThemeDrawableResources.current + DemoScreen( + description = stringResource(id = Component.TopAppBar.descriptionRes), + bottomSheetContent = { TopAppBarDemoBottomSheetContent(state = state) }, + codeSnippet = { topAppBarDemoCodeSnippet(state = state, themeDrawableResources = themeDrawableResources) }, + demoContent = { TopAppBarDemoContent(state = state) }, + demoContentPaddingValues = PaddingValues(horizontal = OudsTheme.spaces.fixed.none), + version = OudsVersion.Component.Bar + ) +} + +@Composable +private fun TopAppBarDemoBottomSheetContent(state: TopAppBarDemoState) { + with(state) { + CustomizationFilterChips( + applyTopPadding = false, + label = stringResource(R.string.app_components_common_size_label), + chipLabels = TopAppBarDemoState.Size.entries.map { stringResource(it.labelRes) }, + selectedChipIndex = TopAppBarDemoState.Size.entries.indexOf(size), + onSelectionChange = { id -> size = TopAppBarDemoState.Size.entries[id] } + ) + CustomizationSwitchItem( + label = stringResource(R.string.app_components_topAppBar_centerAligned_label), + checked = centerAligned, + onCheckedChange = { centerAligned = it }, + enabled = centerAlignedSwitchEnabled + ) + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_topAppBar_navigationIcon_label), + chipLabels = TopAppBarDemoState.NavigationIcon.entries.map { stringResource(it.labelRes) }, + selectedChipIndex = TopAppBarDemoState.NavigationIcon.entries.indexOf(navigationIcon), + onSelectionChange = { id -> navigationIcon = TopAppBarDemoState.NavigationIcon.entries[id] } + ) + CustomizationTextField( + applyTopPadding = true, + label = stringResource(R.string.app_components_topAppBar_title_label), + value = title, + onValueChange = { value -> title = value } + ) + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_topAppBar_actionIconBadge_label), + chipLabels = TopAppBarDemoState.ActionIconBadge.entries.map { it.name }, + selectedChipIndex = TopAppBarDemoState.ActionIconBadge.entries.indexOf(actionIconBadge), + onSelectionChange = { id -> actionIconBadge = TopAppBarDemoState.ActionIconBadge.entries[id] } + ) + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_topAppBar_actionAvatar_label), + chipLabels = TopAppBarDemoState.ActionAvatar.entries.map { stringResource(it.labelRes) }, + selectedChipIndex = TopAppBarDemoState.ActionAvatar.entries.indexOf(actionAvatar), + onSelectionChange = { id -> actionAvatar = TopAppBarDemoState.ActionAvatar.entries[id] } + ) + CustomizationTextField( + applyTopPadding = true, + label = stringResource(R.string.app_components_topAppBar_actionAvatarMonogram_label), + value = actionAvatarMonogram.toString().trim(), + onValueChange = { value -> actionAvatarMonogram = value.firstOrNull().orElse { ' ' } }, + enabled = actionAvatarMonogramTextFieldEnabled + ) + } +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +private fun TopAppBarDemoContent(state: TopAppBarDemoState) { + val themeDrawableResources = LocalThemeDrawableResources.current + with(state) { + val navigationIcon = when (navigationIcon) { + TopAppBarDemoState.NavigationIcon.None -> null + TopAppBarDemoState.NavigationIcon.Back -> OudsTopAppBarNavigationIcon.Back(onClick = {}) + TopAppBarDemoState.NavigationIcon.Close -> OudsTopAppBarNavigationIcon.Close(onClick = {}) + TopAppBarDemoState.NavigationIcon.Menu -> OudsTopAppBarNavigationIcon.Menu(onClick = {}) + TopAppBarDemoState.NavigationIcon.Custom -> OudsTopAppBarNavigationIcon( + painter = painterResource(id = themeDrawableResources.tipsAndTricks), + contentDescription = stringResource(R.string.app_components_common_icon_a11y), + onClick = {} + ) + } + + val firstAction = OudsTopAppBarAction.Icon( + painter = painterResource(id = LocalThemeDrawableResources.current.tipsAndTricks), + contentDescription = stringResource(R.string.app_components_topAppBar_firstAction_a11y), + badge = when (actionIconBadge) { + TopAppBarDemoState.ActionIconBadge.None -> null + TopAppBarDemoState.ActionIconBadge.Standard -> OudsTopAppBarActionBadge(contentDescription = stringResource(id = R.string.app_components_common_unreadNotificationsBadge_a11y)) + TopAppBarDemoState.ActionIconBadge.Count -> OudsTopAppBarActionBadge( + contentDescription = pluralStringResource( + id = R.plurals.app_components_common_unreadMessageCountBadge_a11y, + count = ActionIconBadgeCount, + ActionIconBadgeCount + ), + count = ActionIconBadgeCount + ) + }, + onClick = {} + ) + val secondActionContentDescription = stringResource(R.string.app_components_topAppBar_secondAction_a11y) + val secondAction = when (actionAvatar) { + TopAppBarDemoState.ActionAvatar.Image -> OudsTopAppBarAction.Avatar( + painter = painterResource(id = R.drawable.il_top_app_bar_avatar), + contentDescription = secondActionContentDescription, + onClick = {} + ) + TopAppBarDemoState.ActionAvatar.Monogram -> OudsTopAppBarAction.Avatar( + monogram = actionAvatarMonogram, + color = Color.White, + backgroundColor = Color(0xff138126), + contentDescription = secondActionContentDescription, + onClick = {} + ) + } + val actions = listOf(firstAction, secondAction) + + when (size) { + TopAppBarDemoState.Size.Small -> { + if (centerAligned) { + OudsCenterAlignedTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } else { + OudsTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } + } + TopAppBarDemoState.Size.Medium -> { + OudsMediumTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } + TopAppBarDemoState.Size.Large -> { + OudsLargeTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } + } + } +} + +private fun Code.Builder.topAppBarDemoCodeSnippet(state: TopAppBarDemoState, themeDrawableResources: ThemeDrawableResources) { + with(state) { + val functionName = when (size) { + TopAppBarDemoState.Size.Small -> if (centerAligned) "OudsCenterAlignedTopAppBar" else "OudsTopAppBar" + TopAppBarDemoState.Size.Medium -> "OudsMediumTopAppBar" + TopAppBarDemoState.Size.Large -> "OudsLargeTopAppBar" + } + functionCall(functionName) { + typedArgument("title", title) + val navigationIconClass = when (navigationIcon) { + TopAppBarDemoState.NavigationIcon.None -> null + TopAppBarDemoState.NavigationIcon.Back -> OudsTopAppBarNavigationIcon.Back::class.java + TopAppBarDemoState.NavigationIcon.Close -> OudsTopAppBarNavigationIcon.Close::class.java + TopAppBarDemoState.NavigationIcon.Menu -> OudsTopAppBarNavigationIcon.Menu::class.java + TopAppBarDemoState.NavigationIcon.Custom -> OudsTopAppBarNavigationIcon::class.java + } + if (navigationIconClass != null) { + functionCallArgument("navigationIcon", navigationIconClass.nestedName) { + trailingLambda = navigationIcon != TopAppBarDemoState.NavigationIcon.Custom + if (navigationIcon == TopAppBarDemoState.NavigationIcon.Custom) { + painterArgument(themeDrawableResources.tipsAndTricks) + contentDescriptionArgument(R.string.app_components_common_icon_a11y) + } + onClickArgument() + } + } + functionCallArgument("actions", "listOf") { + constructorCallArgument(null) { + painterArgument(themeDrawableResources.tipsAndTricks) + contentDescriptionArgument(R.string.app_components_topAppBar_firstAction_a11y) + if (actionIconBadge != TopAppBarDemoState.ActionIconBadge.None) { + functionCallArgument("badge", OudsTopAppBarActionBadge::class.simpleName.orEmpty()) { + when (actionIconBadge) { + TopAppBarDemoState.ActionIconBadge.None -> {} + TopAppBarDemoState.ActionIconBadge.Standard -> contentDescriptionArgument(id = R.string.app_components_common_unreadNotificationsBadge_a11y) + TopAppBarDemoState.ActionIconBadge.Count -> contentDescriptionArgument( + id = R.plurals.app_components_common_unreadMessageCountBadge_a11y, + count = ActionIconBadgeCount, + ActionIconBadgeCount + ) + } + if (actionIconBadge == TopAppBarDemoState.ActionIconBadge.Count) { + typedArgument("count", ActionIconBadgeCount) + } + } + } + onClickArgument() + } + constructorCallArgument(null) { + when (actionAvatar) { + TopAppBarDemoState.ActionAvatar.Image -> { + painterArgument(R.drawable.il_top_app_bar_avatar) + } + TopAppBarDemoState.ActionAvatar.Monogram -> { + typedArgument("monogram", actionAvatarMonogram) + colorArgument("color", Color.White) + colorArgument("backgroundColor", Color(0xff138126)) + } + } + contentDescriptionArgument(R.string.app_components_topAppBar_secondAction_a11y) + onClickArgument() + } + } + } + } +} + +@PreviewLightDark +@Composable +private fun PreviewTopAppBarDemoScreen() = AppPreview { + TopAppBarDemoScreen() +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/topappbar/TopAppBarDemoState.kt b/app/src/main/java/com/orange/ouds/app/ui/components/topappbar/TopAppBarDemoState.kt new file mode 100644 index 000000000..9e985681b --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/topappbar/TopAppBarDemoState.kt @@ -0,0 +1,130 @@ +/* + * 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.app.ui.components.topappbar + +import androidx.annotation.StringRes +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.listSaver +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.runtime.setValue +import com.orange.ouds.app.R + +@Composable +fun rememberTopAppBarDemoState( + size: TopAppBarDemoState.Size = TopAppBarDemoState.Size.Small, + centerAligned: Boolean = false, + navigationIcon: TopAppBarDemoState.NavigationIcon = TopAppBarDemoState.NavigationIcon.None, + title: String = "Title", + actionIconBadge: TopAppBarDemoState.ActionIconBadge = TopAppBarDemoState.ActionIconBadge.None, + actionAvatar: TopAppBarDemoState.ActionAvatar = TopAppBarDemoState.ActionAvatar.Image, + actionAvatarMonogram: Char = 'A' +) = rememberSaveable(size, centerAligned, navigationIcon, title, actionIconBadge, actionAvatar, actionAvatarMonogram, saver = TopAppBarDemoState.Saver) { + TopAppBarDemoState(size, centerAligned, navigationIcon, title, actionIconBadge, actionAvatar, actionAvatarMonogram) +} + +class TopAppBarDemoState( + size: Size, + centerAligned: Boolean, + navigationIcon: NavigationIcon, + title: String, + actionIconBadge: ActionIconBadge, + actionAvatar: ActionAvatar, + actionAvatarMonogram: Char +) { + companion object { + + const val ActionIconBadgeCount = 1 + + val Saver = listSaver( + save = { state -> + with(state) { + listOf( + size, + centerAligned, + navigationIcon, + title, + actionIconBadge, + actionAvatar, + actionAvatarMonogram + ) + } + }, + restore = { list -> + TopAppBarDemoState( + list[0] as Size, + list[1] as Boolean, + list[2] as NavigationIcon, + list[3] as String, + list[4] as ActionIconBadge, + list[5] as ActionAvatar, + list[6] as Char + ) + } + ) + } + + private var _size: Size by mutableStateOf(size) + var size: Size + get() = _size + set(value) { + _size = value + if (value != Size.Small) { + centerAligned = false + } + } + + var centerAligned: Boolean by mutableStateOf(centerAligned) + + var navigationIcon: NavigationIcon by mutableStateOf(navigationIcon) + + var title: String by mutableStateOf(title) + + var actionIconBadge: ActionIconBadge by mutableStateOf(actionIconBadge) + + var actionAvatar: ActionAvatar by mutableStateOf(actionAvatar) + + var actionAvatarMonogram: Char by mutableStateOf(actionAvatarMonogram) + + val centerAlignedSwitchEnabled: Boolean + get() = size == Size.Small + + val actionAvatarMonogramTextFieldEnabled: Boolean + get() = actionAvatar == ActionAvatar.Monogram + + enum class Size(@StringRes val labelRes: Int) { + Small(R.string.app_components_topAppBar_smallSize_label), + Medium(R.string.app_components_topAppBar_mediumSize_label), + Large(R.string.app_components_topAppBar_largeSize_label) + } + + enum class NavigationIcon(@StringRes val labelRes: Int) { + None(R.string.app_components_common_none_label), + Back(R.string.app_components_topAppBar_backNavigationIcon_label), + Close(R.string.app_components_topAppBar_closeNavigationIcon_label), + Menu(R.string.app_components_topAppBar_menuNavigationIcon_label), + Custom(R.string.app_components_topAppBar_customNavigationIcon_label) + } + + enum class ActionIconBadge(@StringRes val labelRes: Int) { + None(R.string.app_components_common_none_label), + Standard(R.string.app_components_badge_standardType_label), + Count(R.string.app_components_badge_countType_label) + } + + enum class ActionAvatar(@StringRes val labelRes: Int) { + Image(R.string.app_components_topAppBar_imageActionAvatar_label), + Monogram(R.string.app_components_topAppBar_monogramActionAvatar_label) + } +} diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt index 2430bef76..634f694cb 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenCategoryDetailScreen.kt @@ -66,6 +66,8 @@ import com.orange.ouds.app.ui.utilities.composable.CodeSnippet import com.orange.ouds.app.ui.utilities.composable.DetailScreenHeader import com.orange.ouds.app.ui.utilities.composable.ImageIllustration import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.theme.OudsBorderStyle import com.orange.ouds.core.theme.OudsTheme import com.orange.ouds.core.theme.OudsTypography @@ -75,9 +77,14 @@ import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider @OptIn(ExperimentalFoundationApi::class) @Composable fun TokenCategoryDetailScreen(tokenCategory: TokenCategory<*>, onSubcategoryClick: (Long) -> Unit) { - Screen { - LazyColumn(contentPadding = PaddingValues(bottom = OudsTheme.spaces.fixed.medium)) { + LazyColumn( + modifier = Modifier.consumeTopBarsTopWindowInsets(), + contentPadding = PaddingValues( + top = topBarsTopPadding, + bottom = OudsTheme.spaces.fixed.medium + ) + ) { item { DetailScreenHeader( description = stringResource(id = tokenCategory.descriptionRes), diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt index e976d4b53..c36562a85 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokenProperty.kt @@ -14,6 +14,7 @@ package com.orange.ouds.app.ui.tokens import androidx.annotation.StringRes import androidx.compose.runtime.Composable +import androidx.compose.ui.text.TextStyle import com.orange.ouds.app.R import com.orange.ouds.app.ui.utilities.nestedName import com.orange.ouds.app.ui.utilities.previewCompatibleClass @@ -191,7 +192,11 @@ sealed class TokenProperty( data object Typography : TokenProperty( nameRes = null, - tokens = getTokens(), + tokens = getTokens { _, parameter -> + val parameterClass = parameter.type.classifier as KClass<*> + // Filter fontFamily property + return@getTokens parameterClass == TextStyle::class + }, categoryClass = TokenCategory.Typography::class ) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt index 387938888..b4fec239d 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/tokens/TokensScreen.kt @@ -27,6 +27,8 @@ import com.orange.ouds.app.ui.utilities.composable.AppPreview import com.orange.ouds.app.ui.utilities.composable.ImageIllustration import com.orange.ouds.app.ui.utilities.composable.LargeCard import com.orange.ouds.app.ui.utilities.composable.Screen +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.component.OudsNavigationBarHeight import com.orange.ouds.core.theme.OudsTheme @@ -45,6 +47,8 @@ private fun TokensScreen(tokenCategories: List>, onTokenCategor modifier = Modifier .fillMaxSize() .verticalScroll(rememberScrollState()) + .consumeTopBarsTopWindowInsets() + .padding(top = topBarsTopPadding) .padding(vertical = OudsTheme.spaces.fixed.medium, horizontal = OudsTheme.grids.margin) .padding(bottom = OudsNavigationBarHeight), verticalArrangement = Arrangement.spacedBy(OudsTheme.spaces.fixed.medium) diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/Code.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/Code.kt index c6e9d7728..c13a7155e 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/Code.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/Code.kt @@ -13,6 +13,7 @@ package com.orange.ouds.app.ui.utilities import android.content.Context +import androidx.annotation.PluralsRes import androidx.annotation.StringRes import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -99,21 +100,23 @@ data class Comment(val text: String, val isMultiline: Boolean) : Formattable { data class FunctionCall(val name: String, val elements: List, val isMultiline: Boolean, val trailingLambda: Boolean) : Formattable { override fun format(context: Context): String { - val isMultiline = isMultiline && elements.isNotEmpty() - val elementSeparator = if (isMultiline) "\n" else " " val lambda = elements.lastOrNull()?.asOrNull>()?.value?.asOrNull().takeIf { trailingLambda } val elements = if (lambda != null) elements.dropLast(1) else elements + val isMultiline = isMultiline && elements.isNotEmpty() + val elementSeparator = if (isMultiline) "\n" else " " val formattedElements = elements.joinToString(elementSeparator) { codeFormattable -> val elementSuffix = if (codeFormattable is Argument<*>) "," else "" "${codeFormattable.format(context)}$elementSuffix" } .removeSuffix(",") .run { if (isMultiline) prependIndent(CODE_INDENT) else this } + val openingParenthesis = if (elements.isEmpty() && trailingLambda) "" else "(" + val closingParenthesis = if (elements.isEmpty() && trailingLambda) "" else ")" val parenthesisSeparator = if (isMultiline) "\n" else "" val formattedLambda = if (lambda != null) " ${lambda.format(context)}" else "" - return "$name($parenthesisSeparator$formattedElements$parenthesisSeparator)$formattedLambda" + return "$name$openingParenthesis$parenthesisSeparator$formattedElements$parenthesisSeparator$closingParenthesis$formattedLambda" } @CodeDslMarker @@ -137,7 +140,11 @@ data class FunctionCall(val name: String, val elements: List, val i fun rawArgument(name: String?, value: String) = formattableArgument(name) { value } fun stringResourceArgument(name: String?, @StringRes id: Int, vararg formatArgs: Any) { - formattableArgument(name) { "\"${it.getString(id, formatArgs)}\"" } + formattableArgument(name) { "\"${it.getString(id, *formatArgs)}\"" } + } + + fun pluralStringResourceArgument(name: String?, @PluralsRes id: Int, count: Int, vararg formatArgs: Any) { + formattableArgument(name) { "\"${it.resources.getQuantityString(id, count, *formatArgs)}\"" } } fun lambdaArgument(name: String?, init: Code.Builder.() -> Unit = {}) { @@ -230,19 +237,24 @@ internal fun PreviewCode() = AppPreview { comment("click") { isMultiline = true } } } + comment("Single line argument") functionCallArgument("list", "listOf") { isMultiline = false - rawArgument(null, "OudsTheme.shapes") // Raw - stringResourceArgument(null, R.string.app_name) - typedArgument(null, "Text") // String - typedArgument(null, 1.234) // Double - comment("Comment") { isMultiline = true } - typedArgument(null, 1.234f) // Float - typedArgument(null, 1234) // Int - typedArgument(null, true) // Boolean - typedArgument(null, BottomBarItem.Tokens) // Enum - typedArgument(null, null) // null + rawArgument(null, "1") + rawArgument(null, "2") + rawArgument(null, "3") } + comment("Different types of arguments") + rawArgument("raw", "OudsTheme.shapes") + stringResourceArgument("stringResource", R.string.app_name) + pluralStringResourceArgument("pluralStringResource", R.plurals.app_components_common_unreadMessageCountBadge_a11y, 1, 1) + typedArgument("string", "Text") + typedArgument("double", 1.234) + typedArgument("float", 1.234f) + typedArgument("int", 1234) + typedArgument("boolean", true) + typedArgument("enum", BottomBarItem.Tokens) + typedArgument("null", null) lambdaArgument("content") { comment("Single line comment") functionCall("content") diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/ModifierExt.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/ModifierExt.kt index 5b78cfa06..4dafecf35 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/ModifierExt.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/ModifierExt.kt @@ -19,7 +19,14 @@ import androidx.compose.foundation.gestures.waitForUpOrCancellation import androidx.compose.foundation.indication import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.PressInteraction +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.asPaddingValues +import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.statusBars +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -34,6 +41,7 @@ import androidx.compose.ui.semantics.disabled import androidx.compose.ui.semantics.onClick import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.max import com.orange.ouds.core.theme.OudsTheme @@ -95,3 +103,10 @@ fun Modifier.priorityClickable( } } } + +@Composable +fun Modifier.consumeTopBarsTopWindowInsets() = consumeWindowInsets(WindowInsets.statusBars.only(WindowInsetsSides.Top)) + +val topBarsTopPadding: Dp + @Composable + get() = WindowInsets.statusBars.asPaddingValues().calculateTopPadding() + TopAppBarDefaults.TopAppBarExpandedHeight diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt index 8c1f35355..952d346a2 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationBottomSheet.kt @@ -60,6 +60,8 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.LifecycleResumeEffect import com.orange.ouds.app.R import com.orange.ouds.app.ui.utilities.LocalThemeDrawableResources +import com.orange.ouds.app.ui.utilities.consumeTopBarsTopWindowInsets +import com.orange.ouds.app.ui.utilities.topBarsTopPadding import com.orange.ouds.core.theme.OudsTheme import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope @@ -163,7 +165,9 @@ fun CustomizationBottomSheetScaffold( .fillMaxWidth() .verticalScroll(rememberScrollState()) .consumeWindowInsets(innerPadding) - .padding(innerPadding), + .padding(innerPadding) + .consumeTopBarsTopWindowInsets() + .padding(top = topBarsTopPadding), ) { content() } diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt index acac8a117..53c4f2afb 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/CustomizationElements.kt @@ -154,7 +154,7 @@ fun CustomizationTextField( CustomizationTextField( label = label, - value = textFieldValue, + value = textFieldValue.copy(text = value), onValueChange = { newTextFieldValue -> textFieldValue = newTextFieldValue onValueChange(newTextFieldValue.text) diff --git a/app/src/main/res/drawable/il_top_app_bar_avatar.jpg b/app/src/main/res/drawable/il_top_app_bar_avatar.jpg new file mode 100644 index 000000000..3c9aa51ce Binary files /dev/null and b/app/src/main/res/drawable/il_top_app_bar_avatar.jpg differ diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 8ff067fbb..bca0df1ef 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -14,7 +14,6 @@ DesignToolbox - رجوع نسخ الكود تم نسخ الكود إلى الحافظة مطوي @@ -119,6 +118,7 @@ التسمية التخطيط Loader + None على خلفية ملونة مخطط للقراءة فقط @@ -198,7 +198,6 @@ Navigation bars let people switch between UI views on smaller devices Item count Last item badge - None Home Shop Notifications @@ -239,6 +238,27 @@ Placeholder Helper link + + Top app bar + Top app bars display information and actions at the top of a screen. + First action + Second action + Small + Medium + Large + Center aligned + Navigation icon + Back + Close + Menu + Custom + Title + Action icon badge + Action avatar + Image + Monogram + Avatar monogram + أدوات نظام التصميم diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3f6b3576c..5e5b5bcec 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,7 +14,6 @@ DesignToolbox - Back Copy code Code copied to the clipboard OUDS code @@ -130,6 +129,7 @@ Label Layout Loader + None On colored background Outlined Read only @@ -204,10 +204,9 @@ Navigation bar - Navigation bars let people switch between UI views on smaller devices + Navigation bars let people switch between UI views on smaller devices. Item count Last item badge - None Home Shop Notifications @@ -248,6 +247,27 @@ Placeholder Helper link + + Top app bar + Top app bars display information and actions at the top of a screen. + First action + Second action + Small + Medium + Large + Center aligned + Navigation icon + Back + Close + Menu + Custom + Title + Action icon badge + Action avatar + Image + Monogram + Action avatar monogram + Design System Toolbox diff --git a/buildSrc/src/main/kotlin/com/orange/ouds/gradle/Component.kt b/buildSrc/src/main/kotlin/com/orange/ouds/gradle/Component.kt index f838873aa..195d4adf2 100644 --- a/buildSrc/src/main/kotlin/com/orange/ouds/gradle/Component.kt +++ b/buildSrc/src/main/kotlin/com/orange/ouds/gradle/Component.kt @@ -22,6 +22,7 @@ enum class Component { Chip, Divider, Link, + Bar, RadioButton, Switch, Tag, @@ -36,6 +37,7 @@ enum class Component { Component.Chip -> Chip Component.Divider -> Divider Component.Link -> Link + Component.Bar -> Bar Component.RadioButton -> RadioButton Component.Switch -> Switch Component.Tag -> Tag @@ -45,16 +47,17 @@ enum class Component { fun getSourceFilePaths(project: Project): List { val filenames = when (this) { - Component.Badge -> listOf("OudsBadge") - Component.Button -> listOf("OudsButton") - Component.Checkbox -> listOf("OudsCheckbox", "OudsCheckboxItem") - Component.Chip -> listOf("OudsFilterChip", "OudsSuggestionChip") - Component.Divider -> listOf("OudsDivider") - Component.Link -> listOf("OudsLink") - Component.RadioButton -> listOf("OudsRadioButton", "OudsRadioButtonItem") - Component.Switch -> listOf("OudsSwitch", "OudsSwitchItem") - Component.Tag -> listOf("OudsTag", "OudsInputTag") - Component.TextInput -> listOf("OudsTextInput") + Badge -> listOf("OudsBadge") + Button -> listOf("OudsButton") + Checkbox -> listOf("OudsCheckbox", "OudsCheckboxItem") + Chip -> listOf("OudsFilterChip", "OudsSuggestionChip") + Divider -> listOf("OudsDivider") + Link -> listOf("OudsLink") + Bar -> listOf("OudsNavigationBar", "OudsTopAppBar") + RadioButton -> listOf("OudsRadioButton", "OudsRadioButtonItem") + Switch -> listOf("OudsSwitch", "OudsSwitchItem") + Tag -> listOf("OudsTag", "OudsInputTag") + TextInput -> listOf("OudsTextInput") } return filenames.map { "${project.rootProject.projectDir}/core/src/main/java/com/orange/ouds/core/component/$it.kt" } diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsBadgeTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsBadgeTest.kt index 191e9e541..fc17726f3 100644 --- a/core-test/src/main/java/com/orange/ouds/core/test/OudsBadgeTest.kt +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsBadgeTest.kt @@ -49,5 +49,4 @@ class OudsBadgeTest { internal fun data() = OudsPreviewableComponent.Badge.WithIcon.parameters } } - } diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsButtonTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsButtonTest.kt index 5ec07d18a..17f0b3365 100644 --- a/core-test/src/main/java/com/orange/ouds/core/test/OudsButtonTest.kt +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsButtonTest.kt @@ -39,4 +39,18 @@ class OudsButtonTest { parameter = null, OudsComponentTestSuite.theme ) + + @RunWith(Parameterized::class) + class WithIconBadge(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.Button.WithIconBadge, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.Button.WithIconBadge.parameters + } + } } diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsComponentTestSuite.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsComponentTestSuite.kt index 0f1d1014e..952d583c2 100644 --- a/core-test/src/main/java/com/orange/ouds/core/test/OudsComponentTestSuite.kt +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsComponentTestSuite.kt @@ -24,7 +24,7 @@ import org.junit.runners.Suite OudsCheckboxTest::class, OudsColoredBoxTest::class, OudsFilterChipTest::class, - OudsHorizontalDividerTest::class, + OudsDividerTest::class, OudsInputTagTest::class, OudsLinkTest::class, OudsNavigationBarTest::class, @@ -36,7 +36,7 @@ import org.junit.runners.Suite OudsSwitchTest::class, OudsTagTest::class, OudsTextInputTest::class, - OudsVerticalDividerTest::class + OudsTopAppBarTest::class ) abstract class OudsComponentTestSuite { diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsDividerTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsDividerTest.kt new file mode 100644 index 000000000..5a48f4cf5 --- /dev/null +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsDividerTest.kt @@ -0,0 +1,50 @@ +/* + * 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.test + +import com.orange.ouds.core.utilities.OudsPreviewableComponent +import org.junit.experimental.runners.Enclosed +import org.junit.runner.RunWith +import org.junit.runners.Parameterized + +@RunWith(Enclosed::class) +class OudsDividerTest() { + + @RunWith(Parameterized::class) + class Horizontal(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.Divider.Horizontal, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.Divider.Horizontal.parameters + } + } + + @RunWith(Parameterized::class) + class Vertical(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.Divider.Vertical, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.Divider.Vertical.parameters + } + } +} diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsHorizontalDividerTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsHorizontalDividerTest.kt deleted file mode 100644 index fd2541952..000000000 --- a/core-test/src/main/java/com/orange/ouds/core/test/OudsHorizontalDividerTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.test - -import com.orange.ouds.core.utilities.OudsPreviewableComponent -import org.junit.runner.RunWith -import org.junit.runners.Parameterized - -@RunWith(Parameterized::class) -class OudsHorizontalDividerTest(parameter: Any) : OudsComponentSnapshotTest( - OudsPreviewableComponent.HorizontalDivider, - parameter, - OudsComponentTestSuite.theme -) { - - companion object { - @JvmStatic - @Parameterized.Parameters - internal fun data() = OudsPreviewableComponent.HorizontalDivider.parameters - } -} diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsTopAppBarTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsTopAppBarTest.kt new file mode 100644 index 000000000..57ad85089 --- /dev/null +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsTopAppBarTest.kt @@ -0,0 +1,79 @@ +/* + * 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.test + +import com.orange.ouds.core.utilities.OudsPreviewableComponent +import org.junit.experimental.runners.Enclosed +import org.junit.runner.RunWith +import org.junit.runners.Parameterized + + +@RunWith(Enclosed::class) +class OudsTopAppBarTest() { + + @RunWith(Parameterized::class) + class Default(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.TopAppBar.Default, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.TopAppBar.Default.parameters + } + } + + @RunWith(Parameterized::class) + class CenterAligned(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.TopAppBar.CenterAligned, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.TopAppBar.CenterAligned.parameters + } + } + + @RunWith(Parameterized::class) + class Medium(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.TopAppBar.Medium, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.TopAppBar.Medium.parameters + } + } + + @RunWith(Parameterized::class) + class Large(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.TopAppBar.Large, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.TopAppBar.Large.parameters + } + } +} diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsVerticalDividerTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsVerticalDividerTest.kt deleted file mode 100644 index 5965c7a89..000000000 --- a/core-test/src/main/java/com/orange/ouds/core/test/OudsVerticalDividerTest.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.test - -import com.orange.ouds.core.utilities.OudsPreviewableComponent -import org.junit.runner.RunWith -import org.junit.runners.Parameterized - -@RunWith(Parameterized::class) -class OudsVerticalDividerTest(parameter: Any) : OudsComponentSnapshotTest( - OudsPreviewableComponent.VerticalDivider, - parameter, - OudsComponentTestSuite.theme -) { - - companion object { - @JvmStatic - @Parameterized.Parameters - internal fun data() = OudsPreviewableComponent.VerticalDivider.parameters - } -} diff --git a/core/build.gradle.kts b/core/build.gradle.kts index d89068ad7..f4b5ed76c 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -51,6 +51,7 @@ dependencies { implementation(libs.androidx.constraintlayout.compose) implementation(libs.material) + testImplementation(project(":core-test")) testImplementation(project(":theme-orange")) androidTestImplementation(project(":theme-orange")) androidTestImplementation(libs.androidx.compose.ui.test.junit4) diff --git a/core/src/androidTest/java/com/orange/ouds/core/component/OudsTopAppBarTest.kt b/core/src/androidTest/java/com/orange/ouds/core/component/OudsTopAppBarTest.kt new file mode 100644 index 000000000..f97e0d935 --- /dev/null +++ b/core/src/androidTest/java/com/orange/ouds/core/component/OudsTopAppBarTest.kt @@ -0,0 +1,103 @@ +/* + * 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 + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.AccountCircle +import androidx.compose.material.icons.filled.Home +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.onNodeWithContentDescription +import androidx.compose.ui.test.performClick +import androidx.compose.ui.unit.dp +import com.orange.ouds.core.extension.setOudsContent +import com.orange.ouds.core.utilities.PreviewCheckerboardPainter +import org.junit.Rule +import org.junit.Test +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify + +class OudsTopAppBarTest { + + @get:Rule + val composeTestRule = createComposeRule() + + @OptIn(ExperimentalMaterial3Api::class) + @Test + fun oudsTopAppBar_navigationIconClick_succeeds() { + with(composeTestRule) { + val navigationIconContentDescription = "Navigation icon content description" + val onClick = mock<() -> Unit>() + + setOudsContent { + OudsTopAppBar( + title = "Title", + navigationIcon = OudsTopAppBarNavigationIcon( + imageVector = Icons.Filled.Home, + contentDescription = navigationIconContentDescription, + onClick = onClick + ) + ) + } + + onNodeWithContentDescription(navigationIconContentDescription).performClick() + verify(onClick).invoke() + } + } + + @OptIn(ExperimentalMaterial3Api::class) + @Test + fun oudsTopAppBar_actionClick_succeeds() { + with(composeTestRule) { + val onIconClick = mock<() -> Unit>() + val iconContentDescription = "Icon content description" + val onImageAvatarClick = mock<() -> Unit>() + val imageAvatarContentDescription = "Image avatar content description" + val onMonogramAvatarClick = mock<() -> Unit>() + val monogramAvatarContentDescription = "Monogram avatar content description" + + setOudsContent { + OudsTopAppBar( + title = "Title", + actions = listOf( + OudsTopAppBarAction.Icon( + imageVector = Icons.Filled.AccountCircle, + contentDescription = iconContentDescription, + onClick = onIconClick + ), + OudsTopAppBarAction.Avatar( + painter = PreviewCheckerboardPainter(4.dp, Color.White, Color.Black), + contentDescription = imageAvatarContentDescription, + onClick = onImageAvatarClick + ), + OudsTopAppBarAction.Avatar( + monogram = 'A', + color = Color.White, + backgroundColor = Color.Black, + contentDescription = monogramAvatarContentDescription, + onClick = onMonogramAvatarClick + ) + ) + ) + } + + onNodeWithContentDescription(iconContentDescription).performClick() + verify(onIconClick).invoke() + onNodeWithContentDescription(imageAvatarContentDescription).performClick() + verify(onImageAvatarClick).invoke() + onNodeWithContentDescription(monogramAvatarContentDescription).performClick() + verify(onMonogramAvatarClick).invoke() + } + } +} diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsBadge.kt b/core/src/main/java/com/orange/ouds/core/component/OudsBadge.kt index 9b5da1ec7..408130807 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsBadge.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsBadge.kt @@ -42,6 +42,7 @@ import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.LineHeightStyle +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.Dp @@ -253,7 +254,9 @@ private fun OudsBadge( modifier = Modifier.clearAndSetSemantics {}, text = text, color = contentColor, - style = textStyle + style = textStyle, + maxLines = 1, + overflow = TextOverflow.Ellipsis ) } } @@ -356,7 +359,7 @@ const val OudsBadgeMaxCount = 99 */ open class OudsBadgeIcon internal constructor( graphicsObjectProvider: @Composable (OudsBadgeIcon) -> Any, -) : OudsComponentIcon(ExtraParameters::class.java, graphicsObjectProvider, "") { +) : OudsComponentIcon(ExtraParameters::class.java, graphicsObjectProvider, { "" }) { @ConsistentCopyVisibility data class ExtraParameters internal constructor( diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsBadgedIcon.kt b/core/src/main/java/com/orange/ouds/core/component/OudsBadgedIcon.kt new file mode 100644 index 000000000..4664b7bfc --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/OudsBadgedIcon.kt @@ -0,0 +1,179 @@ +/* + * 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 + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxScope +import androidx.compose.foundation.layout.IntrinsicSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.requiredWidth +import androidx.compose.foundation.layout.size +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.FavoriteBorder +import androidx.compose.material3.BadgedBox +import androidx.compose.material3.Icon +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.onSizeChanged +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.semantics.clearAndSetSemantics +import androidx.compose.ui.tooling.preview.PreviewLightDark +import androidx.compose.ui.tooling.preview.PreviewParameter +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.unit.IntSize +import androidx.compose.ui.unit.LayoutDirection +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.isUnspecified +import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.core.theme.outerBorder +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.getPreviewTheme +import com.orange.ouds.foundation.extensions.orElse +import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider +import com.orange.ouds.theme.OudsThemeContract + +/** + * An OUDS equivalent of the Material [BadgedBox] which is restricted to icons. + * Please note that the size of the [OudsBadgedIcon] must be explicitly set to the size of the contained icon, + * otherwise the size of the [OudsBadgedIcon] may be bigger than expected when the badge is displayed outside of the icon. + * + * @param modifier The Modifier to be applied to this [OudsBadgedIcon]. + * @param badgeCount The badge count. + * @param badgeBorderColor The badge border color. + * @param badgeMaximumEndOverflow The maximum amount of space that the badge can overflow to the end of the icon. + * This allows to constrain the badge layout when space is limited, for instance in an [OudsButton]. + * @param icon The icon to be displayed. + */ +@Composable +internal fun OudsBadgedIcon( + modifier: Modifier = Modifier, + badgeCount: Int? = null, + badgeBorderColor: Color = Color.Unspecified, + badgeMaximumEndOverflow: Dp = Dp.Unspecified, + icon: @Composable BoxScope.() -> Unit +) { + Box(modifier = modifier) { + icon() + val badgeMaximumEndOverflowPx = with(LocalDensity.current) { badgeMaximumEndOverflow.toPx() } + var badgeSize by remember { mutableStateOf(IntSize.Zero) } + val badgeModifier = Modifier + .requiredWidth(IntrinsicSize.Min) // This allows to make the badge bigger than it's parent box if needed + // We should use the first IntSize parameter of the align lambda below to retrieve the badge size + // but the value is incorrect and coerced to the parent size when the badge is bigger than it's parent + // That is why we retrieve the icon badge size using the onSizeChanged modifier + .onSizeChanged { badgeSize = it } + .align { _, parentSize, layoutDirection -> + // Important: hypothesis for the calculations below is that the box content alignment is equal to Alignment.TopStart + // Note: parentSize is equal to icon size + if (badgeCount == null) { + val xOffset = if (layoutDirection == LayoutDirection.Ltr) parentSize.width - badgeSize.width else 0 + IntOffset(x = xOffset, y = 0) + } else { + // Compose layouts the badge differently if its width is bigger than the icon width or not + val initialXOffset = if (badgeSize.width > parentSize.width) (parentSize.width - badgeSize.width) / 2 else 0 + + val xOffset = when { + // 1. Badge has enough space to be displayed at it's expected location + // i.e. start at the horizontal center of the icon and bottom at the vertical center of the icon + badgeMaximumEndOverflow.isUnspecified || (badgeSize.width < parentSize.width / 2 + badgeMaximumEndOverflowPx.toInt()) -> if (layoutDirection == LayoutDirection.Ltr) { + -initialXOffset + parentSize.width / 2 + } else { + -initialXOffset + parentSize.width / 2 - badgeSize.width + } + // 2. Badge does not have enough space to be displayed at it's expected location + // There are two cases: + // 2.1. Badge width is bigger than the icon width + // In that case Compose layouts the badge so that the horizontal center of the badge is the same as the horizontal center of the icon + // i.e. The initial offset of the badge is equal to (parentSize.width - badgeSize.width) / 2 in LTR + badgeSize.width > parentSize.width -> if (layoutDirection == LayoutDirection.Ltr) { + initialXOffset + badgeMaximumEndOverflowPx.toInt() + } else { + -initialXOffset - badgeMaximumEndOverflowPx.toInt() + } + // 2.2. Badge width is smaller than the icon width + // In that case Compose layouts the badge so that it starts at the start of the icon + else -> if (layoutDirection == LayoutDirection.Ltr) { + parentSize.width + badgeMaximumEndOverflowPx.toInt() - badgeSize.width + } else { + -badgeMaximumEndOverflowPx.toInt() + } + } + IntOffset(x = xOffset, y = parentSize.height / 2 - badgeSize.height) + } + } + .outerBorder(1.dp, color = badgeBorderColor, shape = OudsBadgeShape, innerOffsetPx = -1f) + .clearAndSetSemantics {} + + val status = OudsBadgeStatus.Negative // A badge always has a negative status on an icon + badgeCount?.let { + OudsBadge(modifier = badgeModifier, count = badgeCount, status = status, size = OudsBadgeSize.Medium) + }.orElse { + OudsBadge(modifier = badgeModifier, status = status, size = OudsBadgeSize.ExtraSmall) + } + } +} + +@PreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsBadgedIcon(@PreviewParameter(OudsBadgedIconPreviewParameterProvider::class) parameter: OudsBadgedIconPreviewParameter) { + PreviewOudsBadgedIcon(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsBadgedIcon( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsBadgedIconPreviewParameter +) = OudsPreview(theme = theme, modifier = Modifier.padding(8.dp), darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + val size = 26.dp + OudsBadgedIcon( + modifier = Modifier.size(size), + badgeCount = badgeCount, + badgeBorderColor = badgeBorderColor, + badgeMaximumEndOverflow = badgeMaximumEndOverflow + ) { + Icon( + modifier = Modifier.size(size), + imageVector = Icons.Filled.FavoriteBorder, + contentDescription = "", + tint = OudsTheme.colorScheme.content.default + ) + } + } +} + +internal data class OudsBadgedIconPreviewParameter( + val badgeCount: Int? = null, + val badgeBorderColor: Color = Color.Unspecified, + val badgeMaximumEndOverflow: Dp = Dp.Unspecified +) + +internal class OudsBadgedIconPreviewParameterProvider : BasicPreviewParameterProvider(*previewParameterValues.toTypedArray()) + +private val previewParameterValues: List + get() = listOf( + OudsBadgedIconPreviewParameter(badgeBorderColor = Color.White), + OudsBadgedIconPreviewParameter(badgeCount = 1), // Case 1 when computing x offset + OudsBadgedIconPreviewParameter(badgeCount = 100), // Case 1 when computing x offset + OudsBadgedIconPreviewParameter(badgeCount = 100, badgeBorderColor = Color.White, badgeMaximumEndOverflow = 8.dp), // Case 2.1 when computing x offset + OudsBadgedIconPreviewParameter(badgeCount = 20, badgeMaximumEndOverflow = 8.dp), // Case 2.2 when computing x offset + ) diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsButton.kt b/core/src/main/java/com/orange/ouds/core/component/OudsButton.kt index 7b8a94123..7005a87b8 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsButton.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsButton.kt @@ -22,6 +22,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.calculateEndPadding import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -41,6 +42,8 @@ import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.contentDescription @@ -245,7 +248,7 @@ fun OudsButton( @Composable @JvmName("OudsButtonNullableIconAndLabel") -private fun OudsButton( +internal fun OudsButton( nullableIcon: OudsButtonIcon?, nullableLabel: String?, onClick: () -> Unit, @@ -253,6 +256,7 @@ private fun OudsButton( enabled: Boolean = true, loader: OudsButtonLoader? = null, appearance: OudsButtonAppearance = OudsButtonDefaults.Appearance, + iconOnlyBadge: OudsButtonIconBadge? = null, interactionSource: MutableInteractionSource? = null ) { val icon = nullableIcon @@ -326,23 +330,54 @@ private fun OudsButton( } val alpha = if (state == OudsButtonState.Loading) 0f else 1f + val paddingValues = contentPadding(icon = icon, label = label) Row( modifier = Modifier .alpha(alpha = alpha) - .padding(contentPadding(icon = icon, label = label)), + .padding(paddingValues), horizontalArrangement = Arrangement.spacedBy(buttonTokens.spaceColumnGapIcon.value), verticalAlignment = Alignment.CenterVertically ) { if (icon != null) { val size = if (label == null) buttonTokens.sizeIconOnly else buttonTokens.sizeIcon - icon.Content( - modifier = Modifier - .size(size.value * iconScale) - .semantics { - contentDescription = if (label == null) icon.contentDescription else "" - }, - extraParameters = OudsButtonIcon.ExtraParameters(tint = contentColor.value) - ) + val iconContent: @Composable () -> Unit = { + icon.Content( + modifier = Modifier + .size(size.value * iconScale) + .semantics { + contentDescription = when { + // Ugly workaround to make TalkBack read badge and icon content descriptions correctly + label == null && iconOnlyBadge != null -> "${iconOnlyBadge.contentDescription}, ${icon.contentDescription}" + label == null -> icon.contentDescription + else -> "" + } + }, + extraParameters = OudsButtonIcon.ExtraParameters(tint = contentColor.value) + ) + } + + if (iconOnlyBadge != null && label == null) { + val buttonEndPadding = paddingValues.calculateEndPadding(LocalLayoutDirection.current) + val maximumBorderWidth = OudsButtonAppearance.entries.flatMap { appearance -> + OudsButtonState.entries.mapNotNull { state -> + borderWidth(appearance, state) + } + }.maxOrNull().orElse { 0.dp } + val maximumEndOverflow = with(LocalDensity.current) { + val iconBadgeEndPadding = OudsTheme.spaces.paddingInline.fourExtraSmall + return@with buttonEndPadding - maximumBorderWidth - iconBadgeEndPadding + } + OudsBadgedIcon( + modifier = Modifier.size(size.value * iconScale), + badgeCount = iconOnlyBadge.count, + badgeBorderColor = iconOnlyBadge.borderColor, + badgeMaximumEndOverflow = maximumEndOverflow, + ) { + iconContent() + } + } else { + iconContent() + } } if (label != null) { Text( @@ -724,6 +759,8 @@ enum class OudsButtonAppearance { */ data class OudsButtonLoader(val progress: Float?) +internal data class OudsButtonIconBadge(val contentDescription: String, val borderColor: Color, val count: Int? = null) + internal enum class OudsButtonState { Enabled, Hovered, Pressed, Loading, Disabled, Focused } @@ -746,7 +783,12 @@ internal fun PreviewOudsButton( val icon = if (hasIcon) OudsButtonIcon(Icons.Filled.FavoriteBorder, "") else null val content: @Composable () -> Unit = { PreviewEnumEntries(columnCount = 2) { - OudsButton(nullableIcon = icon, nullableLabel = label, onClick = {}, appearance = appearance) + OudsButton( + nullableIcon = icon, + nullableLabel = label, + onClick = {}, + appearance = appearance + ) } } if (onColoredBox) { @@ -768,7 +810,7 @@ private fun PreviewOudsButtonWithRoundedCorners() = PreviewOudsButtonWithRounded internal fun PreviewOudsButtonWithRoundedCorners(theme: OudsThemeContract) = OudsPreview(theme = theme.mapSettings { it.copy(roundedCornerButtons = true) }) { val appearance = OudsButtonAppearance.Default - PreviewEnumEntries(columnCount = 2) { state -> + PreviewEnumEntries(columnCount = 2) { OudsButton( nullableIcon = OudsButtonIcon(Icons.Filled.FavoriteBorder, ""), nullableLabel = appearance.name, @@ -778,6 +820,25 @@ internal fun PreviewOudsButtonWithRoundedCorners(theme: OudsThemeContract) = } } +@Preview +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsButtonWithIconBadge(@PreviewParameter(OudsButtonWithIconBadgePreviewParameterProvider::class) count: Int) = + PreviewOudsButtonWithIconBadge(theme = getPreviewTheme(), count = count) + +@Composable +internal fun PreviewOudsButtonWithIconBadge(theme: OudsThemeContract, count: Int) = OudsPreview(theme = theme) { + PreviewEnumEntries(columnCount = 2) { + OudsButton( + nullableIcon = OudsButtonIcon(Icons.Filled.FavoriteBorder, ""), + nullableLabel = null, + onClick = {}, + appearance = OudsButtonAppearance.Minimal, + iconOnlyBadge = OudsButtonIconBadge("", OudsTheme.componentsTokens.bar.colorBorderBadge.value, count = count) + ) + } +} + internal data class OudsButtonPreviewParameter( val appearance: OudsButtonAppearance, val hasLabel: Boolean, @@ -799,3 +860,5 @@ private val previewParameterValues: List addAll(parameters.map { it.copy(onColoredBox = true) }) } } + +internal class OudsButtonWithIconBadgePreviewParameterProvider : BasicPreviewParameterProvider(1, OudsBadgeMaxCount + 1) diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsNavigationBar.kt b/core/src/main/java/com/orange/ouds/core/component/OudsNavigationBar.kt index 85ed20e8f..d351750d4 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsNavigationBar.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsNavigationBar.kt @@ -12,7 +12,6 @@ package com.orange.ouds.core.component -import android.os.Build import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.spring import androidx.compose.animation.fadeIn @@ -24,8 +23,6 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.offset -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.selection.selectable import androidx.compose.foundation.shape.RoundedCornerShape @@ -36,7 +33,6 @@ import androidx.compose.material.icons.filled.DateRange import androidx.compose.material.icons.filled.Email import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.filled.Star -import androidx.compose.material3.BadgedBox import androidx.compose.material3.LocalRippleConfiguration import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarDefaults @@ -86,24 +82,28 @@ import com.orange.ouds.theme.OudsThemeContract */ val OudsNavigationBarHeight = 80.dp -//TODO add DSM link when available: * **OUDS Navigation bar design guidelines** +//TODO update DSM link when available /** * The navigation bar lets people switch between UI views on smaller devices. * It offers a persistent and convenient way to switch between primary destinations in an app. * * [OudsNavigationBar] should contain three to five [OudsNavigationBarItem], each representing a singular destination. * - * [OudsNavigationBar] default appearance is opaque but, if you need a **translucent blurred navigation bar** (supported from Android 13) as specified on OUDS design + * [OudsNavigationBar] default appearance is opaque but, if you need a **translucent blurred navigation bar** as specified on OUDS design * side, you can implement it in your app with the help of [Haze](https://chrisbanes.github.io/haze/latest/) library. To do this, use [OudsNavigationBar] with * [translucent] parameter set to true and follow these steps: * 1. Add Haze dependency * 2. Follow Haze basic usage instructions: * - Define Haze state in the screen containing the navigation bar: `val hazeState = rememberHazeState()` - * - Use `hazeEffect` Modifier on [OudsNavigationBar] providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.components.navigationBar.blurRadius.dp)),` + * - Use `hazeEffect` Modifier on [OudsNavigationBar] providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.components.bar.blurRadius.dp)),` * - Apply `hazeSource` Modifier on the content that scrolls behind the navigation bar: `Modifier.hazeSource(state = hazeState)` * 3. As your screen content needs to scroll behind the navigation bar, you'll probably need to add an additional bottom padding * that will have the height of [OudsNavigationBar]. For this, please use [OudsNavigationBarHeight] constant. * + * > Design guidelines: [unified-design-system.orange.com](https://unified-design-system.orange.com) + * + * > Design version: 1.0.0 + * * @param items List of [OudsNavigationBarItem] to display in the navigation bar. * @param modifier [Modifier] applied to the navigation bar. * @param translucent Whether the navigation bar should be translucent. @@ -121,14 +121,13 @@ fun OudsNavigationBar( with(OudsTheme.componentsTokens.bar) { NavigationBar( modifier = modifier, - containerColor = Color.Transparent, // Background color is handled by the Row in content + containerColor = if (translucent) colorBgTranslucent.value else colorBgOpaque.value, contentColor = colorContentUnselectedEnabled.value, windowInsets = windowInsets, content = { val topBorderColor = OudsTheme.colorScheme.border.minimal Row( - modifier - .background(color = if (translucent && Build.VERSION.SDK_INT > Build.VERSION_CODES.S_V2) colorBgTranslucent.value else colorBgOpaque.value) + modifier = Modifier .drawBehind { val topBorderWidth = 1.dp.toPx() drawLine( @@ -243,8 +242,10 @@ data class OudsNavigationBarItem( onClick = onClick, icon = { if (badge != null) { - BadgedBox( - badge = { badge.Content() }, + OudsBadgedIcon( + modifier = Modifier.size(OudsNavigationBarItemIcon.Size), + badgeCount = badge.count, + badgeBorderColor = OudsTheme.componentsTokens.bar.colorBorderBadge.value ) { icon.Content() } @@ -378,34 +379,7 @@ class OudsNavigationBarItemIcon private constructor( * @property contentDescription Content description of the badge, needed for accessibility support (vocalized by Talkback). * @property count Optional number displayed in the badge. If not null, the badge has an [OudsBadgeSize.Medium] size. Otherwise, it has an [OudsBadgeSize.ExtraSmall] size. */ -class OudsNavigationBarItemBadge(val contentDescription: String, val count: Int? = null) : OudsComponentContent(Nothing::class.java) { - - @Composable - override fun Content(modifier: Modifier) { - val status = OudsBadgeStatus.Negative // In a navigation bar a badge has always a negative status. - val positionModifier = if (count != null) { - Modifier - } else { - val startPosition = OudsNavigationBarItemIcon.Size / 2 - val badgeSize = OudsTheme.componentsTokens.badge.sizeXsmall.dp - val xOffset = startPosition - badgeSize - val yOffset = (startPosition - badgeSize) + 2.dp - Modifier.offset(x = xOffset, y = -yOffset) - } - - Box( - modifier = positionModifier - .background(color = OudsTheme.componentsTokens.bar.colorBorderBadge.value, shape = OudsBadgeShape) - .padding(1.dp) - ) { - count?.let { - OudsBadge(count = count, modifier = modifier, status = status, size = OudsBadgeSize.Medium) - }.orElse { - OudsBadge(modifier = modifier, status = status, size = OudsBadgeSize.ExtraSmall) - } - } - } -} +data class OudsNavigationBarItemBadge(val contentDescription: String, val count: Int? = null) internal enum class OudsNavigationBarItemState { Enabled, Hovered, Pressed, Focused @@ -414,7 +388,7 @@ internal enum class OudsNavigationBarItemState { @PreviewLightDark @Composable @Suppress("PreviewShouldNotBeCalledRecursively") -internal fun PreviewOudsNavigationBar(@PreviewParameter(OudsNavigationBarPreviewParameterProvider::class) itemCount: Int) { +private fun PreviewOudsNavigationBar(@PreviewParameter(OudsNavigationBarPreviewParameterProvider::class) itemCount: Int) { PreviewOudsNavigationBar(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), itemCount = itemCount) } @@ -422,7 +396,7 @@ internal fun PreviewOudsNavigationBar(@PreviewParameter(OudsNavigationBarPreview @Preview(name = "Dark", widthDp = OudsPreviewableComponent.NavigationBarItem.PreviewWidthDp) @Composable @Suppress("PreviewShouldNotBeCalledRecursively") -internal fun PreviewOudsNavigationBarItem(@PreviewParameter(OudsNavigationBarItemPreviewParameterProvider::class) selected: Boolean) { +private fun PreviewOudsNavigationBarItem(@PreviewParameter(OudsNavigationBarItemPreviewParameterProvider::class) selected: Boolean) { PreviewOudsNavigationBarItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), selected = selected) } diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsTag.kt b/core/src/main/java/com/orange/ouds/core/component/OudsTag.kt index 0135cc6fe..b74f6457f 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsTag.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsTag.kt @@ -50,6 +50,8 @@ import androidx.compose.ui.unit.dp import com.orange.ouds.core.R import com.orange.ouds.core.component.content.OudsComponentContent import com.orange.ouds.core.component.content.OudsComponentIcon +import com.orange.ouds.core.component.content.OudsPolymorphicComponentContent +import com.orange.ouds.core.component.content.PolymorphicContent import com.orange.ouds.core.theme.OudsTheme import com.orange.ouds.core.theme.value import com.orange.ouds.core.utilities.CheckedContent @@ -70,11 +72,11 @@ import kotlin.enums.enumEntries * to convey a specific meaning and ensure clarity in communication. * * Four different layouts are supported: - * - Text only: when [status] icon is `null`, the tag displays only text. + * - Text only: when [status] asset is `null`, the tag displays only text. * Used for simple labels, categories, or keywords without additional visual elements. - * - Text and bullet: when [status] icon is equal to [OudsTagIcon.Bullet], the tag displays a small indicator (bullet) alongside the text. + * - Text and bullet: when [status] asset is equal to [OudsTagAsset.Bullet], the tag displays a small indicator (bullet) alongside the text. * Used to show status, presence, or activity next to the label. - * - Text and icon: when [status] icon is not `null`, the tag includes an icon before the text. + * - Text and icon: when [status] asset is an [OudsTagAsset.Icon] or an [OudsTagAsset.Icon.Default], the tag includes an icon before the text. * Used to visually reinforce the meaning of the tag, such as status, type, or action. * - Text and loader: when [loader] is not `null`, the tag combines a loading spinner (or progress indicator) with text. * Used to indicate that a process or action related to the tag is in progress. @@ -93,12 +95,12 @@ import kotlin.enums.enumEntries * There are two types of statuses: * - Non-functional statuses ([OudsTagStatus.Neutral] or [OudsTagStatus.Accent]) used to display categories, default states, or to draw attention without * carrying a specific functional meaning (unlike functional tags such as success, info, etc.). - * Using a non-functional status, you can provide a custom icon related to the tag’s context to enhance recognition by providing an [OudsTagIcon.Custom] - * as the icon of the status. + * Using a non-functional status, you can provide an icon related to the tag’s context to enhance recognition by providing an [OudsTagAsset.Icon] + * as the asset of the status. * - Functional statuses communicate specific information or system feedback: [OudsTagStatus.Positive], [OudsTagStatus.Warning], [OudsTagStatus.Negative], * [OudsTagStatus.Info]. - * Each functional status has its dedicated functional icon that matches the meaning of the tag. This icon will appear by providing [OudsTagIcon.Default] - * as the icon of the status. + * Each functional status has its dedicated functional icon that matches the meaning of the tag. This icon will appear by providing [OudsTagAsset.Icon.Default] + * as the asset of the status. * @param roundedCorners Controls the shape of the tag. * When `true`, the tag has rounded corners, providing a softer and more approachable look, suitable for most modern interfaces. * When `false`, the tag has sharp, square corners, providing a more formal, structured, or technical feel. Often used in a business context to label @@ -114,7 +116,7 @@ import kotlin.enums.enumEntries * * @sample com.orange.ouds.core.component.samples.OudsTagWithDefaultIconSample * - * @sample com.orange.ouds.core.component.samples.OudsTagWithCustomIconSample + * @sample com.orange.ouds.core.component.samples.OudsTagWithIconSample */ @Composable fun OudsTag( @@ -128,7 +130,7 @@ fun OudsTag( loader: OudsTagLoader? = null ) { val hasLoader = loader != null - val hasAsset = status.icon != null || hasLoader + val hasAsset = status.asset != null || hasLoader val isForbidden = !enabled && hasLoader val stateDescription = if (hasLoader) stringResource(id = R.string.core_common_loading_a11y) else "" @@ -162,15 +164,15 @@ fun OudsTag( if (hasLoader) { ProgressIndicator(status = status, appearance = appearance, size = size, progress = loader.progress, enabled = enabled) } else { - val isBulletIcon = status.icon is OudsTagIcon.Bullet - val iconPadding = if (isBulletIcon) bulletPadding(size = size) else iconPadding(size = size) + val isBulletAsset = status.asset is OudsTagAsset.Bullet + val assetPadding = if (isBulletAsset) bulletPadding(size = size) else iconPadding(size = size) val scale = LocalConfiguration.current.fontScale - status.icon?.Content( + status.asset?.PolymorphicContent( modifier = Modifier .size(assetSize(size) * scale) - .padding(all = iconPadding), - extraParameters = OudsTagIcon.ExtraParameters( - tint = iconColor(status = status, appearance = appearance, enabled = enabled, isBulletIcon = isBulletIcon), + .padding(all = assetPadding), + extraParameters = OudsTagAsset.ExtraParameters( + tint = assetColor(status = status, appearance = appearance, enabled = enabled, isBullet = isBulletAsset), status = status, appearance = appearance ) @@ -258,12 +260,12 @@ private fun backgroundColor(status: OudsTagStatus, appearance: OudsTagAppearance } @Composable -private fun iconColor(status: OudsTagStatus, appearance: OudsTagAppearance, enabled: Boolean, isBulletIcon: Boolean): Color { +private fun assetColor(status: OudsTagStatus, appearance: OudsTagAppearance, enabled: Boolean, isBullet: Boolean): Color { return when (appearance) { OudsTagAppearance.Emphasized -> contentColor(status = status, appearance = appearance, hasLoader = false, enabled = enabled) OudsTagAppearance.Muted -> when { !enabled -> OudsTheme.colorScheme.content.onAction.disabled - !isBulletIcon && status is OudsTagStatus.Warning -> Color.Unspecified // Case of two colors icon. Colors are managed by the `LayeredTintedPainter`. + !isBullet && status is OudsTagStatus.Warning -> Color.Unspecified // Case of two colors icon. Colors are managed by the `LayeredTintedPainter`. else -> status.color() } } @@ -423,66 +425,80 @@ enum class OudsTagAppearance { } /** - * An icon in an [OudsTag]. - * This icon is non-clickable. No content description is needed because a tag always contains a label. + * An asset in an [OudsTag]. + * This asset is non-clickable. No content description is needed because a tag always contains a label. */ -open class OudsTagIcon protected constructor( - graphicsObjectProvider: @Composable (OudsTagIcon) -> Any, -) : OudsComponentIcon(ExtraParameters::class.java, graphicsObjectProvider, "") { +sealed interface OudsTagAsset : OudsPolymorphicComponentContent { /** * A bullet in an [OudsTag]. * This bullet is non-clickable. No content description is needed because a tag always contains a label. */ - data object Bullet : OudsTagIcon({}) { + data object Bullet : OudsTagAsset, OudsComponentContent(OudsTagAsset.ExtraParameters::class.java) { + @Composable override fun Content(modifier: Modifier) { - // The bullet is a simple shape - // Thus instead of adding an XML drawable we override the default icon content - // That's why the graphicsObjectProvider parameter of the constructor is an empty lambda - tint?.let { tint -> - Box( - modifier = modifier - .size(10.dp) - .background(tint, shape = RoundedCornerShape(percent = 50)) - ) - } + Box( + modifier = modifier + .size(10.dp) + .background(extraParameters.tint, shape = RoundedCornerShape(percent = 50)) + ) } } - open class Custom internal constructor( - graphicsObjectProvider: @Composable (OudsTagIcon) -> Any, - ) : OudsTagIcon(graphicsObjectProvider) { + /** + * An icon in an [OudsTag]. + * This icon is non-clickable. No content description is needed because a tag always contains a label. + */ + class Icon private constructor(graphicsObject: Any) : OudsTagAsset, + OudsComponentIcon(OudsTagAsset.ExtraParameters::class.java, graphicsObject, "") { /** - * Creates an instance of [OudsTagIcon.Custom]. + * Creates an instance of [OudsTagAsset.Icon]. * * @param painter Painter of the icon. */ - constructor(painter: Painter) : this({ painter }) + constructor(painter: Painter) : this(painter as Any) /** - * Creates an instance of [OudsTagIcon.Custom]. + * Creates an instance of [OudsTagAsset.Icon]. * * @param imageVector Image vector of the icon. */ - constructor(imageVector: ImageVector) : this({ imageVector }) + constructor(imageVector: ImageVector) : this(imageVector as Any) /** - * Creates an instance of [OudsTagIcon.Custom]. + * Creates an instance of [OudsTagAsset.Icon]. * * @param bitmap Image bitmap of the icon. */ - constructor(bitmap: ImageBitmap) : this({ bitmap }) - } + constructor(bitmap: ImageBitmap) : this(bitmap as Any) - data object Default : OudsTagIcon({ icon -> - with(icon.extraParameters) { - (status as? TagFunctionalStatus)?.getDefaultIconPainter(appearance).orElse { - error("No default icon for status ${status::class.simpleName}") - } + override val tint: Color? + @Composable + get() = extraParameters.tint + + /** + * The default icon of an [OudsTag]. + * This icon is non-clickable. No content description is needed because a tag always contains a label. + */ + data object Default : OudsTagAsset, OudsComponentIcon( + OudsTagAsset.ExtraParameters::class.java, + { icon -> + with(icon.extraParameters) { + (status as? TagFunctionalStatus)?.getDefaultIconPainter(appearance).orElse { + error("No default icon for status ${status::class.simpleName}") + } + } + }, + { "" } + ) { + + override val tint: Color? + @Composable + get() = extraParameters.tint } - }) + } @ConsistentCopyVisibility data class ExtraParameters internal constructor( @@ -490,10 +506,6 @@ open class OudsTagIcon protected constructor( internal val status: OudsTagStatus, internal val appearance: OudsTagAppearance ) : OudsComponentContent.ExtraParameters() - - override val tint: Color? - @Composable - get() = extraParameters.tint } /** @@ -520,58 +532,73 @@ enum class OudsTagSize { /** * The status of an [OudsTag]. Each status is designed to convey a specific meaning and ensure clarity in communication. * It determines the background and the content colors of the tag. - * It also carries the optional icon to be displayed in the tag: bullet or icon. Depending on the status, this icon can be customizable or be a status + * It also carries the optional asset to be displayed in the tag: bullet or icon. Depending on the status, this icon can be customizable or be a status * dedicated icon. */ -sealed class OudsTagStatus(val icon: OudsTagIcon? = null) { +sealed class OudsTagStatus(val asset: OudsTagAsset? = null) { /** * Default or inactive status. Used for standard labels, categories, or when no specific status needs to be communicated. - * Its [icon] can be an [OudsTagIcon.Bullet], an [OudsTagIcon.Custom] or `null` if no icon is needed. + * Its [asset] can be an [OudsTagAsset.Bullet], an [OudsTagAsset.Icon] or `null` if no asset is needed. */ - class Neutral internal constructor(icon: OudsTagIcon?) : OudsTagStatus(icon) { + class Neutral internal constructor(asset: OudsTagAsset?) : OudsTagStatus(asset) { /** * Creates an instance of [OudsTagStatus.Neutral] with a bullet. */ - constructor(icon: OudsTagIcon.Bullet) : this(icon as OudsTagIcon) + constructor(asset: OudsTagAsset.Bullet) : this(asset as OudsTagAsset) - /* - * Creates an instance of [OudsTagStatus.Neutral] with a custom icon or no asset if [icon] is null. + /** + * Creates an instance of [OudsTagStatus.Neutral] with an icon. */ - constructor(icon: OudsTagIcon.Custom? = null) : this(icon as? OudsTagIcon) + constructor(asset: OudsTagAsset.Icon) : this(asset as? OudsTagAsset) + + /** + * Creates an instance of [OudsTagStatus.Neutral] with no asset. + */ + constructor() : this(null) } /** * Used to draw attention to new features, recommendations, or content suggestions. * Invites users to explore and engage with new offerings, creating an exciting and engaging experience. - * Its [icon] can be an [OudsTagIcon.Bullet], an [OudsTagIcon.Custom] or `null` if no icon is needed. + * Its [asset] can be an [OudsTagAsset.Bullet], an [OudsTagAsset.Icon] or `null` if no asset is needed. */ - class Accent internal constructor(icon: OudsTagIcon?) : OudsTagStatus(icon) { + class Accent internal constructor(asset: OudsTagAsset?) : OudsTagStatus(asset) { /** * Creates an instance of [OudsTagStatus.Accent] with a bullet. */ - constructor(icon: OudsTagIcon.Bullet) : this(icon as OudsTagIcon) + constructor(asset: OudsTagAsset.Bullet) : this(asset as OudsTagAsset) + + /** + * Creates an instance of [OudsTagStatus.Accent] with an icon. + */ + constructor(asset: OudsTagAsset.Icon) : this(asset as? OudsTagAsset) /** - * Creates an instance of [OudsTagStatus.Accent] with a custom icon or no asset if [icon] is null. + * Creates an instance of [OudsTagStatus.Accent] with no asset. */ - constructor(icon: OudsTagIcon.Custom? = null) : this(icon as? OudsTagIcon) + constructor() : this(null) } /** * Indicates success, confirmation, or a positive status. This functional status is commonly used to highlight completed actions or approved items. - * Its [icon] can be an [OudsTagIcon.Bullet], an [OudsTagIcon.Default] or `null` if no icon is needed. + * Its [asset] can be an [OudsTagAsset.Bullet], an [OudsTagAsset.Icon.Default] or `null` if no asset is needed. */ - class Positive internal constructor(icon: OudsTagIcon?) : OudsTagStatus(icon), TagFunctionalStatus { + class Positive internal constructor(asset: OudsTagAsset?) : OudsTagStatus(asset), TagFunctionalStatus { /** * Creates an instance of [OudsTagStatus.Positive] with a bullet. */ - constructor(icon: OudsTagIcon.Bullet) : this(icon as OudsTagIcon) + constructor(asset: OudsTagAsset.Bullet) : this(asset as OudsTagAsset) /** - * Creates an instance of [OudsTagStatus.Positive] with its default dedicated icon or no asset if [icon] is null. + * Creates an instance of [OudsTagStatus.Positive] with its default dedicated icon. */ - constructor(icon: OudsTagIcon.Default? = null) : this(icon as? OudsTagIcon) + constructor(asset: OudsTagAsset.Icon.Default) : this(asset as? OudsTagAsset) + + /** + * Creates an instance of [OudsTagStatus.Positive] with no asset. + */ + constructor() : this(null) @Composable override fun getDefaultIconPainter(appearance: OudsTagAppearance) = painterResource(OudsTheme.drawableResources.component.alert.tickConfirmationFill) @@ -579,18 +606,23 @@ sealed class OudsTagStatus(val icon: OudsTagIcon? = null) { /** * Conveys informational messages or supplementary details. This functional status is used for neutral, helpful, or contextual information. - * Its [icon] can be an [OudsTagIcon.Bullet], an [OudsTagIcon.Default] or `null` if no icon is needed. + * Its [asset] can be an [OudsTagAsset.Bullet], an [OudsTagAsset.Icon.Default] or `null` if no asset is needed. */ - class Info internal constructor(icon: OudsTagIcon?) : OudsTagStatus(icon), TagFunctionalStatus { + class Info internal constructor(asset: OudsTagAsset?) : OudsTagStatus(asset), TagFunctionalStatus { /** * Creates an instance of [OudsTagStatus.Info] with a bullet. */ - constructor(icon: OudsTagIcon.Bullet) : this(icon as OudsTagIcon) + constructor(asset: OudsTagAsset.Bullet) : this(asset as OudsTagAsset) + + /** + * Creates an instance of [OudsTagStatus.Info] with its default dedicated icon. + */ + constructor(asset: OudsTagAsset.Icon.Default) : this(asset as? OudsTagAsset) /** - * Creates an instance of [OudsTagStatus.Info] with its default dedicated icon or no asset if [icon] is null. + * Creates an instance of [OudsTagStatus.Info] with no asset. */ - constructor(icon: OudsTagIcon.Default? = null) : this(icon as? OudsTagIcon) + constructor() : this(null) @Composable override fun getDefaultIconPainter(appearance: OudsTagAppearance) = painterResource(OudsTheme.drawableResources.component.alert.infoFill) @@ -598,18 +630,23 @@ sealed class OudsTagStatus(val icon: OudsTagIcon? = null) { /** * Signals caution or a potentially risky situation. This functional status is used to draw attention to items requiring user awareness or intervention. - * Its [icon] can be an [OudsTagIcon.Bullet], an [OudsTagIcon.Default] or `null` if no icon is needed. + * Its [asset] can be an [OudsTagAsset.Bullet], an [OudsTagAsset.Icon.Default] or `null` if no asset is needed. */ - class Warning internal constructor(icon: OudsTagIcon?) : OudsTagStatus(icon), TagFunctionalStatus { + class Warning internal constructor(asset: OudsTagAsset?) : OudsTagStatus(asset), TagFunctionalStatus { /** * Creates an instance of [OudsTagStatus.Warning] with a bullet. */ - constructor(icon: OudsTagIcon.Bullet) : this(icon as OudsTagIcon) + constructor(asset: OudsTagAsset.Bullet) : this(asset as OudsTagAsset) + + /** + * Creates an instance of [OudsTagStatus.Warning] with its default dedicated icon. + */ + constructor(asset: OudsTagAsset.Icon.Default) : this(asset as? OudsTagAsset) /** - * Creates an instance of [OudsTagStatus.Warning] with its default dedicated icon or no asset if [icon] is null. + * Creates an instance of [OudsTagStatus.Warning] with no asset. */ - constructor(icon: OudsTagIcon.Default? = null) : this(icon as? OudsTagIcon) + constructor() : this(null) @Composable override fun getDefaultIconPainter(appearance: OudsTagAppearance): Painter { @@ -628,18 +665,23 @@ sealed class OudsTagStatus(val icon: OudsTagIcon? = null) { /** * Represents errors, critical issues, or urgent attention needed. This functional status is used to highlight problems or failed actions. - * Its [icon] can be an [OudsTagIcon.Bullet], an [OudsTagIcon.Default] or `null` if no icon is needed. + * Its [asset] can be an [OudsTagAsset.Bullet], an [OudsTagAsset.Icon.Default] or `null` if no asset is needed. */ - class Negative internal constructor(icon: OudsTagIcon?) : OudsTagStatus(icon), TagFunctionalStatus { + class Negative internal constructor(asset: OudsTagAsset?) : OudsTagStatus(asset), TagFunctionalStatus { /** * Creates an instance of [OudsTagStatus.Negative] with a bullet. */ - constructor(icon: OudsTagIcon.Bullet) : this(icon as OudsTagIcon) + constructor(asset: OudsTagAsset.Bullet) : this(asset as OudsTagAsset) /** - * Creates an instance of [OudsTagStatus.Negative] with its default dedicated icon or no asset if [icon] is null. + * Creates an instance of [OudsTagStatus.Negative] with its default dedicated icon. */ - constructor(icon: OudsTagIcon.Default? = null) : this(icon as? OudsTagIcon) + constructor(asset: OudsTagAsset.Icon.Default) : this(asset as? OudsTagAsset) + + /** + * Creates an instance of [OudsTagStatus.Negative] with no asset. + */ + constructor() : this(null) @Composable override fun getDefaultIconPainter(appearance: OudsTagAppearance) = painterResource(OudsTheme.drawableResources.component.alert.importantFill) @@ -677,6 +719,7 @@ sealed class OudsTagStatus(val icon: OudsTagIcon? = null) { } private interface TagFunctionalStatus { + @Composable fun getDefaultIconPainter(appearance: OudsTagAppearance): Painter } @@ -736,22 +779,22 @@ internal class OudsTagPreviewParameterProvider : BasicPreviewParameterProvider get() { - val icon = OudsTagIcon.Custom(Icons.Outlined.FavoriteBorder) + val icon = OudsTagAsset.Icon(Icons.Outlined.FavoriteBorder) val statusesWithBullet = listOf( - OudsTagStatus.Neutral(icon = OudsTagIcon.Bullet), - OudsTagStatus.Accent(icon = OudsTagIcon.Bullet), - OudsTagStatus.Positive(icon = OudsTagIcon.Bullet), - OudsTagStatus.Warning(icon = OudsTagIcon.Bullet), - OudsTagStatus.Negative(icon = OudsTagIcon.Bullet), - OudsTagStatus.Info(icon = OudsTagIcon.Bullet) + OudsTagStatus.Neutral(asset = OudsTagAsset.Bullet), + OudsTagStatus.Accent(asset = OudsTagAsset.Bullet), + OudsTagStatus.Positive(asset = OudsTagAsset.Bullet), + OudsTagStatus.Warning(asset = OudsTagAsset.Bullet), + OudsTagStatus.Negative(asset = OudsTagAsset.Bullet), + OudsTagStatus.Info(asset = OudsTagAsset.Bullet) ) val statusesWithIcon = listOf( - OudsTagStatus.Neutral(icon = icon), - OudsTagStatus.Accent(icon = icon), - OudsTagStatus.Positive(icon = OudsTagIcon.Default), - OudsTagStatus.Warning(icon = OudsTagIcon.Default), - OudsTagStatus.Negative(icon = OudsTagIcon.Default), - OudsTagStatus.Info(icon = OudsTagIcon.Default) + OudsTagStatus.Neutral(asset = icon), + OudsTagStatus.Accent(asset = icon), + OudsTagStatus.Positive(asset = OudsTagAsset.Icon.Default), + OudsTagStatus.Warning(asset = OudsTagAsset.Icon.Default), + OudsTagStatus.Negative(asset = OudsTagAsset.Icon.Default), + OudsTagStatus.Info(asset = OudsTagAsset.Icon.Default) ) val loader = OudsTagLoader(0.6f) diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsTopAppBar.kt b/core/src/main/java/com/orange/ouds/core/component/OudsTopAppBar.kt new file mode 100644 index 000000000..f03e581cb --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/OudsTopAppBar.kt @@ -0,0 +1,865 @@ +/* + * 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 + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.AccountCircle +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.material.icons.outlined.Settings +import androidx.compose.material3.CenterAlignedTopAppBar +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.LargeTopAppBar +import androidx.compose.material3.LocalRippleConfiguration +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.MediumTopAppBar +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarColors +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.material3.TopAppBarScrollBehavior +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.drawWithContent +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ImageBitmap +import androidx.compose.ui.graphics.painter.Painter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.semantics.clearAndSetSemantics +import androidx.compose.ui.semantics.contentDescription +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.PreviewLightDark +import androidx.compose.ui.tooling.preview.PreviewParameter +import androidx.compose.ui.unit.Density +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import com.orange.ouds.core.R +import com.orange.ouds.core.component.content.OudsComponentContent +import com.orange.ouds.core.component.content.OudsComponentIcon +import com.orange.ouds.core.component.content.OudsPolymorphicComponentContent +import com.orange.ouds.core.component.content.PolymorphicContent +import com.orange.ouds.core.extensions.value +import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.core.theme.value +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.PreviewCheckerboardPainter +import com.orange.ouds.core.utilities.getPreviewTheme +import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider +import com.orange.ouds.theme.OudsThemeContract + +//TODO update DSM link when available +/** + * Top app bars display information and actions at the top of a screen. + * + * This small top app bar has slots for a title, navigation icon, and actions. + * + * [OudsTopAppBar] default appearance is opaque but, if you need a **translucent blurred top app bar** as specified on OUDS design + * side, you can implement it in your app with the help of [Haze](https://chrisbanes.github.io/haze/latest/) library. To do this, use [OudsTopAppBar] with + * [translucent] parameter set to true and follow these steps: + * 1. Add Haze dependency + * 2. Follow Haze basic usage instructions: + * - Define Haze state in the screen containing the top app bar: `val hazeState = rememberHazeState()` + * - Use `hazeEffect` Modifier on [OudsTopAppBar] providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.components.bar.blurRadius.dp)),` + * - Apply `hazeSource` Modifier on the content that scrolls behind the top app bar: `Modifier.hazeSource(state = hazeState)` + * 3. As your screen content needs to scroll behind the top app bar, you'll probably need to add an additional bottom padding + * that will have the height of [OudsTopAppBar]. + * + * > Design guidelines: [unified-design-system.orange.com](https://unified-design-system.orange.com) + * + * > Design version: 1.0.0 + * + * @param title The title to be displayed in the top app bar. + * @param modifier The [Modifier] to be applied to this top app bar. + * @param translucent Whether the top app bar should be translucent. + * @param navigationIcon The navigation icon displayed at the start of the top app bar. + * @param actions The actions displayed at the end of the top app bar. These can be + * instances of [OudsTopAppBarAction.Icon] or [OudsTopAppBarAction.Avatar]. + * The default layout here is a [Row], so actions will be placed horizontally. + * The maximum recommended number of actions is three. Please use a dropdown menu if you need more than three actions. + * @param expandedHeight This app bar's height. When a specified [scrollBehavior] causes the app bar + * to collapse or expand, this value will represent the maximum height that the bar will be + * allowed to expand. This value must be specified and finite, otherwise it will be ignored and + * replaced with [TopAppBarDefaults.TopAppBarExpandedHeight]. + * @param windowInsets A window insets that app bar will respect. + * @param scrollBehavior A [TopAppBarScrollBehavior] which holds various offset values that will be + * applied by this top app bar to set up its height and colors. A scroll behavior is designed to + * work in conjunction with a scrolled content to change the top app bar appearance as the content + * scrolls. See [TopAppBarScrollBehavior.nestedScrollConnection]. + * + * @sample com.orange.ouds.core.component.samples.OudsTopAppBarSample + */ +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun OudsTopAppBar( + title: String, + modifier: Modifier = Modifier, + translucent: Boolean = false, + navigationIcon: OudsTopAppBarNavigationIcon? = null, + actions: List = emptyList(), + expandedHeight: Dp = TopAppBarDefaults.TopAppBarExpandedHeight, + windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, + scrollBehavior: TopAppBarScrollBehavior? = null +) { + TopAppBar( + title = { + Title( + title = title, + topAppBarSize = OudsTopAppBarSize.Small, + centerAligned = false + ) + }, + modifier = modifier.bottomBorder(), + navigationIcon = { navigationIcon?.Content() }, + actions = { actions.forEach { it.PolymorphicContent() } }, + expandedHeight = expandedHeight, + windowInsets = windowInsets, + colors = colors(translucent = translucent), + scrollBehavior = scrollBehavior + ) +} + +//TODO update DSM link when available +/** + * Top app bars display information and actions at the top of a screen. + * + * This small top app bar has slots for a title that is horizontally aligned to the center, navigation icon, and actions. + * + * [OudsCenterAlignedTopAppBar] default appearance is opaque but, if you need a **translucent blurred top app bar** as specified on OUDS design + * side, you can implement it in your app with the help of [Haze](https://chrisbanes.github.io/haze/latest/) library. To do this, use [OudsCenterAlignedTopAppBar] with + * [translucent] parameter set to true and follow these steps: + * 1. Add Haze dependency + * 2. Follow Haze basic usage instructions: + * - Define Haze state in the screen containing the top app bar: `val hazeState = rememberHazeState()` + * - Use `hazeEffect` Modifier on [OudsCenterAlignedTopAppBar] providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.components.bar.blurRadius.dp)),` + * - Apply `hazeSource` Modifier on the content that scrolls behind the top app bar: `Modifier.hazeSource(state = hazeState)` + * 3. As your screen content needs to scroll behind the top app bar, you'll probably need to add an additional bottom padding + * that will have the height of [OudsCenterAlignedTopAppBar]. + * + * > Design guidelines: [unified-design-system.orange.com](https://unified-design-system.orange.com) + * + * > Design version: 1.0.0 + * + * @param title The title to be displayed in the top app bar. + * @param modifier The [Modifier] to be applied to this top app bar. + * @param translucent Whether the top app bar should be translucent. + * @param navigationIcon The navigation icon displayed at the start of the top app bar. + * @param actions The actions displayed at the end of the top app bar. These can be + * instances of [OudsTopAppBarAction.Icon] or [OudsTopAppBarAction.Avatar]. + * The default layout here is a [Row], so actions will be placed horizontally. + * The maximum recommended number of actions is three. Please use a dropdown menu if you need more than three actions. + * @param expandedHeight This app bar's height. When a specified [scrollBehavior] causes the app bar + * to collapse or expand, this value will represent the maximum height that the bar will be + * allowed to expand. This value must be specified and finite, otherwise it will be ignored and + * replaced with [TopAppBarDefaults.TopAppBarExpandedHeight]. + * @param windowInsets A window insets that app bar will respect. + * @param scrollBehavior A [TopAppBarScrollBehavior] which holds various offset values that will be + * applied by this top app bar to set up its height and colors. A scroll behavior is designed to + * work in conjunction with a scrolled content to change the top app bar appearance as the content + * scrolls. See [TopAppBarScrollBehavior.nestedScrollConnection]. + * + * @sample com.orange.ouds.core.component.samples.OudsCenterAlignedTopAppBarSample + */ +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun OudsCenterAlignedTopAppBar( + title: String, + modifier: Modifier = Modifier, + translucent: Boolean = false, + navigationIcon: OudsTopAppBarNavigationIcon? = null, + actions: List = emptyList(), + expandedHeight: Dp = TopAppBarDefaults.TopAppBarExpandedHeight, + windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, + scrollBehavior: TopAppBarScrollBehavior? = null +) { + CenterAlignedTopAppBar( + title = { + Title( + title = title, + topAppBarSize = OudsTopAppBarSize.Small, + centerAligned = true + ) + }, + modifier = modifier.bottomBorder(), + navigationIcon = { navigationIcon?.Content() }, + actions = { actions.forEach { it.PolymorphicContent() } }, + expandedHeight = expandedHeight, + windowInsets = windowInsets, + colors = colors(translucent = translucent), + scrollBehavior = scrollBehavior + ) +} + +//TODO update DSM link when available +/** + * Top app bars display information and actions at the top of a screen. + * + * This medium top app bar has slots for a title, navigation icon, and actions. In its default expanded + * state, the title is displayed in a second row under the navigation and actions. + * + * [OudsMediumTopAppBar] default appearance is opaque but, if you need a **translucent blurred top app bar** as specified on OUDS design + * side, you can implement it in your app with the help of [Haze](https://chrisbanes.github.io/haze/latest/) library. To do this, use [OudsMediumTopAppBar] with + * [translucent] parameter set to true and follow these steps: + * 1. Add Haze dependency + * 2. Follow Haze basic usage instructions: + * - Define Haze state in the screen containing the top app bar: `val hazeState = rememberHazeState()` + * - Use `hazeEffect` Modifier on [OudsMediumTopAppBar] providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.components.bar.blurRadius.dp)),` + * - Apply `hazeSource` Modifier on the content that scrolls behind the top app bar: `Modifier.hazeSource(state = hazeState)` + * 3. As your screen content needs to scroll behind the top app bar, you'll probably need to add an additional bottom padding + * that will have the height of [OudsMediumTopAppBar]. + * + * > Design guidelines: [unified-design-system.orange.com](https://unified-design-system.orange.com) + * + * > Design version: 1.0.0 + * + * @param title The title to be displayed in the top app bar. This title will be used in the app + * bar's expanded and collapsed states, although in its collapsed state it will be composed with a + * smaller sized [TextStyle]. + * @param modifier The [Modifier] to be applied to this top app bar. + * @param translucent Whether the top app bar should be translucent. + * @param navigationIcon The navigation icon displayed at the start of the top app bar. + * @param actions The actions displayed at the end of the top app bar. These can be + * instances of [OudsTopAppBarAction.Icon] or [OudsTopAppBarAction.Avatar]. + * The default layout here is a [Row], so actions will be placed horizontally. + * The maximum recommended number of actions is three. Please use a dropdown menu if you need more than three actions. + * @param collapsedHeight This app bar height when collapsed by a provided [scrollBehavior]. This + * value must be specified and finite, otherwise it will be ignored and replaced with + * [TopAppBarDefaults.MediumAppBarCollapsedHeight]. + * @param expandedHeight This app bar's maximum height. When a specified [scrollBehavior] causes the + * app bar to collapse or expand, this value will represent the maximum height that the app-bar + * will be allowed to expand. The expanded height is expected to be greater or equal to the + * [collapsedHeight], and the function will throw an [IllegalArgumentException] otherwise. Also, + * this value must be specified and finite, otherwise it will be ignored and replaced with + * [TopAppBarDefaults.MediumAppBarExpandedHeight]. + * @param windowInsets A window insets that app bar will respect. + * @param scrollBehavior A [TopAppBarScrollBehavior] which holds various offset values that will be + * applied by this top app bar to set up its height and colors. A scroll behavior is designed to + * work in conjunction with a scrolled content to change the top app bar appearance as the content + * scrolls. See [TopAppBarScrollBehavior.nestedScrollConnection]. + * @throws IllegalArgumentException if the provided [expandedHeight] is smaller than the + * [collapsedHeight] + * + * @sample com.orange.ouds.core.component.samples.OudsMediumTopAppBarSample + */ +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun OudsMediumTopAppBar( + title: String, + modifier: Modifier = Modifier, + translucent: Boolean = false, + navigationIcon: OudsTopAppBarNavigationIcon? = null, + actions: List = emptyList(), + collapsedHeight: Dp = TopAppBarDefaults.MediumAppBarCollapsedHeight, + expandedHeight: Dp = TopAppBarDefaults.MediumAppBarExpandedHeight, + windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, + scrollBehavior: TopAppBarScrollBehavior? = null +) { + MediumTopAppBar( + title = { + Title( + title = title, + topAppBarSize = OudsTopAppBarSize.Medium, + centerAligned = false + ) + }, + modifier = modifier.bottomBorder(), + navigationIcon = { navigationIcon?.Content() }, + actions = { actions.forEach { it.PolymorphicContent() } }, + collapsedHeight = collapsedHeight, + expandedHeight = expandedHeight, + windowInsets = windowInsets, + colors = colors(translucent = translucent), + scrollBehavior = scrollBehavior + ) +} + +//TODO update DSM link when available +/** + * Top app bars display information and actions at the top of a screen. + * + * This LargeTopAppBar has slots for a title, navigation icon, and actions. In its default expanded + * state, the title is displayed in a second row under the navigation and actions. + * + * [OudsLargeTopAppBar] default appearance is opaque but, if you need a **translucent blurred top app bar** as specified on OUDS design + * side, you can implement it in your app with the help of [Haze](https://chrisbanes.github.io/haze/latest/) library. To do this, use [OudsLargeTopAppBar] with + * [translucent] parameter set to true and follow these steps: + * 1. Add Haze dependency + * 2. Follow Haze basic usage instructions: + * - Define Haze state in the screen containing the top app bar: `val hazeState = rememberHazeState()` + * - Use `hazeEffect` Modifier on [OudsLargeTopAppBar] providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.components.bar.blurRadius.dp)),` + * - Apply `hazeSource` Modifier on the content that scrolls behind the top app bar: `Modifier.hazeSource(state = hazeState)` + * 3. As your screen content needs to scroll behind the top app bar, you'll probably need to add an additional bottom padding + * that will have the height of [OudsLargeTopAppBar]. + * + * > Design guidelines: [unified-design-system.orange.com](https://unified-design-system.orange.com) + * + * > Design version: 1.0.0 + * + * @param title The title to be displayed in the top app bar. This title will be used in the app + * bar's expanded and collapsed states, although in its collapsed state it will be composed with a + * smaller sized [TextStyle]. + * @param modifier The [Modifier] to be applied to this top app bar. + * @param translucent Whether the top app bar should be translucent. + * @param navigationIcon The navigation icon displayed at the start of the top app bar. + * @param actions The actions displayed at the end of the top app bar. These can be + * instances of [OudsTopAppBarAction.Icon] or [OudsTopAppBarAction.Avatar]. + * The default layout here is a [Row], so actions will be placed horizontally. + * The maximum recommended number of actions is three. Please use a dropdown menu if you need more than three actions. + * @param collapsedHeight This app bar height when collapsed by a provided [scrollBehavior]. This + * value must be specified and finite, otherwise it will be ignored and replaced with + * [TopAppBarDefaults.LargeAppBarCollapsedHeight]. + * @param expandedHeight This app bar's maximum height. When a specified [scrollBehavior] causes the + * app bar to collapse or expand, this value will represent the maximum height that the app-bar + * will be allowed to expand. The expanded height is expected to be greater or equal to the + * [collapsedHeight], and the function will throw an [IllegalArgumentException] otherwise. Also, + * this value must be specified and finite, otherwise it will be ignored and replaced with + * [TopAppBarDefaults.LargeAppBarExpandedHeight]. + * @param windowInsets A window insets that app bar will respect. + * @param scrollBehavior A [TopAppBarScrollBehavior] which holds various offset values that will be + * applied by this top app bar to set up its height and colors. A scroll behavior is designed to + * work in conjunction with a scrolled content to change the top app bar appearance as the content + * scrolls. See [TopAppBarScrollBehavior.nestedScrollConnection]. + * @throws IllegalArgumentException if the provided [expandedHeight] is smaller than the + * [collapsedHeight] + * + * @sample com.orange.ouds.core.component.samples.OudsLargeTopAppBarSample + */ +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun OudsLargeTopAppBar( + title: String, + modifier: Modifier = Modifier, + translucent: Boolean = false, + navigationIcon: OudsTopAppBarNavigationIcon? = null, + actions: List = emptyList(), + collapsedHeight: Dp = TopAppBarDefaults.LargeAppBarCollapsedHeight, + expandedHeight: Dp = TopAppBarDefaults.LargeAppBarExpandedHeight, + windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, + scrollBehavior: TopAppBarScrollBehavior? = null +) { + LargeTopAppBar( + title = { + Title( + title = title, + topAppBarSize = OudsTopAppBarSize.Large, + centerAligned = false + ) + }, + modifier = modifier.bottomBorder(), + navigationIcon = { navigationIcon?.Content() }, + actions = { actions.forEach { it.PolymorphicContent() } }, + collapsedHeight = collapsedHeight, + expandedHeight = expandedHeight, + windowInsets = windowInsets, + colors = colors(translucent = translucent), + scrollBehavior = scrollBehavior + ) +} + +@Composable +private fun Title(title: String, topAppBarSize: OudsTopAppBarSize, centerAligned: Boolean) { + Column(horizontalAlignment = if (centerAligned) Alignment.CenterHorizontally else Alignment.Start) { + val maxLines = if (topAppBarSize == OudsTopAppBarSize.Small) 1 else Int.MAX_VALUE + Text( + text = title, + maxLines = maxLines, + overflow = TextOverflow.Ellipsis, + color = OudsTheme.colorScheme.content.default, + fontFamily = OudsTheme.typography.fontFamily + ) + } +} + +@Composable +private fun colors(translucent: Boolean): TopAppBarColors { + val backgroundColor = with(OudsTheme.componentsTokens.bar) { + if (translucent) colorBgTranslucent.value else colorBgOpaque.value + } + return TopAppBarDefaults.topAppBarColors( + containerColor = backgroundColor, + scrolledContainerColor = backgroundColor + ) +} + +@Composable +private fun Modifier.bottomBorder(): Modifier { + val color = OudsTheme.colorScheme.border.minimal + return drawWithContent { + drawContent() + val width = 1.dp.toPx() + drawLine( + color = color, + start = Offset(x = 0f, y = size.height - width / 2f), + end = Offset(x = size.width, y = size.height - width / 2f), + strokeWidth = width + ) + } +} + +/** + * A navigation icon in an [OudsTopAppBar] or any other variant. + */ +open class OudsTopAppBarNavigationIcon private constructor( + graphicsObjectProvider: @Composable (OudsTopAppBarNavigationIcon) -> Any, + contentDescriptionProvider: @Composable (OudsTopAppBarNavigationIcon) -> String, + onClick: () -> Unit +) : OudsComponentIcon(Nothing::class.java, graphicsObjectProvider, contentDescriptionProvider, onClick) { + + /** + * A predefined [OudsTopAppBarNavigationIcon] with a back icon. + * + * @constructor Creates an instance of [OudsTopAppBarNavigationIcon.Back]. + * @param onClick Callback invoked when the navigation icon is clicked. + */ + class Back(onClick: () -> Unit) : OudsTopAppBarNavigationIcon( + { painterResource(id = OudsTheme.drawableResources.functional.navigation.formChevronLeft) }, + { stringResource(R.string.core_topAppBar_backNavigationIcon_a11y) }, + onClick + ) + + /** + * A predefined [OudsTopAppBarNavigationIcon] with a close icon. + * + * @constructor Creates an instance of [OudsTopAppBarNavigationIcon.Close]. + * @param onClick Callback invoked when the navigation icon is clicked. + */ + class Close(onClick: () -> Unit) : OudsTopAppBarNavigationIcon( + { painterResource(id = OudsTheme.drawableResources.functional.actions.delete) }, + { stringResource(R.string.core_topAppBar_closeNavigationIcon_a11y) }, + onClick + ) + + /** + * A predefined [OudsTopAppBarNavigationIcon] with a menu icon. + * + * @constructor Creates an instance of [OudsTopAppBarNavigationIcon.Menu]. + * @param onClick Callback invoked when the navigation icon is clicked. + */ + class Menu(onClick: () -> Unit) : OudsTopAppBarNavigationIcon( + { painterResource(id = OudsTheme.drawableResources.functional.navigation.menu) }, + { stringResource(R.string.core_topAppBar_menuNavigationIcon_a11y) }, + onClick + ) + + /** + * Creates an instance of [OudsTopAppBarNavigationIcon]. + * + * @param painter Painter of the navigation icon. + * @param contentDescription The content description associated with this [OudsTopAppBarNavigationIcon]. + * @param onClick Callback invoked when the navigation icon is clicked. + */ + constructor( + painter: Painter, + contentDescription: String, + onClick: () -> Unit + ) : this({ painter }, { contentDescription }, onClick) + + /** + * Creates an instance of [OudsTopAppBarNavigationIcon]. + * + * @param imageVector Image vector of the navigation icon. + * @param contentDescription The content description associated with this [OudsTopAppBarNavigationIcon]. + * @param onClick Callback invoked when the navigation icon is clicked. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + onClick: () -> Unit + ) : this({ imageVector }, { contentDescription }, onClick) + + /** + * Creates an instance of [OudsTopAppBarNavigationIcon]. + * + * @param bitmap Image bitmap of the navigation icon. + * @param contentDescription The content description associated with this [OudsTopAppBarNavigationIcon]. + * @param onClick Callback invoked when the navigation icon is clicked. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + onClick: () -> Unit + ) : this({ bitmap }, { contentDescription }, onClick) +} + +/** + * An action in an [OudsTopAppBar] or any other variant. + */ +sealed interface OudsTopAppBarAction : OudsPolymorphicComponentContent { + + /** + * A top app bar action that displays an icon. + */ + class Icon private constructor( + graphicsObject: Any, + contentDescription: String, + badge: OudsTopAppBarActionBadge?, + onClick: () -> Unit + ) : OudsTopAppBarAction, OudsComponentIcon(Nothing::class.java, { graphicsObject }, { contentDescription }, onClick) { + + private val _badge = badge + override val badge: OudsButtonIconBadge? + @Composable + get() = _badge?.let { badge -> + OudsButtonIconBadge( + contentDescription = badge.contentDescription, + count = badge.count, + borderColor = OudsTheme.componentsTokens.bar.colorBorderBadge.value + ) + } + + /** + * Creates an instance of [OudsTopAppBarAction.Icon]. + * + * @param painter Painter of the icon. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Icon]. + * @param badge Optional badge displayed on the icon. + * @param onClick Callback invoked when the icon is clicked. + */ + constructor( + painter: Painter, + contentDescription: String, + badge: OudsTopAppBarActionBadge? = null, + onClick: () -> Unit + ) : this(painter as Any, contentDescription, badge, onClick) + + /** + * Creates an instance of [OudsTopAppBarAction.Icon]. + * + * @param imageVector Image vector of the icon. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Icon]. + * @param badge Optional badge displayed on the icon. + * @param onClick Callback invoked when the icon is clicked. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + badge: OudsTopAppBarActionBadge? = null, + onClick: () -> Unit + ) : this(imageVector as Any, contentDescription, badge, onClick) + + /** + * Creates an instance of [OudsTopAppBarAction.Icon]. + * + * @param bitmap Image bitmap of the icon. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Icon]. + * @param badge Optional badge displayed on the icon. + * @param onClick Callback invoked when the icon is clicked. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + badge: OudsTopAppBarActionBadge? = null, + onClick: () -> Unit + ) : this(bitmap as Any, contentDescription, badge, onClick) + } + + /** + * A top app bar action that displays an avatar. + * The content of the avatar can either be an image or a single letter monogram. + */ + class Avatar private constructor( + private val graphicsObject: Any?, + private val monogram: Char?, + private val monogramColor: Color?, + private val monogramBackgroundColor: Color?, + private val contentDescription: String, + private val onClick: (() -> Unit)? + ) : OudsTopAppBarAction, OudsComponentContent(Nothing::class.java) { + + /** + * Creates an instance of [OudsTopAppBarAction.Avatar]. + * + * @param painter Painter of the avatar. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Avatar]. + * @param onClick Callback invoked when the avatar is clicked. + */ + constructor( + painter: Painter, + contentDescription: String, + onClick: (() -> Unit)? + ) : this(painter as Any, null, null, null, contentDescription, onClick) + + /** + * Creates an instance of [OudsTopAppBarAction.Avatar]. + * + * @param imageVector Image vector of the avatar. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Avatar]. + * @param onClick Callback invoked when the avatar is clicked. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + onClick: (() -> Unit)? + ) : this(imageVector as Any, null, null, null, contentDescription, onClick) + + /** + * Creates an instance of [OudsTopAppBarAction.Avatar]. + * + * @param bitmap Image bitmap of the avatar. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Avatar]. + * @param onClick Callback invoked when the avatar is clicked. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + onClick: (() -> Unit)? + ) : this(bitmap as Any, null, null, null, contentDescription, onClick) + + /** + * Creates an instance of [OudsTopAppBarAction.Avatar]. + * + * @param monogram The single letter monogram for this avatar. + * @param color The color of the monogram. + * @param backgroundColor The background color of the monogram. + * @param contentDescription The content description associated with this [OudsTopAppBarAction.Avatar]. + * @param onClick Callback invoked when the avatar is clicked. + */ + constructor( + monogram: Char, + color: Color, + backgroundColor: Color, + contentDescription: String, + onClick: (() -> Unit)? + ) : this(null, monogram, color, backgroundColor, contentDescription, onClick) + + @Composable + override fun Content(modifier: Modifier) { + CompositionLocalProvider(LocalRippleConfiguration provides null) { + Box( + modifier = Modifier + .size(OudsTheme.sizes.minInteractiveArea) + .run { if (onClick != null) clickable(onClick = onClick, role = Role.Button) else this } + .semantics(mergeDescendants = true) { + contentDescription = this@Avatar.contentDescription + }, + contentAlignment = Alignment.Center + ) { + val modifier = Modifier + .clip(CircleShape) + .size(32.dp) + val contentScale = ContentScale.Crop + if (graphicsObject != null) { + when (graphicsObject) { + is Painter -> Image( + modifier = modifier, + painter = graphicsObject, + contentDescription = null, + contentScale = contentScale + ) + is ImageVector -> Image( + modifier = modifier, + imageVector = graphicsObject, + contentDescription = null, + contentScale = contentScale + ) + is ImageBitmap -> Image( + modifier = modifier, + bitmap = graphicsObject, + contentDescription = null, + contentScale = contentScale + ) + } + } else if (monogram != null && monogramColor != null && monogramBackgroundColor != null) { + Box( + modifier = modifier.background(monogramBackgroundColor), + contentAlignment = Alignment.Center, + ) { + CompositionLocalProvider( + // Do not take user font scale into account + value = LocalDensity provides Density(LocalDensity.current.density, 1f) + ) { + Text( + modifier = Modifier.clearAndSetSemantics {}, + text = monogram.uppercase(), + color = monogramColor, + style = MaterialTheme.typography.titleMedium, // This looks like the most accurate style according to Material specs at https://m3.material.io/components/app-bars/specs#606c6564-ce7d-489d-8852-af2b3b478bc6 + fontFamily = OudsTheme.typography.fontFamily + ) + } + } + } + } + } + } + } +} + +/** + * A badge in an [OudsTopAppBarAction]. + * + * @see [OudsBadge] + * + * @property contentDescription Content description of the badge, needed for accessibility support (vocalized by Talkback). + * @property count Optional number displayed in the badge. If not null, the badge has an [OudsBadgeSize.Medium] size. Otherwise, it has an [OudsBadgeSize.ExtraSmall] size. + */ +data class OudsTopAppBarActionBadge(val contentDescription: String, val count: Int? = null) + +private enum class OudsTopAppBarSize { + + Small, Medium, Large +} + +@PreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsTopAppBar(@PreviewParameter(OudsTopAppBarPreviewParameterProvider::class) parameter: OudsTopAppBarPreviewParameter) { + PreviewOudsTopAppBar(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun PreviewOudsTopAppBar( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsTopAppBarPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } +} + +@PreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsCenterAlignedTopAppBar(@PreviewParameter(OudsTopAppBarPreviewParameterProvider::class) parameter: OudsTopAppBarPreviewParameter) { + PreviewOudsCenterAlignedTopAppBar(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun PreviewOudsCenterAlignedTopAppBar( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsTopAppBarPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsCenterAlignedTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } +} + +@PreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsMediumTopAppBar(@PreviewParameter(OudsTopAppBarPreviewParameterProvider::class) parameter: OudsTopAppBarPreviewParameter) { + PreviewOudsMediumTopAppBar(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun PreviewOudsMediumTopAppBar( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsTopAppBarPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsMediumTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } +} + +@PreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsLargeTopAppBar(@PreviewParameter(OudsTopAppBarPreviewParameterProvider::class) parameter: OudsTopAppBarPreviewParameter) { + PreviewOudsLargeTopAppBar(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun PreviewOudsLargeTopAppBar( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsTopAppBarPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsLargeTopAppBar( + title = title, + navigationIcon = navigationIcon, + actions = actions + ) + } +} + +internal data class OudsTopAppBarPreviewParameter( + val title: String = "Title", + val navigationIcon: OudsTopAppBarNavigationIcon? = null, + val actions: List = emptyList() +) + +internal class OudsTopAppBarPreviewParameterProvider() : BasicPreviewParameterProvider(*previewParameterValues.toTypedArray()) + +private val previewParameterValues: List + get() = listOf( + OudsTopAppBarPreviewParameter(), + OudsTopAppBarPreviewParameter( + navigationIcon = OudsTopAppBarNavigationIcon.Back(onClick = {}), + actions = listOf(OudsTopAppBarAction.Icon(imageVector = Icons.Outlined.FavoriteBorder, contentDescription = "", onClick = {})) + ), + OudsTopAppBarPreviewParameter( + navigationIcon = OudsTopAppBarNavigationIcon(imageVector = Icons.Outlined.Settings, contentDescription = "", onClick = {}), + actions = listOf( + OudsTopAppBarAction.Icon( + imageVector = Icons.Outlined.AccountCircle, + contentDescription = "", + badge = OudsTopAppBarActionBadge(contentDescription = "", count = 10), + onClick = {} + ), + OudsTopAppBarAction.Avatar( + painter = PreviewCheckerboardPainter( + squareSize = 6.dp, + primaryColor = Color(0xff247a85), + secondaryColor = Color(0xfffbcd00) + ), + contentDescription = "", + onClick = {} + ), + OudsTopAppBarAction.Avatar( + monogram = 'A', + color = Color.White, + backgroundColor = Color(0xffd5204e), + contentDescription = "", + onClick = {} + ) + ) + ) + ) diff --git a/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentIcon.kt b/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentIcon.kt index e71a5a49e..f753d58c8 100644 --- a/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentIcon.kt +++ b/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentIcon.kt @@ -23,6 +23,7 @@ import androidx.compose.ui.graphics.vector.ImageVector import com.orange.ouds.core.component.OudsButton import com.orange.ouds.core.component.OudsButtonAppearance import com.orange.ouds.core.component.OudsButtonIcon +import com.orange.ouds.core.component.OudsButtonIconBadge import com.orange.ouds.foundation.extensions.orElse /** @@ -33,7 +34,7 @@ import com.orange.ouds.foundation.extensions.orElse abstract class OudsComponentIcon protected constructor( extraParametersClass: Class, private val graphicsObjectProvider: @Composable (S) -> Any, - private val contentDescription: String, + private val contentDescriptionProvider: @Composable (S) -> String, private val onClick: (() -> Unit)? = null, ) : OudsComponentContent(extraParametersClass) where T : OudsComponentContent.ExtraParameters, S : OudsComponentIcon { @@ -42,12 +43,17 @@ abstract class OudsComponentIcon protected constructor( graphicsObject: Any, contentDescription: String, onClick: (() -> Unit)? = null, - ) : this(extraParametersClass, { graphicsObject }, contentDescription, onClick) + ) : this(extraParametersClass, { graphicsObject }, { contentDescription }, onClick) protected open val tint: Color? @Composable get() = null + // The badge is not displayed if onClick is null + internal open val badge: OudsButtonIconBadge? + @Composable + get() = null + protected open val enabled: Boolean? @Composable get() = null @@ -60,6 +66,7 @@ abstract class OudsComponentIcon protected constructor( @Composable override fun Content(modifier: Modifier) { val iconTint = tint.orElse { LocalContentColor.current } + @Suppress("UNCHECKED_CAST") val contentDescription = contentDescriptionProvider(this as S) onClick?.let { onClick -> when (val graphicsObject = graphicsObject) { is Painter -> OudsButtonIcon(painter = graphicsObject, contentDescription = contentDescription) @@ -68,11 +75,13 @@ abstract class OudsComponentIcon protected constructor( else -> null }?.let { buttonIcon -> OudsButton( - icon = buttonIcon, + nullableIcon = buttonIcon, + nullableLabel = null, appearance = OudsButtonAppearance.Minimal, onClick = onClick, modifier = modifier, enabled = enabled.orElse { true }, + iconOnlyBadge = badge ) } }.orElse { @@ -80,7 +89,6 @@ abstract class OudsComponentIcon protected constructor( is Painter -> Icon(painter = graphicsObject, contentDescription = contentDescription, modifier = modifier, tint = iconTint) is ImageVector -> Icon(imageVector = graphicsObject, contentDescription = contentDescription, modifier = modifier, tint = iconTint) is ImageBitmap -> Icon(bitmap = graphicsObject, contentDescription = contentDescription, modifier = modifier, tint = iconTint) - else -> {} } } } diff --git a/core/src/main/java/com/orange/ouds/core/component/content/OudsPolymorphicComponentContent.kt b/core/src/main/java/com/orange/ouds/core/component/content/OudsPolymorphicComponentContent.kt new file mode 100644 index 000000000..1f3f92d2d --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/content/OudsPolymorphicComponentContent.kt @@ -0,0 +1,45 @@ +/* + * 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.content + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + +/** + * A marker interface for objects that can represent multiple [OudsComponentContent]. + * This interface is typically implemented by sealed interface where subclasses are different implementations of [OudsComponentContent]. + */ +// Using extension methods instead of adding them to the interface allows to use the internal keyword +interface OudsPolymorphicComponentContent + +@Composable +internal fun OudsPolymorphicComponentContent.PolymorphicContent() { + return (this as OudsComponentContent<*>).Content() +} + +@Composable +internal fun OudsPolymorphicComponentContent.PolymorphicContent(modifier: Modifier) { + return (this as OudsComponentContent<*>).Content(modifier) +} + +@Composable +internal fun OudsPolymorphicComponentContent.PolymorphicContent(extraParameters: T) { + @Suppress("UNCHECKED_CAST") + return (this as OudsComponentContent).Content(extraParameters) +} + +@Composable +internal fun OudsPolymorphicComponentContent.PolymorphicContent(modifier: Modifier, extraParameters: T) { + @Suppress("UNCHECKED_CAST") + return (this as OudsComponentContent).Content(modifier, extraParameters) +} diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsTagSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsTagSamples.kt index 30d94b908..efe1de660 100644 --- a/core/src/main/java/com/orange/ouds/core/component/samples/OudsTagSamples.kt +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsTagSamples.kt @@ -17,7 +17,7 @@ import androidx.compose.material.icons.filled.FavoriteBorder import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.PreviewLightDark import com.orange.ouds.core.component.OudsTag -import com.orange.ouds.core.component.OudsTagIcon +import com.orange.ouds.core.component.OudsTagAsset import com.orange.ouds.core.component.OudsTagSize import com.orange.ouds.core.component.OudsTagStatus import com.orange.ouds.core.utilities.OudsPreview @@ -35,7 +35,7 @@ internal fun OudsTagSample() { internal fun OudsTagWithBulletSample() { OudsTag( label = "Tag", - status = OudsTagStatus.Positive(icon = OudsTagIcon.Bullet) + status = OudsTagStatus.Positive(asset = OudsTagAsset.Bullet) ) } @@ -43,15 +43,15 @@ internal fun OudsTagWithBulletSample() { internal fun OudsTagWithDefaultIconSample() { OudsTag( label = "Tag", - status = OudsTagStatus.Positive(icon = OudsTagIcon.Default) + status = OudsTagStatus.Positive(asset = OudsTagAsset.Icon.Default) ) } @Composable -internal fun OudsTagWithCustomIconSample() { +internal fun OudsTagWithIconSample() { OudsTag( label = "Tag", - status = OudsTagStatus.Neutral(icon = OudsTagIcon.Custom(imageVector = Icons.Filled.FavoriteBorder)) + status = OudsTagStatus.Neutral(asset = OudsTagAsset.Icon(imageVector = Icons.Filled.FavoriteBorder)) ) } @@ -75,6 +75,6 @@ private fun PreviewOudsTagWithDefaultIconSample() = OudsPreview { @PreviewLightDark @Composable -private fun PreviewOudsTagWithCustomIconSample() = OudsPreview { - OudsTagWithCustomIconSample() +private fun PreviewOudsTagWithIconSample() = OudsPreview { + OudsTagWithIconSample() } \ No newline at end of file diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsTopAppBarSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsTopAppBarSamples.kt new file mode 100644 index 000000000..8179de9c2 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsTopAppBarSamples.kt @@ -0,0 +1,103 @@ +/* + * 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.material.icons.Icons +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.tooling.preview.PreviewLightDark +import com.orange.ouds.core.component.OudsCenterAlignedTopAppBar +import com.orange.ouds.core.component.OudsLargeTopAppBar +import com.orange.ouds.core.component.OudsMediumTopAppBar +import com.orange.ouds.core.component.OudsTopAppBar +import com.orange.ouds.core.component.OudsTopAppBarAction +import com.orange.ouds.core.component.OudsTopAppBarNavigationIcon +import com.orange.ouds.core.utilities.OudsPreview + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun OudsTopAppBarSample() { + OudsTopAppBar( + title = "Title", + navigationIcon = OudsTopAppBarNavigationIcon.Back {}, + actions = listOf( + OudsTopAppBarAction.Icon(Icons.Outlined.FavoriteBorder, "") {}, + OudsTopAppBarAction.Avatar(monogram = 'A', color = Color.White, backgroundColor = Color(0xffd5204e), "") {} + ) + ) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun OudsCenterAlignedTopAppBarSample() { + OudsCenterAlignedTopAppBar( + title = "Title", + navigationIcon = OudsTopAppBarNavigationIcon.Back {}, + actions = listOf( + OudsTopAppBarAction.Icon(Icons.Outlined.FavoriteBorder, "") {}, + OudsTopAppBarAction.Avatar(monogram = 'A', color = Color.White, backgroundColor = Color(0xff247a85), "") {} + ) + ) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun OudsMediumTopAppBarSample() { + OudsMediumTopAppBar( + title = "Title", + navigationIcon = OudsTopAppBarNavigationIcon.Back {}, + actions = listOf( + OudsTopAppBarAction.Icon(Icons.Outlined.FavoriteBorder, "") {}, + OudsTopAppBarAction.Avatar(monogram = 'A', color = Color.Black, backgroundColor = Color(0xfffbcd00), "") {} + ) + ) +} + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +internal fun OudsLargeTopAppBarSample() { + OudsLargeTopAppBar( + title = "Title", + navigationIcon = OudsTopAppBarNavigationIcon.Back {}, + actions = listOf( + OudsTopAppBarAction.Icon(Icons.Outlined.FavoriteBorder, "") {}, + OudsTopAppBarAction.Avatar(monogram = 'A', color = Color.White, backgroundColor = Color(0xff0073b2), "") {} + ) + ) +} + +@PreviewLightDark +@Composable +private fun PreviewOudsTopAppBarSample() = OudsPreview { + OudsTopAppBarSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsCenterAlignedTopAppBarSample() = OudsPreview { + OudsCenterAlignedTopAppBarSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsMediumTopAppBarSample() = OudsPreview { + OudsMediumTopAppBarSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsLargeTopAppBarSample() = OudsPreview { + OudsLargeTopAppBarSample() +} diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt index e91bfeb2a..071740936 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsBorders.kt @@ -269,20 +269,26 @@ fun Modifier.dottedBorder( * @param shape The shape of the border. * @param insetWidth The width of the border inset in dp. Use [Dp.Hairline] for a hairline border inset. * @param insetColor The color to paint the border inset with. + * @param innerOffsetPx An offset applied to the inner side of the border, in pixels. + * The offset is applied to the border inset if it exists, or to the border itself otherwise. + * Use this parameter to avoid graphical glitches when drawing borders. */ -fun Modifier.outerBorder( +internal fun Modifier.outerBorder( width: Dp, color: Color, shape: Shape = RectangleShape, insetWidth: Dp = Dp.Unspecified, - insetColor: Color = Color.Unspecified + insetColor: Color = Color.Unspecified, + innerOffsetPx: Float = 0f ) = drawWithContent { + val hasInset = insetWidth.isSpecified && insetWidth > 0.dp && insetColor.alpha != 0f + // Make the border 1 pixel smaller on the inner side if there is an inset, otherwise for some reason the border can be visible behind the inset on the inner side + // If there is no inset, apply the innerOffsetPx parameter + val borderInnerOffsetPx = if (hasInset) 1f else innerOffsetPx + val insetInnerOffsetPx = if (hasInset) innerOffsetPx else 0f + drawOuterBorder(width, color, shape, borderInnerOffsetPx) + drawOuterBorder(insetWidth, insetColor, shape, insetInnerOffsetPx) drawContent() - // Make the border 1 pixel smaller on the inner side if there is an inset - // Otherwise, for some reason the border can be visible behind the inset on the inner side - val innerOffsetPx = if (insetWidth.isSpecified && insetWidth > 0.dp && insetColor.alpha != 0f) 1f else 0f - drawOuterBorder(width, color, shape, innerOffsetPx) - drawOuterBorder(insetWidth, insetColor, shape) } private fun DrawScope.drawOuterBorder(width: Dp, color: Color, shape: Shape, innerOffsetPx: Float = 0f) { diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsComponents.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsComponents.kt index 1e38e0c97..877330e79 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsComponents.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsComponents.kt @@ -18,16 +18,16 @@ import com.orange.ouds.theme.tokens.components.OudsComponentsTokens * @suppress */ data class OudsComponents( - val navigationBar: NavigationBar + val bar: Bar ) { - data class NavigationBar( + data class Bar( val blurRadius: Int ) } internal fun OudsComponentsTokens.getComponents() = OudsComponents( - navigationBar = OudsComponents.NavigationBar( + bar = OudsComponents.Bar( blurRadius = bar.effectBgBlur ) ) diff --git a/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt b/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt index dcfd8959c..eba5e20cb 100644 --- a/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt +++ b/core/src/main/java/com/orange/ouds/core/theme/OudsTypography.kt @@ -27,6 +27,7 @@ import com.orange.ouds.theme.tokens.semantic.OudsFontSemanticTokens * @suppress */ data class OudsTypography( + val fontFamily: FontFamily, val display: Display, val heading: Heading, val body: Body, @@ -100,6 +101,7 @@ data class OudsTypography( internal fun OudsFontSemanticTokens.getTypography(fontFamily: FontFamily, windowWidthSizeClass: WindowWidthSizeClass) = with(windowWidthSizeClass) { val lineHeightStyle = LineHeightStyle(alignment = LineHeightStyle.Alignment.Proportional, trim = LineHeightStyle.Trim.None) OudsTypography( + fontFamily = fontFamily, display = OudsTypography.Display( large = TextStyle( fontFamily = fontFamily, diff --git a/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt b/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt index 2e241843b..177382b3e 100644 --- a/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt +++ b/core/src/main/java/com/orange/ouds/core/utilities/OudsPreview.kt @@ -27,8 +27,14 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.drawscope.DrawScope +import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.orange.ouds.core.extensions.isNightModeEnabled @@ -38,6 +44,7 @@ import com.orange.ouds.theme.OudsThemeContract import com.orange.ouds.theme.OudsThemeSettings import com.orange.ouds.theme.orange.OrangeTheme import kotlin.enums.enumEntries +import kotlin.math.ceil internal val LocalPreviewEnumEntry = staticCompositionLocalOf { null } @@ -193,4 +200,27 @@ internal val PreviewPaddingDefault = 16.dp * Long text used in previews. */ internal const val LoremIpsumText = - "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." \ No newline at end of file + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." + +internal class PreviewCheckerboardPainter(val squareSize: Dp, val primaryColor: Color, val secondaryColor: Color) : Painter() { + + override val intrinsicSize = Size.Unspecified + + override fun DrawScope.onDraw() { + val squareSizePx = squareSize.toPx() + val columnCount = ceil(size.width / squareSizePx).toInt() + val rowCount = ceil(size.height / squareSizePx).toInt() + val drawSize = Size(squareSizePx, squareSizePx) + + repeat(rowCount) { row -> + repeat(columnCount) { column -> + val color = if ((row + column) % 2 == 0) primaryColor else secondaryColor + drawRect( + color = color, + topLeft = Offset(column * squareSizePx, row * squareSizePx), + size = drawSize + ) + } + } + } +} diff --git a/core/src/main/java/com/orange/ouds/core/utilities/OudsPreviewableComponent.kt b/core/src/main/java/com/orange/ouds/core/utilities/OudsPreviewableComponent.kt index f8c8bdaea..0da3a9737 100644 --- a/core/src/main/java/com/orange/ouds/core/utilities/OudsPreviewableComponent.kt +++ b/core/src/main/java/com/orange/ouds/core/utilities/OudsPreviewableComponent.kt @@ -19,6 +19,7 @@ import com.orange.ouds.core.component.OudsBadgeWithIconPreviewParameter import com.orange.ouds.core.component.OudsBadgeWithIconPreviewParameterProvider import com.orange.ouds.core.component.OudsButtonPreviewParameter import com.orange.ouds.core.component.OudsButtonPreviewParameterProvider +import com.orange.ouds.core.component.OudsButtonWithIconBadgePreviewParameterProvider import com.orange.ouds.core.component.OudsCheckboxItemHighContrastModePreviewParameter import com.orange.ouds.core.component.OudsCheckboxItemHighContrastModePreviewParameterProvider import com.orange.ouds.core.component.OudsCheckboxItemPreviewParameter @@ -51,10 +52,14 @@ import com.orange.ouds.core.component.OudsTagPreviewParameter import com.orange.ouds.core.component.OudsTagPreviewParameterProvider import com.orange.ouds.core.component.OudsTextInputPreviewParameter import com.orange.ouds.core.component.OudsTextInputPreviewParameterProvider +import com.orange.ouds.core.component.OudsTopAppBarPreviewParameter +import com.orange.ouds.core.component.OudsTopAppBarPreviewParameterProvider import com.orange.ouds.core.component.PreviewOudsBadge import com.orange.ouds.core.component.PreviewOudsBadgeWithIcon import com.orange.ouds.core.component.PreviewOudsButton +import com.orange.ouds.core.component.PreviewOudsButtonWithIconBadge import com.orange.ouds.core.component.PreviewOudsButtonWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsCenterAlignedTopAppBar import com.orange.ouds.core.component.PreviewOudsCheckbox import com.orange.ouds.core.component.PreviewOudsCheckboxItem import com.orange.ouds.core.component.PreviewOudsCheckboxItemHighContrastModeEnabled @@ -64,8 +69,10 @@ import com.orange.ouds.core.component.PreviewOudsColoredBox import com.orange.ouds.core.component.PreviewOudsDivider import com.orange.ouds.core.component.PreviewOudsFilterChip import com.orange.ouds.core.component.PreviewOudsInputTag +import com.orange.ouds.core.component.PreviewOudsLargeTopAppBar import com.orange.ouds.core.component.PreviewOudsLink import com.orange.ouds.core.component.PreviewOudsLinkOnTwoLines +import com.orange.ouds.core.component.PreviewOudsMediumTopAppBar import com.orange.ouds.core.component.PreviewOudsNavigationBar import com.orange.ouds.core.component.PreviewOudsNavigationBarItem import com.orange.ouds.core.component.PreviewOudsRadioButton @@ -82,6 +89,7 @@ import com.orange.ouds.core.component.PreviewOudsTag import com.orange.ouds.core.component.PreviewOudsTextInput import com.orange.ouds.core.component.PreviewOudsTextInputWithLongLabels import com.orange.ouds.core.component.PreviewOudsTextInputWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsTopAppBar import com.orange.ouds.foundation.InternalOudsApi import com.orange.ouds.theme.OudsThemeContract @@ -157,6 +165,21 @@ interface OudsPreviewableComponent { override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = !darkThemeEnabled && !highContrastModeEnabled } + + object WithIconBadge : OudsPreviewableComponent { + + override val parameters: List = OudsButtonWithIconBadgePreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsButtonWithIconBadge( + theme = theme, + count = parameter as Int + ) + } + + override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = !darkThemeEnabled && !highContrastModeEnabled + } } object CheckboxItem { @@ -251,31 +274,49 @@ interface OudsPreviewableComponent { } } - object FilterChip : OudsPreviewableComponent { + object Divider { - override val parameters: List = OudsFilterChipPreviewParameterProvider().values.toList() + object Horizontal : OudsPreviewableComponent { - @Composable - override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { - PreviewOudsFilterChip( - theme = theme, - darkThemeEnabled = darkThemeEnabled, - parameter = parameter as OudsFilterChipPreviewParameter - ) + override val parameters: List = OudsDividerPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsDivider( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + orientation = OudsDividerOrientation.Horizontal, + color = parameter as OudsDividerColor + ) + } + } + + object Vertical : OudsPreviewableComponent { + + override val parameters: List = OudsDividerPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsDivider( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + orientation = OudsDividerOrientation.Vertical, + color = parameter as OudsDividerColor + ) + } } } - object HorizontalDivider : OudsPreviewableComponent { + object FilterChip : OudsPreviewableComponent { - override val parameters: List = OudsDividerPreviewParameterProvider().values.toList() + override val parameters: List = OudsFilterChipPreviewParameterProvider().values.toList() @Composable override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { - PreviewOudsDivider( + PreviewOudsFilterChip( theme = theme, darkThemeEnabled = darkThemeEnabled, - orientation = OudsDividerOrientation.Horizontal, - color = parameter as OudsDividerColor + parameter = parameter as OudsFilterChipPreviewParameter ) } } @@ -557,18 +598,62 @@ interface OudsPreviewableComponent { } } - object VerticalDivider : OudsPreviewableComponent { + object TopAppBar { + + object Default : OudsPreviewableComponent { - override val parameters: List = OudsDividerPreviewParameterProvider().values.toList() + override val parameters: List = OudsTopAppBarPreviewParameterProvider().values.toList() - @Composable - override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { - PreviewOudsDivider( - theme = theme, - darkThemeEnabled = darkThemeEnabled, - orientation = OudsDividerOrientation.Vertical, - color = parameter as OudsDividerColor - ) + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsTopAppBar( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsTopAppBarPreviewParameter + ) + } + } + + object CenterAligned : OudsPreviewableComponent { + + override val parameters: List = OudsTopAppBarPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsCenterAlignedTopAppBar( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsTopAppBarPreviewParameter + ) + } + } + + object Medium : OudsPreviewableComponent { + + override val parameters: List = OudsTopAppBarPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsMediumTopAppBar( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsTopAppBarPreviewParameter + ) + } + } + + object Large : OudsPreviewableComponent { + + override val parameters: List = OudsTopAppBarPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsLargeTopAppBar( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsTopAppBarPreviewParameter + ) + } } } } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index d4fdd67e5..57eb54826 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -13,6 +13,10 @@ Loading + Back + Close + Menu + Empty Error diff --git a/core/src/test/java/com/orange/ouds/core/component/OudsBadgedIconTest.kt b/core/src/test/java/com/orange/ouds/core/component/OudsBadgedIconTest.kt new file mode 100644 index 000000000..9d3d16b3d --- /dev/null +++ b/core/src/test/java/com/orange/ouds/core/component/OudsBadgedIconTest.kt @@ -0,0 +1,38 @@ +/* + * 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 + +import androidx.compose.runtime.Composable +import com.orange.ouds.core.test.OudsSnapshotTest +import com.orange.ouds.theme.orange.OrangeTheme +import org.junit.runner.RunWith +import org.junit.runners.Parameterized + +@RunWith(Parameterized::class) +internal class OudsBadgedIconTest(val parameter: OudsBadgedIconPreviewParameter) : OudsSnapshotTest(theme = OrangeTheme()) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsBadgedIconPreviewParameterProvider().values.toList() + } + + @Composable + override fun Snapshot(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) { + PreviewOudsBadgedIcon( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter + ) + } +} diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..38a535e5d Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..4312f8185 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[2].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..14f5f0f1e Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[2].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[3].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[3].png new file mode 100644 index 000000000..e0c41a018 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[3].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[4].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[4].png new file mode 100644 index 000000000..1f8796309 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeDarkThemeSnapshot[4].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..2c2cf2275 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..841416ee5 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[2].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..be1474d40 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[2].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[3].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[3].png new file mode 100644 index 000000000..73c55712b Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[3].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[4].png b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[4].png new file mode 100644 index 000000000..e8af0df4f Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component_OudsBadgedIconTest_takeLightThemeSnapshot[4].png differ diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/OudsDrawableResources.kt b/theme-contract/src/main/java/com/orange/ouds/theme/OudsDrawableResources.kt index 4755873ee..371c9f155 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/OudsDrawableResources.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/OudsDrawableResources.kt @@ -18,6 +18,7 @@ import com.orange.ouds.foundation.InternalOudsApi @InternalOudsApi interface OudsDrawableResources { val component: Component + val functional: Functional interface Component { val alert: Alert @@ -81,4 +82,22 @@ interface OudsDrawableResources { val close: Int } } + + interface Functional { + val actions: Actions + val navigation: Navigation + + interface Actions { + @get:DrawableRes + val delete: Int + } + + interface Navigation { + @get:DrawableRes + val formChevronLeft: Int + + @get:DrawableRes + val menu: Int + } + } } \ No newline at end of file diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/OudsVersion.kt b/theme-contract/src/main/java/com/orange/ouds/theme/OudsVersion.kt index c9c57bdc9..9c38a83f6 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/OudsVersion.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/OudsVersion.kt @@ -23,6 +23,7 @@ object OudsVersion { const val Chip = "1.3.0" const val Divider = "1.0.0" const val Link = "2.2.0" + const val Bar = "1.0.0" const val RadioButton = "1.4.0" const val Switch = "1.5.0" const val Tag = "1.4.0" diff --git a/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeDrawableResources.kt b/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeDrawableResources.kt index 69d041fca..5a21686a1 100644 --- a/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeDrawableResources.kt +++ b/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeDrawableResources.kt @@ -15,7 +15,9 @@ package com.orange.ouds.theme.orange import com.orange.ouds.theme.OudsDrawableResources internal class OrangeDrawableResources : OudsDrawableResources { + override val component = Component() + override val functional = Functional() class Component : OudsDrawableResources.Component { override val alert = Alert() @@ -25,39 +27,53 @@ internal class OrangeDrawableResources : OudsDrawableResources { override val radioButton = RadioButton() override val switch = Switch() override val tag = Tag() - } - class Alert : OudsDrawableResources.Component.Alert { - override val importantFill = R.drawable.ic_orange_component_alert_important_fill - override val infoFill = R.drawable.ic_orange_component_alert_info_fill - override val tickConfirmationFill = R.drawable.ic_orange_component_alert_tick_confirmation_fill - override val warningExternalShape = R.drawable.ic_orange_component_alert_warning_external_shape - override val warningInternalShape = R.drawable.ic_orange_component_alert_warning_internal_shape - } + class Alert : OudsDrawableResources.Component.Alert { + override val importantFill = R.drawable.ic_orange_component_alert_important_fill + override val infoFill = R.drawable.ic_orange_component_alert_info_fill + override val tickConfirmationFill = R.drawable.ic_orange_component_alert_tick_confirmation_fill + override val warningExternalShape = R.drawable.ic_orange_component_alert_warning_external_shape + override val warningInternalShape = R.drawable.ic_orange_component_alert_warning_internal_shape + } - class Checkbox : OudsDrawableResources.Component.Checkbox { - override val selected = R.drawable.ic_orange_component_checkbox_selected - override val undetermined = R.drawable.ic_orange_component_checkbox_undetermined - } + class Checkbox : OudsDrawableResources.Component.Checkbox { + override val selected = R.drawable.ic_orange_component_checkbox_selected + override val undetermined = R.drawable.ic_orange_component_checkbox_undetermined + } - class Chip : OudsDrawableResources.Component.Chip { - override val tick = R.drawable.ic_orange_component_chip_tick - } + class Chip : OudsDrawableResources.Component.Chip { + override val tick = R.drawable.ic_orange_component_chip_tick + } - class Link : OudsDrawableResources.Component.Link { - override val next = R.drawable.ic_orange_component_link_next - override val previous = R.drawable.ic_orange_component_link_previous - } + class Link : OudsDrawableResources.Component.Link { + override val next = R.drawable.ic_orange_component_link_next + override val previous = R.drawable.ic_orange_component_link_previous + } - class RadioButton : OudsDrawableResources.Component.RadioButton { - override val selected = R.drawable.ic_orange_component_radio_button_selected - } + class RadioButton : OudsDrawableResources.Component.RadioButton { + override val selected = R.drawable.ic_orange_component_radio_button_selected + } + + class Switch : OudsDrawableResources.Component.Switch { + override val selected = R.drawable.ic_orange_component_switch_selected_switch + } - class Switch : OudsDrawableResources.Component.Switch { - override val selected = R.drawable.ic_orange_component_switch_selected_switch + class Tag : OudsDrawableResources.Component.Tag { + override val close = R.drawable.ic_orange_component_tag_close + } } - class Tag : OudsDrawableResources.Component.Tag { - override val close = R.drawable.ic_orange_component_tag_close + class Functional : OudsDrawableResources.Functional { + override val actions = Actions() + override val navigation = Navigation() + + class Actions : OudsDrawableResources.Functional.Actions { + override val delete = R.drawable.ic_orange_functional_actions_delete + } + + class Navigation : OudsDrawableResources.Functional.Navigation { + override val formChevronLeft = R.drawable.ic_orange_functional_navigation_form_chevron_left + override val menu = R.drawable.ic_orange_functional_navigation_menu + } } -} \ No newline at end of file +} diff --git a/theme-orange/src/main/res/drawable/ic_orange_functional_actions_delete.xml b/theme-orange/src/main/res/drawable/ic_orange_functional_actions_delete.xml new file mode 100644 index 000000000..7f54bfa26 --- /dev/null +++ b/theme-orange/src/main/res/drawable/ic_orange_functional_actions_delete.xml @@ -0,0 +1,10 @@ + + + diff --git a/theme-orange/src/main/res/drawable/ic_orange_functional_navigation_form_chevron_left.xml b/theme-orange/src/main/res/drawable/ic_orange_functional_navigation_form_chevron_left.xml new file mode 100644 index 000000000..148376706 --- /dev/null +++ b/theme-orange/src/main/res/drawable/ic_orange_functional_navigation_form_chevron_left.xml @@ -0,0 +1,11 @@ + + + diff --git a/theme-orange/src/main/res/drawable/ic_orange_functional_navigation_menu.xml b/theme-orange/src/main/res/drawable/ic_orange_functional_navigation_menu.xml new file mode 100644 index 000000000..95fe8eaa7 --- /dev/null +++ b/theme-orange/src/main/res/drawable/ic_orange_functional_navigation_menu.xml @@ -0,0 +1,10 @@ + + + diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png deleted file mode 100644 index 054a6beb5..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png deleted file mode 100644 index 9e2e052a7..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png deleted file mode 100644 index 4c5016448..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png deleted file mode 100644 index e8d232e9e..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png deleted file mode 100644 index 79f8b5abc..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png deleted file mode 100644 index 28a316501..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png deleted file mode 100644 index 52a715e7f..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png deleted file mode 100644 index 23ebd8e36..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png deleted file mode 100644 index 1a1406e1a..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png deleted file mode 100644 index 02e62b966..000000000 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png and /dev/null differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..d82ef4b68 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..77b86836d Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png similarity index 100% rename from theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png rename to theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png index 3ea5435d4..89e71d833 100644 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png index 8767aee57..b72792fe4 100644 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png index 53a29dd90..64892e67d 100644 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png index 13f71c445..c74121d0a 100644 Binary files a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..90cbc9adb Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..41d9cad78 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..24e92541e Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..48479f791 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..74e3a640a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..98812d7a3 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..a2fcd19e7 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..0b57f7292 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..f52c758e4 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..2be9a789c Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..66230c263 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..d49cc5cb8 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..c7d05200e Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..e6472bba5 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..96bc5ab49 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..d2e89965e Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..42a87450e Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..0a9d37bb7 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..02f02bc10 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..caaa13afe Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..465df1eb8 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..111570498 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..892e815da Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..eb839a831 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/SoshDrawableResources.kt b/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/SoshDrawableResources.kt index dde67faf3..cfd94f00f 100644 --- a/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/SoshDrawableResources.kt +++ b/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/SoshDrawableResources.kt @@ -16,6 +16,7 @@ import com.orange.ouds.theme.OudsDrawableResources internal class SoshDrawableResources : OudsDrawableResources { override val component = Component() + override val functional = Functional() class Component : OudsDrawableResources.Component { override val alert = Alert() @@ -25,39 +26,53 @@ internal class SoshDrawableResources : OudsDrawableResources { override val radioButton = RadioButton() override val switch = Switch() override val tag = Tag() - } - class Alert : OudsDrawableResources.Component.Alert { - override val importantFill = R.drawable.ic_sosh_component_alert_important_fill - override val infoFill = R.drawable.ic_sosh_component_alert_info_fill - override val tickConfirmationFill = R.drawable.ic_sosh_component_alert_tick_confirmation_fill - override val warningExternalShape = R.drawable.ic_sosh_component_alert_warning_external_shape - override val warningInternalShape = R.drawable.ic_sosh_component_alert_warning_internal_shape - } + class Alert : OudsDrawableResources.Component.Alert { + override val importantFill = R.drawable.ic_sosh_component_alert_important_fill + override val infoFill = R.drawable.ic_sosh_component_alert_info_fill + override val tickConfirmationFill = R.drawable.ic_sosh_component_alert_tick_confirmation_fill + override val warningExternalShape = R.drawable.ic_sosh_component_alert_warning_external_shape + override val warningInternalShape = R.drawable.ic_sosh_component_alert_warning_internal_shape + } - class Checkbox : OudsDrawableResources.Component.Checkbox { - override val selected = R.drawable.ic_sosh_component_checkbox_selected - override val undetermined = R.drawable.ic_sosh_component_checkbox_undetermined - } + class Checkbox : OudsDrawableResources.Component.Checkbox { + override val selected = R.drawable.ic_sosh_component_checkbox_selected + override val undetermined = R.drawable.ic_sosh_component_checkbox_undetermined + } - class Chip : OudsDrawableResources.Component.Chip { - override val tick = R.drawable.ic_sosh_component_chip_tick - } + class Chip : OudsDrawableResources.Component.Chip { + override val tick = R.drawable.ic_sosh_component_chip_tick + } - class Link : OudsDrawableResources.Component.Link { - override val next = R.drawable.ic_sosh_component_link_next - override val previous = R.drawable.ic_sosh_component_link_previous - } + class Link : OudsDrawableResources.Component.Link { + override val next = R.drawable.ic_sosh_component_link_next + override val previous = R.drawable.ic_sosh_component_link_previous + } - class RadioButton : OudsDrawableResources.Component.RadioButton { - override val selected = R.drawable.ic_sosh_component_radio_button_selected - } + class RadioButton : OudsDrawableResources.Component.RadioButton { + override val selected = R.drawable.ic_sosh_component_radio_button_selected + } + + class Switch : OudsDrawableResources.Component.Switch { + override val selected = R.drawable.ic_sosh_component_switch_selected_switch + } - class Switch : OudsDrawableResources.Component.Switch { - override val selected = R.drawable.ic_sosh_component_switch_selected_switch + class Tag : OudsDrawableResources.Component.Tag { + override val close = R.drawable.ic_sosh_component_tag_close + } } - class Tag : OudsDrawableResources.Component.Tag { - override val close = R.drawable.ic_sosh_component_tag_close + class Functional : OudsDrawableResources.Functional { + override val actions = Actions() + override val navigation = Navigation() + + class Actions : OudsDrawableResources.Functional.Actions { + override val delete = R.drawable.ic_sosh_functional_actions_delete + } + + class Navigation : OudsDrawableResources.Functional.Navigation { + override val formChevronLeft = R.drawable.ic_sosh_functional_navigation_form_chevron_left + override val menu = R.drawable.ic_sosh_functional_navigation_menu + } } -} \ No newline at end of file +} diff --git a/theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_delete.xml b/theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_delete.xml new file mode 100644 index 000000000..b3afe8a40 --- /dev/null +++ b/theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_delete.xml @@ -0,0 +1,10 @@ + + + diff --git a/theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_form_chevron_left.xml b/theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_form_chevron_left.xml new file mode 100644 index 000000000..abe34c7a6 --- /dev/null +++ b/theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_form_chevron_left.xml @@ -0,0 +1,11 @@ + + + diff --git a/theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_menu.xml b/theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_menu.xml new file mode 100644 index 000000000..2c10579b9 --- /dev/null +++ b/theme-sosh/src/main/res/drawable/ic_sosh_functional_navigation_menu.xml @@ -0,0 +1,10 @@ + + + diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png deleted file mode 100644 index 72a9472d2..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png deleted file mode 100644 index 49cee984d..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png deleted file mode 100644 index 29826b8da..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png deleted file mode 100644 index 88e4339f8..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png deleted file mode 100644 index 16ca27eff..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png deleted file mode 100644 index 9d56d647b..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png deleted file mode 100644 index caefd450b..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png deleted file mode 100644 index bc021044c..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png deleted file mode 100644 index 483eb3fa8..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png deleted file mode 100644 index 1bb38d5b8..000000000 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png and /dev/null differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..56f53e547 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..da75626e9 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png similarity index 100% rename from theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png rename to theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png index 0e8af1149..0aec188be 100644 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png index a14c66d2f..53b9e804a 100644 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png index 1d4cbed85..87bec3c26 100644 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png index e104e5821..5cc808e56 100644 Binary files a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..df8c89057 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..76cd1fba7 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..7112e08cf Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..48a932756 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..07510c699 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..8ab5e13d8 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..e0dc00af0 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..811313b9f Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..6b2d26413 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..c04ec0c85 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..6079d12af Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..f41086b02 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..3c5543f93 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..71bc6af85 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..401e6e32a Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..15a034683 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..f3c01f4bc Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..2f13ccc36 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..0c5f61a17 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..d1289d370 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..efb19558c Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..22a47b34b Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..6578afa95 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..32bf667c9 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/main/java/com/orange/ouds/theme/wireframe/WireframeDrawableResources.kt b/theme-wireframe/src/main/java/com/orange/ouds/theme/wireframe/WireframeDrawableResources.kt index 9571436b6..609da310f 100644 --- a/theme-wireframe/src/main/java/com/orange/ouds/theme/wireframe/WireframeDrawableResources.kt +++ b/theme-wireframe/src/main/java/com/orange/ouds/theme/wireframe/WireframeDrawableResources.kt @@ -16,6 +16,7 @@ import com.orange.ouds.theme.OudsDrawableResources internal class WireframeDrawableResources : OudsDrawableResources { override val component = Component() + override val functional = Functional() class Component : OudsDrawableResources.Component { override val alert = Alert() @@ -25,39 +26,53 @@ internal class WireframeDrawableResources : OudsDrawableResources { override val radioButton = RadioButton() override val switch = Switch() override val tag = Tag() - } - class Alert : OudsDrawableResources.Component.Alert { - override val importantFill = R.drawable.ic_wireframe_component_alert_important_fill - override val infoFill = R.drawable.ic_wireframe_component_alert_info_fill - override val tickConfirmationFill = R.drawable.ic_wireframe_component_alert_tick_confirmation_fill - override val warningExternalShape = R.drawable.ic_wireframe_component_alert_warning_external_shape - override val warningInternalShape = R.drawable.ic_wireframe_component_alert_warning_internal_shape - } + class Alert : OudsDrawableResources.Component.Alert { + override val importantFill = R.drawable.ic_wireframe_component_alert_important_fill + override val infoFill = R.drawable.ic_wireframe_component_alert_info_fill + override val tickConfirmationFill = R.drawable.ic_wireframe_component_alert_tick_confirmation_fill + override val warningExternalShape = R.drawable.ic_wireframe_component_alert_warning_external_shape + override val warningInternalShape = R.drawable.ic_wireframe_component_alert_warning_internal_shape + } - class Checkbox : OudsDrawableResources.Component.Checkbox { - override val selected = R.drawable.ic_wireframe_component_checkbox_selected - override val undetermined = R.drawable.ic_wireframe_component_checkbox_undetermined - } + class Checkbox : OudsDrawableResources.Component.Checkbox { + override val selected = R.drawable.ic_wireframe_component_checkbox_selected + override val undetermined = R.drawable.ic_wireframe_component_checkbox_undetermined + } - class Chip : OudsDrawableResources.Component.Chip { - override val tick = R.drawable.ic_wireframe_component_chip_tick - } + class Chip : OudsDrawableResources.Component.Chip { + override val tick = R.drawable.ic_wireframe_component_chip_tick + } - class Link : OudsDrawableResources.Component.Link { - override val next = R.drawable.ic_wireframe_component_link_next - override val previous = R.drawable.ic_wireframe_component_link_previous - } + class Link : OudsDrawableResources.Component.Link { + override val next = R.drawable.ic_wireframe_component_link_next + override val previous = R.drawable.ic_wireframe_component_link_previous + } - class RadioButton : OudsDrawableResources.Component.RadioButton { - override val selected = R.drawable.ic_wireframe_component_radio_button_selected - } + class RadioButton : OudsDrawableResources.Component.RadioButton { + override val selected = R.drawable.ic_wireframe_component_radio_button_selected + } + + class Switch : OudsDrawableResources.Component.Switch { + override val selected = R.drawable.ic_wireframe_component_switch_selected_switch + } - class Switch : OudsDrawableResources.Component.Switch { - override val selected = R.drawable.ic_wireframe_component_switch_selected_switch + class Tag : OudsDrawableResources.Component.Tag { + override val close = R.drawable.ic_wireframe_component_tag_close + } } - class Tag : OudsDrawableResources.Component.Tag { - override val close = R.drawable.ic_wireframe_component_tag_close + class Functional : OudsDrawableResources.Functional { + override val actions = Actions() + override val navigation = Navigation() + + class Actions : OudsDrawableResources.Functional.Actions { + override val delete = R.drawable.ic_wireframe_functional_actions_delete + } + + class Navigation : OudsDrawableResources.Functional.Navigation { + override val formChevronLeft = R.drawable.ic_wireframe_functional_navigation_form_chevron_left + override val menu = R.drawable.ic_wireframe_functional_navigation_menu + } } } diff --git a/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_delete.xml b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_delete.xml new file mode 100644 index 000000000..7307d22e3 --- /dev/null +++ b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_delete.xml @@ -0,0 +1,9 @@ + + + diff --git a/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_form_chevron_left.xml b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_form_chevron_left.xml new file mode 100644 index 000000000..51fb83f2c --- /dev/null +++ b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_form_chevron_left.xml @@ -0,0 +1,10 @@ + + + diff --git a/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_menu.xml b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_menu.xml new file mode 100644 index 000000000..e740da4f7 --- /dev/null +++ b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_navigation_menu.xml @@ -0,0 +1,9 @@ + + + diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png deleted file mode 100644 index e95ace7a4..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[0].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png deleted file mode 100644 index 93c2397ab..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[1].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png deleted file mode 100644 index 81321606c..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[2].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png deleted file mode 100644 index c843dba42..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[3].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png deleted file mode 100644 index 09a029679..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeDarkThemeSnapshot[4].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png deleted file mode 100644 index 80acb8dd8..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[0].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png deleted file mode 100644 index 482c69edb..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[1].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png deleted file mode 100644 index 88372d20a..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[2].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png deleted file mode 100644 index 9ce8cb847..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[3].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png deleted file mode 100644 index cf3e3a556..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsBadgeTest_takeLightThemeSnapshot[4].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..dedfe4f85 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..0cd5b0be7 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsButtonTest$WithIconBadge_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..d20f1b1ec Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..e2820fbf3 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..c40947798 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png new file mode 100644 index 000000000..1abb7264f Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[3].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png new file mode 100644 index 000000000..91c8fc818 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[4].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png new file mode 100644 index 000000000..91c8fc818 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[5].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png new file mode 100644 index 000000000..0c8a92ae9 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[6].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png new file mode 100644 index 000000000..704798793 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[7].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png new file mode 100644 index 000000000..91c8fc818 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeDarkThemeSnapshot[8].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..9e97158ab Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..68a4cdbe2 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..fb69dce53 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png new file mode 100644 index 000000000..0f6ea527b Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[3].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png new file mode 100644 index 000000000..631429c42 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[4].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png new file mode 100644 index 000000000..fb69dce53 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[5].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png new file mode 100644 index 000000000..631429c42 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[6].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png new file mode 100644 index 000000000..4877947ec Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[7].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png new file mode 100644 index 000000000..fb69dce53 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Horizontal_takeLightThemeSnapshot[8].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..cc4aa5e77 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..629e16eca Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..1255f1510 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png new file mode 100644 index 000000000..f7e44c84b Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[3].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png new file mode 100644 index 000000000..3b1b79a69 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[4].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png new file mode 100644 index 000000000..3b1b79a69 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[5].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png new file mode 100644 index 000000000..d75d197e5 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[6].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png new file mode 100644 index 000000000..d798226a7 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[7].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png new file mode 100644 index 000000000..3b1b79a69 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeDarkThemeSnapshot[8].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..a7d7fddef Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..ec8d36f82 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..5a7816a91 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png new file mode 100644 index 000000000..277e1285d Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[3].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png new file mode 100644 index 000000000..1234c0c02 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[4].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png new file mode 100644 index 000000000..5a7816a91 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[5].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png new file mode 100644 index 000000000..1234c0c02 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[6].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png new file mode 100644 index 000000000..64e1abeac Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[7].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png new file mode 100644 index 000000000..5a7816a91 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsDividerTest$Vertical_takeLightThemeSnapshot[8].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png deleted file mode 100644 index 81ce89f23..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[0].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png deleted file mode 100644 index 8d2d4eeaf..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[1].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png deleted file mode 100644 index 4434523d1..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[2].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png deleted file mode 100644 index c26ad63f9..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[3].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png deleted file mode 100644 index 6c2f48aff..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[4].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png deleted file mode 100644 index 6c2f48aff..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[5].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png deleted file mode 100644 index ee7fa486c..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[6].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png deleted file mode 100644 index e3b4c35ab..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[7].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png deleted file mode 100644 index 6c2f48aff..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeDarkThemeSnapshot[8].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png deleted file mode 100644 index 9fae0d244..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[0].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png deleted file mode 100644 index 412a58f27..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[1].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png deleted file mode 100644 index 6bb22e896..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[2].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png deleted file mode 100644 index 36920bb88..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[3].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png deleted file mode 100644 index 0bda66e54..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[4].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png deleted file mode 100644 index 6bb22e896..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[5].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png deleted file mode 100644 index 0bda66e54..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[6].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png deleted file mode 100644 index 1383dd741..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[7].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png deleted file mode 100644 index 6bb22e896..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsHorizontalDividerTest_takeLightThemeSnapshot[8].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png index 7bfa64bce..0e15f908a 100644 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png index 897f300cc..b8770218f 100644 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png index d592ca39d..4732afbc7 100644 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png index cec1fef3b..c7ef5968a 100644 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsNavigationBarTest_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..b6accc2ff Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..6747ac5ca Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..1b38294a5 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..db2a2d6cb Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..31097d95a Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..6dcd50a1e Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$CenterAligned_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..3b0f96ad9 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..8811fcbd6 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..add8e1a1d Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..1b5aa7dc7 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..916609f7e Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..5fc597486 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Default_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..a4b8b5ee5 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..75f705053 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..64cc75de8 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..8fae62b6f Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..aa83edcec Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..7a56344c1 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Large_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png new file mode 100644 index 000000000..de15f537f Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png new file mode 100644 index 000000000..e0e019e78 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png new file mode 100644 index 000000000..d34ea0bb1 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png new file mode 100644 index 000000000..547201911 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png new file mode 100644 index 000000000..2782b49dd Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png new file mode 100644 index 000000000..d32dfba05 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsTopAppBarTest$Medium_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png deleted file mode 100644 index 48b5e55d9..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[0].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png deleted file mode 100644 index 81ec614b6..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[1].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png deleted file mode 100644 index 300439fcf..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[2].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png deleted file mode 100644 index 354def6e5..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[3].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png deleted file mode 100644 index 220fdf15a..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[4].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png deleted file mode 100644 index 220fdf15a..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[5].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png deleted file mode 100644 index d307fc8a3..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[6].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png deleted file mode 100644 index af178b089..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[7].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png deleted file mode 100644 index 220fdf15a..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeDarkThemeSnapshot[8].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png deleted file mode 100644 index b1ce59bdf..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[0].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png deleted file mode 100644 index 29c4b9809..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[1].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png deleted file mode 100644 index 8c3c422f7..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[2].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png deleted file mode 100644 index 9139b3093..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[3].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png deleted file mode 100644 index 75718069e..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[4].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png deleted file mode 100644 index 8c3c422f7..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[5].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png deleted file mode 100644 index 75718069e..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[6].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png deleted file mode 100644 index cbfca654d..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[7].png and /dev/null differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png deleted file mode 100644 index 8c3c422f7..000000000 Binary files a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsVerticalDividerTest_takeLightThemeSnapshot[8].png and /dev/null differ