diff --git a/NOTICE.txt b/NOTICE.txt index 06f07484e9..7a17f13548 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -49,7 +49,8 @@ app/src/main/res/drawable/ic_sosh_tips_and_tricks.xml app/src/main/res/drawable/ic_typography.xml app/src/main/res/drawable/ic_ui_dark_mode.xml app/src/main/res/drawable/ic_ui_light_mode.xml -app/src/main/res/drawable/ic_untinted_icon.png +app/src/main/res/drawable/ic_untinted_square.png +app/src/main/res/drawable/ic_untinted_widescreen.png app/src/main/res/drawable/ic_wireframe_avatar.xml app/src/main/res/drawable/ic_wireframe_call.xml app/src/main/res/drawable/ic_wireframe_filters.xml @@ -122,6 +123,8 @@ theme-orange/src/main/res/drawable/ic_orange_component_button_previous.xml theme-orange/src/main/res/drawable/ic_orange_component_checkbox_selected.xml theme-orange/src/main/res/drawable/ic_orange_component_checkbox_undetermined.xml theme-orange/src/main/res/drawable/ic_orange_component_chip_tick.xml +theme-orange/src/main/res/drawable/ic_orange_component_control_item_next.xml +theme-orange/src/main/res/drawable/ic_orange_component_control_item_previous.xml theme-orange/src/main/res/drawable/ic_orange_component_link_external_link.xml theme-orange/src/main/res/drawable/ic_orange_component_link_next.xml theme-orange/src/main/res/drawable/ic_orange_component_link_previous.xml @@ -129,6 +132,7 @@ theme-orange/src/main/res/drawable/ic_orange_component_radio_button_selected.xml theme-orange/src/main/res/drawable/ic_orange_component_switch_selected.xml theme-orange/src/main/res/drawable/ic_orange_component_tag_close.xml theme-orange/src/main/res/drawable/ic_orange_functional_actions_delete_cross_round.xml +theme-orange/src/main/res/drawable/ic_orange_functional_actions_external_link.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_grid_ui_round.xml theme-orange/src/main/res/drawable/ic_orange_functional_settings_and_tools_accessibility_hide.xml @@ -159,6 +163,8 @@ theme-sosh/src/main/res/drawable/ic_sosh_component_button_previous.xml theme-sosh/src/main/res/drawable/ic_sosh_component_checkbox_selected.xml theme-sosh/src/main/res/drawable/ic_sosh_component_checkbox_undetermined.xml theme-sosh/src/main/res/drawable/ic_sosh_component_chip_tick.xml +theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_next.xml +theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_previous.xml theme-sosh/src/main/res/drawable/ic_sosh_component_link_external_link.xml theme-sosh/src/main/res/drawable/ic_sosh_component_link_next.xml theme-sosh/src/main/res/drawable/ic_sosh_component_link_previous.xml @@ -166,6 +172,7 @@ theme-sosh/src/main/res/drawable/ic_sosh_component_radio_button_selected.xml theme-sosh/src/main/res/drawable/ic_sosh_component_switch_selected.xml theme-sosh/src/main/res/drawable/ic_sosh_component_tag_close.xml theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_delete_cross_round.xml +theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_external_link.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_grid_ui_round.xml theme-sosh/src/main/res/drawable/ic_sosh_functional_settings_and_tools_accessibility_hide.xml @@ -198,6 +205,8 @@ theme-wireframe/src/main/res/drawable/ic_wireframe_component_button_previous.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_checkbox_selected.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_checkbox_undetermined.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_chip_tick.xml +theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_next.xml +theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_previous.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_link_external_link.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_link_next.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_link_previous.xml @@ -205,6 +214,7 @@ theme-wireframe/src/main/res/drawable/ic_wireframe_component_radio_button_select theme-wireframe/src/main/res/drawable/ic_wireframe_component_switch_selected.xml theme-wireframe/src/main/res/drawable/ic_wireframe_component_tag_close.xml theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_delete_cross_round.xml +theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_external_link.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_grid_ui_round.xml theme-wireframe/src/main/res/drawable/ic_wireframe_functional_settings_and_tools_accessibility_hide.xml diff --git a/app/src/main/java/com/orange/ouds/app/ui/ChangeThemeSettingsDialog.kt b/app/src/main/java/com/orange/ouds/app/ui/ChangeThemeSettingsDialog.kt index 68ea660167..280ac1b388 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/ChangeThemeSettingsDialog.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/ChangeThemeSettingsDialog.kt @@ -15,7 +15,6 @@ package com.orange.ouds.app.ui import androidx.annotation.StringRes import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable @@ -23,7 +22,6 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewLightDark @@ -62,6 +60,7 @@ private fun ChangeThemeSettingsDialogContent(themeState: ThemeState, onThemeSett checked = when (themeSetting) { ThemeSetting.RoundedCornerAlertMessages -> themeSettings.roundedCornerAlertMessages.orElse { false } ThemeSetting.RoundedCornerButtons -> themeSettings.roundedCornerButtons.orElse { false } + ThemeSetting.RoundedCornerCardItems -> themeSettings.roundedCornerCardItems.orElse { false } ThemeSetting.RoundedCornerProgressIndicators -> themeSettings.roundedCornerProgressIndicators.orElse { false } ThemeSetting.RoundedCornerTextInputs -> themeSettings.roundedCornerTextInputs.orElse { false } }, @@ -70,6 +69,7 @@ private fun ChangeThemeSettingsDialogContent(themeState: ThemeState, onThemeSett themeSettings = when (themeSetting) { ThemeSetting.RoundedCornerAlertMessages -> themeSettings.copy(roundedCornerAlertMessages = checked) ThemeSetting.RoundedCornerButtons -> themeSettings.copy(roundedCornerButtons = checked) + ThemeSetting.RoundedCornerCardItems -> themeSettings.copy(roundedCornerCardItems = checked) ThemeSetting.RoundedCornerProgressIndicators -> themeSettings.copy(roundedCornerProgressIndicators = checked) ThemeSetting.RoundedCornerTextInputs -> themeSettings.copy(roundedCornerTextInputs = checked) } @@ -104,6 +104,7 @@ private fun getSupportedThemeSettings(theme: OudsThemeContract): List roundedCornerAlertMessages != null ThemeSetting.RoundedCornerButtons -> roundedCornerButtons != null + ThemeSetting.RoundedCornerCardItems -> roundedCornerCardItems != null ThemeSetting.RoundedCornerProgressIndicators -> roundedCornerProgressIndicators != null ThemeSetting.RoundedCornerTextInputs -> roundedCornerTextInputs != null } @@ -120,13 +121,14 @@ object ChangeThemeSettingsDialog { private enum class ThemeSetting { - RoundedCornerAlertMessages, RoundedCornerButtons, RoundedCornerProgressIndicators, RoundedCornerTextInputs; + RoundedCornerAlertMessages, RoundedCornerButtons, RoundedCornerCardItems, RoundedCornerProgressIndicators, RoundedCornerTextInputs; val titleResId: Int @StringRes get() = when (this) { RoundedCornerAlertMessages -> R.string.app_themeSettingsDialog_roundedCornerAlertMessages_label RoundedCornerButtons -> R.string.app_themeSettingsDialog_roundedCornerButtons_label + RoundedCornerCardItems -> R.string.app_themeSettingsDialog_roundedCornerCardItems_label RoundedCornerProgressIndicators -> R.string.app_themeSettingsDialog_roundedCornerProgressIndicators_label RoundedCornerTextInputs -> R.string.app_themeSettingsDialog_roundedCornerTextInputs_label } diff --git a/app/src/main/java/com/orange/ouds/app/ui/MainViewModel.kt b/app/src/main/java/com/orange/ouds/app/ui/MainViewModel.kt index 10488fe48a..83c9562b76 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/MainViewModel.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/MainViewModel.kt @@ -27,6 +27,7 @@ class MainViewModel @Inject constructor(private val dataStoreService: DataStoreS private const val USER_THEME_NAME_KEY = "userThemeName" private const val USER_THEME_SETTINGS_ROUNDED_CORNER_ALERT_MESSAGES_KEY = "userThemeSettingsRoundedCornerAlertMessages" private const val USER_THEME_SETTINGS_ROUNDED_CORNER_BUTTONS_KEY = "userThemeSettingsRoundedCornerButtons" + private const val USER_THEME_SETTINGS_ROUNDED_CORNER_CARD_ITEMS_KEY = "userThemeSettingsRoundedCornerCardItems" private const val USER_THEME_SETTINGS_ROUNDED_CORNER_PROGRESS_INDICATORS_KEY = "userThemeSettingsRoundedCornerProgressIndicators" private const val USER_THEME_SETTINGS_ROUNDED_CORNER_TEXT_INPUTS_KEY = "userThemeSettingsRoundedCornerTextInputs" } @@ -42,6 +43,7 @@ class MainViewModel @Inject constructor(private val dataStoreService: DataStoreS fun storeUserThemeSettings(themeSettings: OudsThemeSettings) = runBlocking { dataStoreService.putBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_ALERT_MESSAGES_KEY, themeSettings.roundedCornerAlertMessages) dataStoreService.putBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_BUTTONS_KEY, themeSettings.roundedCornerButtons) + dataStoreService.putBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_CARD_ITEMS_KEY, themeSettings.roundedCornerCardItems) dataStoreService.putBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_PROGRESS_INDICATORS_KEY, themeSettings.roundedCornerProgressIndicators) dataStoreService.putBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_TEXT_INPUTS_KEY, themeSettings.roundedCornerTextInputs) } @@ -50,6 +52,7 @@ class MainViewModel @Inject constructor(private val dataStoreService: DataStoreS OudsThemeSettings( roundedCornerAlertMessages = dataStoreService.getBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_ALERT_MESSAGES_KEY), roundedCornerButtons = dataStoreService.getBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_BUTTONS_KEY), + roundedCornerCardItems = dataStoreService.getBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_CARD_ITEMS_KEY), roundedCornerProgressIndicators = dataStoreService.getBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_PROGRESS_INDICATORS_KEY), roundedCornerTextInputs = dataStoreService.getBoolean(USER_THEME_SETTINGS_ROUNDED_CORNER_TEXT_INPUTS_KEY) ) diff --git a/app/src/main/java/com/orange/ouds/app/ui/ThemeState.kt b/app/src/main/java/com/orange/ouds/app/ui/ThemeState.kt index 26e1091e27..2b67d4b381 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/ThemeState.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/ThemeState.kt @@ -119,6 +119,7 @@ class ThemeState( orangeFontFamily = OrangeFontFamily(OrangeHelveticaNeueLatin.Downloadable, OrangeHelveticaNeueArabic.Downloadable), roundedCornerAlertMessages = roundedCornerAlertMessages.orElse { false }, roundedCornerButtons = roundedCornerButtons.orElse { false }, + roundedCornerCardItems = roundedCornerCardItems.orElse { false }, roundedCornerProgressIndicators = roundedCornerProgressIndicators.orElse { false }, roundedCornerTextInputs = roundedCornerTextInputs.orElse { false } ) @@ -126,6 +127,7 @@ class ThemeState( orangeFontFamily = OrangeFontFamily(OrangeHelveticaNeueLatin.Downloadable, OrangeHelveticaNeueArabic.Downloadable), roundedCornerAlertMessages = roundedCornerAlertMessages.orElse { false }, roundedCornerButtons = roundedCornerButtons.orElse { false }, + roundedCornerCardItems = roundedCornerCardItems.orElse { false }, roundedCornerProgressIndicators = roundedCornerProgressIndicators.orElse { false }, roundedCornerTextInputs = roundedCornerTextInputs.orElse { false } ) 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 b5da68bc18..a8b4d56769 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 @@ -32,6 +32,9 @@ import com.orange.ouds.app.ui.components.coloredbackground.ColoredBackgroundDemo import com.orange.ouds.app.ui.components.divider.DividerDemoScreen import com.orange.ouds.app.ui.components.floatingactionbutton.FloatingActionButtonDemoScreen import com.orange.ouds.app.ui.components.link.LinkDemoScreen +import com.orange.ouds.app.ui.components.listitem.BaseListItemDemoState +import com.orange.ouds.app.ui.components.listitem.CardItemDemoScreen +import com.orange.ouds.app.ui.components.listitem.ListItemDemoScreen import com.orange.ouds.app.ui.components.navigationbar.NavigationBarDemoScreen import com.orange.ouds.app.ui.components.passwordinput.PasswordInputDemoScreen import com.orange.ouds.app.ui.components.pincodeinput.PinCodeInputDemoScreen @@ -142,6 +145,13 @@ sealed class Component( demoScreen = { LinkDemoScreen() } ) + data object ListItem : Component( + R.string.app_components_listItem_tech, + R.string.app_components_listItem_description_text, + { ListItemIllustration() }, + listOf(Variant.ListItem, Variant.SmallListItem, Variant.CardItem, Variant.SmallCardItem) + ) + data object NavigationBar : Component( R.string.app_components_navigationBar_tech, R.string.app_components_navigationBar_description_text, @@ -251,6 +261,12 @@ sealed class Variant( data object HorizontalDivider : Variant(R.string.app_components_divider_horizontalDivider_tech, { DividerDemoScreen() }) data object VerticalDivider : Variant(R.string.app_components_divider_verticalDivider_tech, { DividerDemoScreen(vertical = true) }) + // List item + data object ListItem : Variant(R.string.app_components_listItem_listItem_tech, { ListItemDemoScreen(size = BaseListItemDemoState.Size.Default) }) + data object SmallListItem : Variant(R.string.app_components_listItem_smallListItem_tech, { ListItemDemoScreen(size = BaseListItemDemoState.Size.Small) }) + data object CardItem : Variant(R.string.app_components_listItem_cardItem_tech, { CardItemDemoScreen(size = BaseListItemDemoState.Size.Default) }) + data object SmallCardItem : Variant(R.string.app_components_listItem_smallCardItem_tech, { CardItemDemoScreen(size = BaseListItemDemoState.Size.Small) }) + // Progress indicator data object CircularProgressIndicator : Variant(R.string.app_components_progressIndicator_circularProgressIndicator_tech, { CircularProgressIndicatorDemoScreen() }) { 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 c0e05c34a8..47fa0d193e 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 @@ -55,7 +55,7 @@ inline fun FunctionCall.Builder.iconArgument( tinted: Boolean = true ) { constructorCallArgument(name) { - painterArgument(if (tinted) resId else R.drawable.ic_untinted_icon) + painterArgument(if (tinted) resId else R.drawable.ic_untinted_square) contentDescriptionResId?.let { contentDescriptionArgument(it) } if (!tinted) tintedArgument(tinted) } 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 bedf5956c4..e3f60b2244 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 @@ -58,6 +58,8 @@ import com.orange.ouds.core.component.OudsFloatingActionButtonIcon import com.orange.ouds.core.component.OudsHorizontalDivider import com.orange.ouds.core.component.OudsLink import com.orange.ouds.core.component.OudsLinkIndicator +import com.orange.ouds.core.component.OudsListItem +import com.orange.ouds.core.component.OudsListItemLeading import com.orange.ouds.core.component.OudsNavigationBar import com.orange.ouds.core.component.OudsNavigationBarItem import com.orange.ouds.core.component.OudsNavigationBarItemIcon @@ -75,6 +77,7 @@ import com.orange.ouds.core.component.OudsTopAppBarAction import com.orange.ouds.core.component.OudsTopAppBarNavigationIcon import com.orange.ouds.core.component.rememberOudsPasswordInputState import com.orange.ouds.core.theme.isOudsInDarkTheme +import com.orange.ouds.foundation.ExperimentalOudsApi @Composable fun AlertIllustration() = ComponentIllustration { @@ -200,6 +203,18 @@ fun LinkIllustration() = ComponentIllustration { ) } +@OptIn(ExperimentalOudsApi::class) +@Composable +fun ListItemIllustration() = ComponentIllustration { + OudsListItem( + modifier = Modifier.padding(horizontal = 12.dp), + label = stringResource(id = R.string.app_components_common_label_label), + description = stringResource(id = R.string.app_components_common_description_tech), + leading = OudsListItemLeading.Icon(painterResource(LocalThemeDrawableResources.current.tipsAndTricks), ""), + edgeToEdge = false + ) +} + @Composable fun NavigationBarIllustration() = ComponentIllustration { val items = List(3) { index -> diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/controlitem/ControlItemDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/controlitem/ControlItemDemoScreen.kt index 52dd722ef9..8ee6567715 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/controlitem/ControlItemDemoScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/controlitem/ControlItemDemoScreen.kt @@ -78,7 +78,7 @@ private fun ControlItemIconCustomization(state: ControlItemDemoState) { private fun ControlItemEdgeToEdgeCustomization(state: ControlItemDemoState) { with(state) { CustomizationSwitchItem( - label = stringResource(id = R.string.app_components_controlItem_edgeToEdge_tech), + label = stringResource(id = R.string.app_components_common_edgeToEdge_tech), checked = edgeToEdge, onCheckedChange = { edgeToEdge = it }, ) @@ -90,7 +90,7 @@ private fun ControlItemEdgeToEdgeCustomization(state: ControlItemDemoState) { private fun ControlItemDividerCustomization(state: ControlItemDemoState) { with(state) { CustomizationSwitchItem( - label = stringResource(id = R.string.app_components_controlItem_divider_tech), + label = stringResource(R.string.app_components_common_divider_tech), checked = divider, onCheckedChange = { divider = it }, ) diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/listitem/BaseListItemDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/BaseListItemDemoScreen.kt new file mode 100644 index 0000000000..0b28498781 --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/BaseListItemDemoScreen.kt @@ -0,0 +1,559 @@ +/* + * 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.listitem + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.pager.HorizontalPager +import androidx.compose.material3.PrimaryScrollableTabRow +import androidx.compose.material3.Tab +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import com.orange.ouds.app.R +import com.orange.ouds.app.ui.components.contentDescriptionArgument +import com.orange.ouds.app.ui.components.enabledArgument +import com.orange.ouds.app.ui.components.labelArgument +import com.orange.ouds.app.ui.components.onClickArgument +import com.orange.ouds.app.ui.components.painterArgument +import com.orange.ouds.app.ui.utilities.FunctionCall +import com.orange.ouds.app.ui.utilities.LocalThemeDrawableResources +import com.orange.ouds.app.ui.utilities.ThemeDrawableResources +import com.orange.ouds.app.ui.utilities.composable.CustomizationFilterChip +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.CustomizationTextInput +import com.orange.ouds.app.ui.utilities.nestedName +import com.orange.ouds.app.ui.utilities.rememberImagePainter +import com.orange.ouds.core.component.OudsListItemDefaults +import com.orange.ouds.core.component.OudsListItemIcon +import com.orange.ouds.core.component.OudsListItemIconSize +import com.orange.ouds.core.component.OudsListItemImage +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemImageSize +import com.orange.ouds.core.component.OudsListItemLeading +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsListItemTrailing +import com.orange.ouds.core.component.OudsListItemVerticalAlignment +import com.orange.ouds.foundation.extensions.toSentenceCase +import kotlinx.coroutines.launch + + +@Composable +fun BaseListItemDemoBottomSheetTabs(state: BaseListItemDemoState) { + with(state) { + val scope = rememberCoroutineScope() + + //TODO Replace by OudsTabRow when available + PrimaryScrollableTabRow( + selectedTabIndex = pagerState.currentPage, + tabs = { + tabs.mapIndexed { index, customizationTab -> + Tab( + selected = pagerState.currentPage == index, + text = { Text(text = customizationTab.name.toSentenceCase()) }, + onClick = { + scope.launch { + pagerState.animateScrollToPage(index) + state.selectedTabIndex = index + } + } + ) + } + }, + containerColor = Color.Transparent + ) + } +} + +@Composable +fun BaseListItemDemoBottomSheetContent(state: BaseListItemDemoState) { + with(state) { + HorizontalPager(state = pagerState, userScrollEnabled = false) { page -> + Column { + tabs[page].Content(state) + } + } + } +} + +@Composable +fun BaseListItemDemoState.CustomizationTab.Content(state: BaseListItemDemoState) { + when (this) { + BaseListItemDemoState.CustomizationTab.General -> when (state) { + is CardItemDemoState -> CardItemGeneralCustomizationContent(state = state) + is ListItemDemoState -> ListItemGeneralCustomizationContent(state = state) + } + BaseListItemDemoState.CustomizationTab.Leading -> BaseListItemLeadingCustomizationContent(state = state) + BaseListItemDemoState.CustomizationTab.Texts -> BaseListItemTextsCustomizationContent(state = state) + BaseListItemDemoState.CustomizationTab.Trailing -> BaseListItemTrailingCustomizationContent(state = state) + } +} + +data class BaseListItemGeneralCustomization(val index: Int, val content: @Composable () -> Unit) + +fun baseListItemGeneralCustomization(index: Int, content: @Composable () -> Unit) = BaseListItemGeneralCustomization(index, content) + +@Composable +fun BaseListItemGeneralCustomizations(state: BaseListItemDemoState, extraCustomizations: List = listOf()) { + val customizations: MutableList<@Composable () -> Unit> = mutableListOf( + { BaseListItemClickableCustomization(state = state) }, + { BaseListItemIndicatorCustomization(state = state) }, + { BaseListItemVerticalAlignmentCustomization(state = state) }, + { BaseListItemEnabledCustomization(state = state) }, + ) + extraCustomizations.forEach { (index, content) -> + customizations.add(minOf(index, customizations.count()), content) + } + customizations.forEach { it() } +} + +@Composable +private fun BaseListItemClickableCustomization(state: BaseListItemDemoState) { + with(state) { + CustomizationSwitchItem( + label = stringResource(R.string.app_components_listItem_clickable_tech), + checked = clickable, + onCheckedChange = { clickable = it }, + ) + } +} + +@Composable +private fun BaseListItemIndicatorCustomization(state: BaseListItemDemoState) { + with(state) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_indicator_tech), + chips = BaseListItemDemoState.Indicator.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = indicatorEnabled) }, + selectedChipIndex = BaseListItemDemoState.Indicator.entries.indexOf(indicator), + onSelectionChange = { index -> indicator = BaseListItemDemoState.Indicator.entries[index] } + ) + } +} + +@Composable +private fun BaseListItemVerticalAlignmentCustomization(state: BaseListItemDemoState) { + with(state) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_verticalAlignment_tech), + chipLabels = OudsListItemVerticalAlignment.entries.map { it.name.toSentenceCase() }, + selectedChipIndex = OudsListItemVerticalAlignment.entries.indexOf(verticalAlignment), + onSelectionChange = { index -> verticalAlignment = OudsListItemVerticalAlignment.entries[index] } + ) + } +} + +@Composable +private fun BaseListItemEnabledCustomization(state: BaseListItemDemoState) { + with(state) { + CustomizationSwitchItem( + label = stringResource(R.string.app_common_enabled_tech), + checked = enabled, + onCheckedChange = { enabled = it }, + ) + } +} + +@Composable +fun BaseListItemLeadingCustomizationContent(state: BaseListItemDemoState) { + with(state) { + CustomizationFilterChips( + applyTopPadding = true, + label = null, + chipLabels = BaseListItemDemoState.Leading.entries.map { it.name.toSentenceCase() }, + selectedChipIndex = BaseListItemDemoState.Leading.entries.indexOf(leading), + onSelectionChange = { index -> leading = BaseListItemDemoState.Leading.entries[index] } + ) + if (size == BaseListItemDemoState.Size.Default) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_iconSize_tech), + chips = OudsListItemIconSize.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = leadingIconOptionsEnabled) }, + selectedChipIndex = OudsListItemIconSize.entries.indexOf(leadingIconSize), + onSelectionChange = { index -> leadingIconSize = OudsListItemIconSize.entries[index] } + ) + } + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_statusIcon_tech), + chips = BaseListItemDemoState.StatusIcon.entries.map { + CustomizationFilterChip( + label = it.name.toSentenceCase(), + enabled = leadingIconOptionsEnabled + ) + }, + selectedChipIndex = BaseListItemDemoState.StatusIcon.entries.indexOf(leadingStatusIcon), + onSelectionChange = { index -> leadingStatusIcon = BaseListItemDemoState.StatusIcon.entries[index] } + ) + if (size == BaseListItemDemoState.Size.Default) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_imageSize_tech), + chips = OudsListItemImageSize.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = leadingImageOptionsEnabled) }, + selectedChipIndex = OudsListItemImageSize.entries.indexOf(leadingImageSize), + onSelectionChange = { index -> leadingImageSize = OudsListItemImageSize.entries[index] } + ) + } + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_imageRatio_tech), + chips = OudsListItemImageRatio.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = leadingImageOptionsEnabled) }, + selectedChipIndex = OudsListItemImageRatio.entries.indexOf(leadingImageRatio), + onSelectionChange = { index -> leadingImageRatio = OudsListItemImageRatio.entries[index] } + ) + CustomizationSwitchItem( + label = stringResource(R.string.app_components_listItem_roundedCornerImage_tech), + checked = leadingImageRoundedCorners, + onCheckedChange = { leadingImageRoundedCorners = it }, + enabled = leadingImageOptionsEnabled + ) + } +} + +@Composable +fun BaseListItemTextsCustomizationContent(state: BaseListItemDemoState) { + with(state) { + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_common_label_tech), + value = label, + onValueChange = { value -> label = value } + ) + CustomizationSwitchItem( + label = stringResource(R.string.app_components_listItem_boldLabel_tech), + checked = boldLabel, + onCheckedChange = { boldLabel = it }, + ) + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_common_description_tech), + value = description.orEmpty(), + onValueChange = { value -> description = value } + ) + if (size == BaseListItemDemoState.Size.Default) { + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_overline_tech), + value = overline.orEmpty(), + onValueChange = { value -> overline = value } + ) + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_common_extraLabel_tech), + value = extraLabel.orEmpty(), + onValueChange = { value -> extraLabel = value } + ) + } + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_common_helperText_tech), + value = helperText.orEmpty(), + onValueChange = { value -> helperText = value } + ) + } +} + +@Composable +fun BaseListItemTrailingCustomizationContent(state: BaseListItemDemoState) { + with(state) { + CustomizationFilterChips( + applyTopPadding = true, + label = null, + chipLabels = BaseListItemDemoState.Trailing.entries.map { it.name.toSentenceCase() }, + selectedChipIndex = BaseListItemDemoState.Trailing.entries.indexOf(trailing), + onSelectionChange = { index -> trailing = BaseListItemDemoState.Trailing.entries[index] } + ) + if (size == BaseListItemDemoState.Size.Default) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_iconSize_tech), + chips = OudsListItemIconSize.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = trailingIconOptionsEnabled) }, + selectedChipIndex = OudsListItemIconSize.entries.indexOf(trailingIconSize), + onSelectionChange = { index -> trailingIconSize = OudsListItemIconSize.entries[index] } + ) + } + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_statusIcon_tech), + chips = BaseListItemDemoState.StatusIcon.entries.map { + CustomizationFilterChip( + label = it.name.toSentenceCase(), + enabled = trailingIconOptionsEnabled + ) + }, + selectedChipIndex = BaseListItemDemoState.StatusIcon.entries.indexOf(trailingStatusIcon), + onSelectionChange = { index -> trailingStatusIcon = BaseListItemDemoState.StatusIcon.entries[index] } + ) + if (size == BaseListItemDemoState.Size.Default) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_imageSize_tech), + chips = OudsListItemImageSize.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = trailingImageOptionsEnabled) }, + selectedChipIndex = OudsListItemImageSize.entries.indexOf(trailingImageSize), + onSelectionChange = { index -> trailingImageSize = OudsListItemImageSize.entries[index] } + ) + } + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_imageRatio_tech), + chips = OudsListItemImageRatio.entries.map { CustomizationFilterChip(label = it.name.toSentenceCase(), enabled = trailingImageOptionsEnabled) }, + selectedChipIndex = OudsListItemImageRatio.entries.indexOf(trailingImageRatio), + onSelectionChange = { index -> trailingImageRatio = OudsListItemImageRatio.entries[index] } + ) + CustomizationSwitchItem( + label = stringResource(R.string.app_components_listItem_roundedCornerImage_tech), + checked = trailingImageRoundedCorners, + onCheckedChange = { trailingImageRoundedCorners = it }, + enabled = trailingImageOptionsEnabled + ) + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_trailingTextLabel_tech), + value = trailingTextLabel, + onValueChange = { value -> trailingTextLabel = value }, + enabled = trailingTextOptionsEnabled + ) + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_trailingTextStyle_tech), + chips = OudsListItemTextStyle.entries.map { + CustomizationFilterChip( + it.name.toSentenceCase(), + trailingTextOptionsEnabled && (it == OudsListItemTextStyle.Label || trailingTextExtraLabel.isNullOrBlank()) + ) + }, + selectedChipIndex = OudsListItemTextStyle.entries.indexOf(trailingTextStyle), + onSelectionChange = { index -> trailingTextStyle = OudsListItemTextStyle.entries[index] }, + ) + if (size == BaseListItemDemoState.Size.Default) { + CustomizationTextInput( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_trailingTextExtraLabel_tech), + value = trailingTextExtraLabel.orEmpty(), + onValueChange = { value -> + trailingTextExtraLabel = value + if (value.isNotBlank()) { + trailingTextStyle = OudsListItemTextStyle.Label + } + }, + enabled = trailingTextOptionsEnabled + ) + } + } +} + +private val iconPainter + @Composable + get() = painterResource(id = LocalThemeDrawableResources.current.tipsAndTricks) + +private val imagePainter + @Composable + get() = rememberImagePainter() + +@Composable +fun baseListItemDemoLeading(state: BaseListItemDemoState): OudsListItemLeading? = with(state) { + when (leading) { + BaseListItemDemoState.Leading.None -> null + BaseListItemDemoState.Leading.Icon -> { + when (leadingStatusIcon) { + BaseListItemDemoState.StatusIcon.None -> OudsListItemLeading.Icon( + painter = iconPainter, + contentDescription = stringResource(R.string.app_components_listItem_icon_a11y), + size = leadingIconSize + ) + BaseListItemDemoState.StatusIcon.Info -> OudsListItemLeading.Icon.Info(size = leadingIconSize) + BaseListItemDemoState.StatusIcon.Negative -> OudsListItemLeading.Icon.Negative(size = leadingIconSize) + BaseListItemDemoState.StatusIcon.Positive -> OudsListItemLeading.Icon.Positive(size = leadingIconSize) + BaseListItemDemoState.StatusIcon.Warning -> OudsListItemLeading.Icon.Warning(size = leadingIconSize) + } + } + BaseListItemDemoState.Leading.Image -> OudsListItemLeading.Image( + painter = imagePainter, + contentDescription = stringResource(R.string.app_components_listItem_image_a11y), + size = leadingImageSize, + ratio = leadingImageRatio, + roundedCorner = leadingImageRoundedCorners, + contentScale = ContentScale.Crop + ) + } +} + +@Composable +fun baseListItemDemoTrailing(state: BaseListItemDemoState): OudsListItemTrailing? = with(state) { + when (trailing) { + BaseListItemDemoState.Trailing.None -> null + BaseListItemDemoState.Trailing.Icon -> { + when (trailingStatusIcon) { + BaseListItemDemoState.StatusIcon.None -> OudsListItemTrailing.Icon( + painter = iconPainter, + contentDescription = stringResource(R.string.app_components_listItem_icon_a11y), + size = trailingIconSize + ) + BaseListItemDemoState.StatusIcon.Info -> OudsListItemTrailing.Icon.Info(size = trailingIconSize) + BaseListItemDemoState.StatusIcon.Negative -> OudsListItemTrailing.Icon.Negative(size = trailingIconSize) + BaseListItemDemoState.StatusIcon.Positive -> OudsListItemTrailing.Icon.Positive(size = trailingIconSize) + BaseListItemDemoState.StatusIcon.Warning -> OudsListItemTrailing.Icon.Warning(size = trailingIconSize) + } + } + BaseListItemDemoState.Trailing.Image -> OudsListItemTrailing.Image( + painter = imagePainter, + contentDescription = stringResource(R.string.app_components_listItem_image_a11y), + size = trailingImageSize, + ratio = trailingImageRatio, + roundedCorner = trailingImageRoundedCorners, + contentScale = ContentScale.Crop + ) + BaseListItemDemoState.Trailing.Text -> { + if (trailingTextStyle == OudsListItemTextStyle.Label && !trailingTextExtraLabel.isNullOrBlank()) { + OudsListItemTrailing.Text( + label = trailingTextLabel, + extraLabel = trailingTextExtraLabel.orEmpty() + ) + } else { + OudsListItemTrailing.Text( + label = trailingTextLabel, + style = trailingTextStyle + ) + } + } + } +} + +fun FunctionCall.Builder.baseListItemArguments(state: BaseListItemDemoState, themeDrawableResources: ThemeDrawableResources) { + with(state) { + if (clickable) { + onClickArgument { + comment("Do something") + } + if (indicator != BaseListItemDemoState.Indicator.Next) { + typedArgument("indicator", indicator.toOudsListItemIndicator()) + } + } + + labelArgument(label) + + if (verticalAlignment != OudsListItemDefaults.VerticalAlignment) { + typedArgument("verticalAlignment", verticalAlignment) + } + + if (!overline.isNullOrBlank()) typedArgument("overline", overline) + if (!extraLabel.isNullOrBlank()) typedArgument("extraLabel", extraLabel) + if (!description.isNullOrBlank()) typedArgument("description", description) + + val leadingParameterName = "leading" + val trailingParameterName = "trailing" + when (leading) { + BaseListItemDemoState.Leading.Icon -> addIconCodeSnippet( + argumentName = leadingParameterName, + statusIcon = leadingStatusIcon, + iconSize = leadingIconSize, + themeDrawableResources = themeDrawableResources + ) + BaseListItemDemoState.Leading.Image -> addImageCodeSnippet( + argumentName = leadingParameterName, + imageSize = leadingImageSize, + imageRatio = leadingImageRatio, + roundedCorners = leadingImageRoundedCorners + ) + BaseListItemDemoState.Leading.None -> {} + } + + when (trailing) { + BaseListItemDemoState.Trailing.Icon -> addIconCodeSnippet( + argumentName = trailingParameterName, + statusIcon = trailingStatusIcon, + iconSize = trailingIconSize, + themeDrawableResources = themeDrawableResources + ) + BaseListItemDemoState.Trailing.Image -> addImageCodeSnippet( + argumentName = trailingParameterName, + imageSize = trailingImageSize, + imageRatio = trailingImageRatio, + roundedCorners = trailingImageRoundedCorners + ) + BaseListItemDemoState.Trailing.Text -> { + constructorCallArgument(trailingParameterName) { + labelArgument(trailingTextLabel) + if (trailingTextStyle == OudsListItemTextStyle.Label && !trailingTextExtraLabel.isNullOrBlank()) { + typedArgument("extraLabel", trailingTextExtraLabel) + } else if (trailingTextStyle != OudsListItemTextStyle.Label) { + typedArgument("style", trailingTextStyle) + } + } + } + BaseListItemDemoState.Trailing.None -> {} + } + + if (!helperText.isNullOrBlank()) typedArgument("helperText", helperText) + if (boldLabel) typedArgument("boldLabel", boldLabel) + if (!enabled) enabledArgument(enabled) + } +} + +private inline fun FunctionCall.Builder.addIconCodeSnippet( + argumentName: String, + statusIcon: BaseListItemDemoState.StatusIcon, + iconSize: OudsListItemIconSize, + themeDrawableResources: ThemeDrawableResources +) { + val sizeParameterName = "size" + when (statusIcon) { + BaseListItemDemoState.StatusIcon.Info, + BaseListItemDemoState.StatusIcon.Negative, + BaseListItemDemoState.StatusIcon.Positive, + BaseListItemDemoState.StatusIcon.Warning -> { + val functionName = "${IconType::class.java.nestedName}.${statusIcon.name}" + functionCallArgument(argumentName, functionName) { + if (iconSize != OudsListItemDefaults.IconSize) { + typedArgument(sizeParameterName, iconSize) + } + } + } + BaseListItemDemoState.StatusIcon.None -> { + constructorCallArgument(argumentName) { + painterArgument(themeDrawableResources.tipsAndTricks) + contentDescriptionArgument(R.string.app_components_listItem_icon_a11y) + if (iconSize != OudsListItemDefaults.IconSize) { + typedArgument(sizeParameterName, iconSize) + } + } + } + } +} + +private inline fun FunctionCall.Builder.addImageCodeSnippet( + argumentName: String, + imageSize: OudsListItemImageSize, + imageRatio: OudsListItemImageRatio, + roundedCorners: Boolean +) { + constructorCallArgument(argumentName) { + painterArgument(R.drawable.ic_untinted_widescreen) + contentDescriptionArgument(R.string.app_components_listItem_image_a11y) + if (imageSize != OudsListItemDefaults.ImageSize) { + typedArgument("size", imageSize) + } + if (imageRatio != OudsListItemDefaults.ImageRatio) { + typedArgument("ratio", imageRatio) + } + if (roundedCorners) { + typedArgument("roundedCorner", true) + } + rawArgument("contentScale", "ContentScale.Crop") + } +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/listitem/BaseListItemDemoState.kt b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/BaseListItemDemoState.kt new file mode 100644 index 0000000000..63fc2c6a07 --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/BaseListItemDemoState.kt @@ -0,0 +1,224 @@ +/* + * 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.listitem + +import androidx.compose.foundation.pager.PagerState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.listSaver +import androidx.compose.runtime.setValue +import com.orange.ouds.core.component.OudsListItemIconSize +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemImageSize +import com.orange.ouds.core.component.OudsListItemIndicator +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsListItemVerticalAlignment + + +open class BaseListItemDemoState( + size: Size, + selectedTabIndex: Int, + label: String, + clickable: Boolean, + indicator: Indicator, + verticalAlignment: OudsListItemVerticalAlignment, + overline: String?, + extraLabel: String?, + description: String?, + leading: Leading, + leadingIconSize: OudsListItemIconSize, + leadingStatusIcon: StatusIcon, + leadingImageSize: OudsListItemImageSize, + leadingImageRatio: OudsListItemImageRatio, + leadingImageRoundedCorners: Boolean, + trailing: Trailing, + trailingIconSize: OudsListItemIconSize, + trailingStatusIcon: StatusIcon, + trailingImageSize: OudsListItemImageSize, + trailingImageRatio: OudsListItemImageRatio, + trailingImageRoundedCorners: Boolean, + trailingTextLabel: String, + trailingTextExtraLabel: String?, + trailingTextStyle: OudsListItemTextStyle, + divider: Boolean, + helperText: String?, + boldLabel: Boolean, + enabled: Boolean, +) { + + companion object { + + val Saver = listSaver( + save = { state -> + with(state) { + listOf( + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled + ) + } + }, + restore = { list: List -> + BaseListItemDemoState( + list[0] as Size, + list[1] as Int, + list[2] as String, + list[3] as Boolean, + list[4] as Indicator, + list[5] as OudsListItemVerticalAlignment, + list[6] as String?, + list[7] as String?, + list[8] as String?, + list[9] as Leading, + list[10] as OudsListItemIconSize, + list[11] as StatusIcon, + list[12] as OudsListItemImageSize, + list[13] as OudsListItemImageRatio, + list[14] as Boolean, + list[15] as Trailing, + list[16] as OudsListItemIconSize, + list[17] as StatusIcon, + list[18] as OudsListItemImageSize, + list[19] as OudsListItemImageRatio, + list[20] as Boolean, + list[21] as String, + list[22] as String?, + list[23] as OudsListItemTextStyle, + list[24] as Boolean, + list[25] as String?, + list[26] as Boolean, + list[27] as Boolean, + ) + } + ) + } + + val size: Size by mutableStateOf(size) + + lateinit var pagerState: PagerState + var selectedTabIndex: Int by mutableIntStateOf(selectedTabIndex) + val tabs = CustomizationTab.entries + + var boldLabel: Boolean by mutableStateOf(boldLabel) + + var clickable: Boolean by mutableStateOf(clickable) + + var description: String? by mutableStateOf(description) + + var divider: Boolean by mutableStateOf(divider) + + var enabled: Boolean by mutableStateOf(enabled) + + var extraLabel: String? by mutableStateOf(extraLabel) + + var helperText: String? by mutableStateOf(helperText) + + var indicator: Indicator by mutableStateOf(indicator) + val indicatorEnabled: Boolean + get() = clickable + + var label: String by mutableStateOf(label) + + var leading: Leading by mutableStateOf(leading) + + var leadingIconSize: OudsListItemIconSize by mutableStateOf(leadingIconSize) + var leadingStatusIcon: StatusIcon by mutableStateOf(leadingStatusIcon) + val leadingIconOptionsEnabled: Boolean + get() = leading == Leading.Icon + + var leadingImageSize: OudsListItemImageSize by mutableStateOf(leadingImageSize) + var leadingImageRatio: OudsListItemImageRatio by mutableStateOf(leadingImageRatio) + var leadingImageRoundedCorners: Boolean by mutableStateOf(leadingImageRoundedCorners) + val leadingImageOptionsEnabled: Boolean + get() = leading == Leading.Image + + var overline: String? by mutableStateOf(overline) + + var trailing: Trailing by mutableStateOf(trailing) + + var trailingIconSize: OudsListItemIconSize by mutableStateOf(trailingIconSize) + var trailingStatusIcon: StatusIcon by mutableStateOf(trailingStatusIcon) + val trailingIconOptionsEnabled: Boolean + get() = trailing == Trailing.Icon + + var trailingImageSize: OudsListItemImageSize by mutableStateOf(trailingImageSize) + var trailingImageRatio: OudsListItemImageRatio by mutableStateOf(trailingImageRatio) + var trailingImageRoundedCorners: Boolean by mutableStateOf(trailingImageRoundedCorners) + val trailingImageOptionsEnabled: Boolean + get() = trailing == Trailing.Image + + var trailingTextLabel: String by mutableStateOf(trailingTextLabel) + var trailingTextExtraLabel: String? by mutableStateOf(trailingTextExtraLabel) + var trailingTextStyle: OudsListItemTextStyle by mutableStateOf(trailingTextStyle) + val trailingTextOptionsEnabled: Boolean + get() = trailing == Trailing.Text + + var verticalAlignment: OudsListItemVerticalAlignment by mutableStateOf(verticalAlignment) + + enum class CustomizationTab { + General, Leading, Texts, Trailing + } + + enum class Size { + Default, Small + } + + enum class Indicator { + Next, Previous, External; + + fun toOudsListItemIndicator() = when (this) { + External -> OudsListItemIndicator.External + Previous -> OudsListItemIndicator.Previous + else -> OudsListItemIndicator.Next + } + } + + enum class Leading { + None, Icon, Image + } + + enum class Trailing { + None, Icon, Image, Text + } + + enum class StatusIcon { + None, Info, Negative, Positive, Warning + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/listitem/CardItemDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/CardItemDemoScreen.kt new file mode 100644 index 0000000000..f4f34c319b --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/CardItemDemoScreen.kt @@ -0,0 +1,141 @@ +/* + * 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.listitem + +import androidx.compose.runtime.Composable +import androidx.compose.ui.res.stringResource +import com.orange.ouds.app.R +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.CustomizationFilterChip +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.DemoScreen +import com.orange.ouds.app.ui.utilities.nestedName +import com.orange.ouds.core.component.OudsCardItem +import com.orange.ouds.core.component.OudsListItemDecoration +import com.orange.ouds.foundation.ExperimentalOudsApi +import com.orange.ouds.foundation.extensions.toSentenceCase +import com.orange.ouds.theme.OudsVersion + +@Composable +fun CardItemDemoScreen(size: BaseListItemDemoState.Size) { + val state = rememberCardItemDemoState(size = size) + val themeDrawableResources = LocalThemeDrawableResources.current + DemoScreen( + bottomSheetTabs = { BaseListItemDemoBottomSheetTabs(state = state) }, + bottomSheetContent = { BaseListItemDemoBottomSheetContent(state = state) }, + codeSnippet = { cardItemDemoCodeSnippet(state = state, themeDrawableResources = themeDrawableResources) }, + demoContent = { CardItemDemoContent(state = state) }, + version = OudsVersion.Component.NavigationCardItem + ) +} + +@Composable +internal fun CardItemGeneralCustomizationContent(state: CardItemDemoState) { + with(state) { + val extraCustomizations = listOf( + baseListItemGeneralCustomization(3) { + CustomizationFilterChips( + applyTopPadding = true, + label = stringResource(R.string.app_components_listItem_cardItem_decoration_tech), + chips = CardItemDemoState.Decoration.entries.map { + CustomizationFilterChip( + label = it.name.toSentenceCase() + ) + }, + selectedChipIndex = CardItemDemoState.Decoration.entries.indexOf(decoration), + onSelectionChange = { index -> decoration = CardItemDemoState.Decoration.entries[index] } + ) + }, + baseListItemGeneralCustomization(4) { + CustomizationSwitchItem( + label = stringResource(R.string.app_components_common_divider_tech), + checked = divider, + onCheckedChange = { divider = it }, + enabled = dividerEnabled + ) + } + ) + BaseListItemGeneralCustomizations(state = state, extraCustomizations = extraCustomizations) + } +} + +@OptIn(ExperimentalOudsApi::class) +@Composable +private fun CardItemDemoContent(state: CardItemDemoState) { + with(state) { + if (clickable) { + OudsCardItem( + onClick = {}, + indicator = indicator.toOudsListItemIndicator(), + label = label, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = baseListItemDemoLeading(state = state), + trailing = baseListItemDemoTrailing(state = state), + decoration = decoration.toOudsListItemDecoration(divider = divider), + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + ) + } else { + OudsCardItem( + label = label, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = baseListItemDemoLeading(state = state), + trailing = baseListItemDemoTrailing(state = state), + decoration = decoration.toOudsListItemDecoration(divider = divider), + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + ) + } + } +} + +private fun Code.Builder.cardItemDemoCodeSnippet(state: CardItemDemoState, themeDrawableResources: ThemeDrawableResources) { + with(state) { + val functionName = when (size) { + BaseListItemDemoState.Size.Default -> "OudsCardItem" + BaseListItemDemoState.Size.Small -> "OudsSmallCardItem" + } + functionCall(functionName) { + val decorationParameterName = "decoration" + when (decoration) { + CardItemDemoState.Decoration.Background -> if (!divider) { + constructorCallArgument(decorationParameterName) { + typedArgument("divider", divider) + } + } + CardItemDemoState.Decoration.BackgroundOnInteraction -> + constructorCallArgument(decorationParameterName) { + typedArgument("divider", divider) + } + CardItemDemoState.Decoration.Outlined -> rawArgument(decorationParameterName, OudsListItemDecoration.Outlined::class.java.nestedName) + CardItemDemoState.Decoration.OutlinedOnInteraction -> rawArgument( + decorationParameterName, + OudsListItemDecoration.OutlinedOnInteraction::class.java.nestedName + ) + } + + baseListItemArguments(state, themeDrawableResources) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/listitem/CardItemDemoState.kt b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/CardItemDemoState.kt new file mode 100644 index 0000000000..e013d12b93 --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/CardItemDemoState.kt @@ -0,0 +1,262 @@ +/* + * 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.listitem + +import androidx.compose.foundation.pager.rememberPagerState +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 androidx.compose.ui.res.stringResource +import com.orange.ouds.app.R +import com.orange.ouds.core.component.OudsListItemDecoration +import com.orange.ouds.core.component.OudsListItemDefaults +import com.orange.ouds.core.component.OudsListItemIconSize +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemImageSize +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsListItemVerticalAlignment + +@Composable +fun rememberCardItemDemoState( + size: BaseListItemDemoState.Size, + decoration: CardItemDemoState.Decoration = CardItemDemoState.Decoration.Background, + selectedTabIndex: Int = 0, + label: String = stringResource(id = R.string.app_components_common_label_label), + clickable: Boolean = false, + indicator: BaseListItemDemoState.Indicator = BaseListItemDemoState.Indicator.Next, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + overline: String? = null, + extraLabel: String? = null, + description: String? = null, + leading: BaseListItemDemoState.Leading = BaseListItemDemoState.Leading.None, + leadingIconSize: OudsListItemIconSize = OudsListItemDefaults.IconSize, + leadingStatusIcon: BaseListItemDemoState.StatusIcon = BaseListItemDemoState.StatusIcon.None, + leadingImageSize: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + leadingImageRatio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + leadingImageRoundedCorners: Boolean = false, + trailing: BaseListItemDemoState.Trailing = BaseListItemDemoState.Trailing.None, + trailingIconSize: OudsListItemIconSize = OudsListItemDefaults.IconSize, + trailingStatusIcon: BaseListItemDemoState.StatusIcon = BaseListItemDemoState.StatusIcon.None, + trailingImageSize: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + trailingImageRatio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + trailingImageRoundedCorners: Boolean = false, + trailingTextLabel: String = stringResource(id = R.string.app_components_common_label_label), + trailingTextExtraLabel: String? = null, + trailingTextStyle: OudsListItemTextStyle = OudsListItemTextStyle.Label, + divider: Boolean = true, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true +): CardItemDemoState { + val state = rememberSaveable( + decoration, + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled, + saver = CardItemDemoState.Saver + ) { + CardItemDemoState( + decoration, + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled, + ) + } + + val pagerState = rememberPagerState(initialPage = selectedTabIndex) { + BaseListItemDemoState.CustomizationTab.entries.size + } + state.pagerState = pagerState + return state +} + +class CardItemDemoState( + decoration: Decoration, + size: Size, + selectedTabIndex: Int, + label: String, + clickable: Boolean, + indicator: Indicator, + verticalAlignment: OudsListItemVerticalAlignment, + overline: String?, + extraLabel: String?, + description: String?, + leading: Leading, + leadingIconSize: OudsListItemIconSize, + leadingStatusIcon: StatusIcon, + leadingImageSize: OudsListItemImageSize, + leadingImageRatio: OudsListItemImageRatio, + leadingImageRoundedCorners: Boolean, + trailing: Trailing, + trailingIconSize: OudsListItemIconSize, + trailingStatusIcon: StatusIcon, + trailingImageSize: OudsListItemImageSize, + trailingImageRatio: OudsListItemImageRatio, + trailingImageRoundedCorners: Boolean, + trailingTextLabel: String, + trailingTextExtraLabel: String?, + trailingTextStyle: OudsListItemTextStyle, + divider: Boolean, + helperText: String?, + boldLabel: Boolean, + enabled: Boolean, +) : BaseListItemDemoState( + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled +) { + companion object { + + val Saver = listSaver( + save = { state -> + with(state) { + listOf( + decoration, + with(BaseListItemDemoState.Saver) { save(state) }, + ) + } + }, + restore = { list: List -> + val baseListItemDemoState = list[1]?.let { BaseListItemDemoState.Saver.restore(it) } + baseListItemDemoState?.run { + CardItemDemoState( + list[0] as Decoration, + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled + ) + } + } + ) + } + + var decoration: Decoration by mutableStateOf(decoration) + + val dividerEnabled: Boolean + get() = decoration in listOf(Decoration.Background, Decoration.BackgroundOnInteraction) + + enum class Decoration { + Background, BackgroundOnInteraction, Outlined, OutlinedOnInteraction; + + fun toOudsListItemDecoration(divider: Boolean = true) = + when (this) { + Background -> OudsListItemDecoration.Background(divider = divider) + Outlined -> OudsListItemDecoration.Outlined + BackgroundOnInteraction -> OudsListItemDecoration.BackgroundOnInteraction(divider = divider) + OutlinedOnInteraction -> OudsListItemDecoration.OutlinedOnInteraction + } + } +} diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/listitem/ListItemDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/ListItemDemoScreen.kt new file mode 100644 index 0000000000..2d2dd51f67 --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/ListItemDemoScreen.kt @@ -0,0 +1,134 @@ +/* + * 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.listitem + +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import com.orange.ouds.app.R +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.CustomizationSwitchItem +import com.orange.ouds.app.ui.utilities.composable.DemoScreen +import com.orange.ouds.core.component.OudsListItem +import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.foundation.ExperimentalOudsApi +import com.orange.ouds.theme.OudsVersion + +@Composable +fun ListItemDemoScreen(size: BaseListItemDemoState.Size) { + val state = rememberListItemDemoState(size = size) + val themeDrawableResources = LocalThemeDrawableResources.current + DemoScreen( + bottomSheetTabs = { BaseListItemDemoBottomSheetTabs(state = state) }, + bottomSheetContent = { BaseListItemDemoBottomSheetContent(state = state) }, + codeSnippet = { listItemDemoCodeSnippet(state = state, themeDrawableResources = themeDrawableResources) }, + demoContent = { ListItemDemoContent(state = state) }, + demoContentPaddingValues = PaddingValues(horizontal = OudsTheme.spaces.fixed.none), + version = OudsVersion.Component.NavigationListItem + ) +} + +@Composable +internal fun ListItemGeneralCustomizationContent(state: ListItemDemoState) { + with(state) { + val extraCustomizations = listOf( + baseListItemGeneralCustomization(3) { + CustomizationSwitchItem( + label = stringResource(R.string.app_components_common_divider_tech), + checked = divider, + onCheckedChange = { divider = it }, + ) + }, + baseListItemGeneralCustomization(4) { + CustomizationSwitchItem( + label = stringResource(R.string.app_components_listItem_background_tech), + checked = background, + onCheckedChange = { background = it }, + ) + }, + baseListItemGeneralCustomization(6) { + CustomizationSwitchItem( + label = stringResource(R.string.app_components_common_edgeToEdge_tech), + checked = edgeToEdge, + onCheckedChange = { edgeToEdge = it }, + ) + } + ) + BaseListItemGeneralCustomizations(state = state, extraCustomizations = extraCustomizations) + } +} + +@OptIn(ExperimentalOudsApi::class) +@Composable +private fun ListItemDemoContent(state: ListItemDemoState) { + with(state) { + val modifier = if (edgeToEdge) Modifier else Modifier.padding(horizontal = OudsTheme.grids.margin) + if (clickable) { + OudsListItem( + modifier = modifier, + onClick = {}, + indicator = indicator.toOudsListItemIndicator(), + label = label, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = baseListItemDemoLeading(state = state), + trailing = baseListItemDemoTrailing(state = state), + divider = divider, + background = background, + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = edgeToEdge + ) + } else { + OudsListItem( + modifier = modifier, + label = label, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = baseListItemDemoLeading(state = state), + trailing = baseListItemDemoTrailing(state = state), + divider = divider, + background = background, + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = edgeToEdge + ) + } + } +} + +private fun Code.Builder.listItemDemoCodeSnippet(state: ListItemDemoState, themeDrawableResources: ThemeDrawableResources) { + with(state) { + val functionName = when (size) { + BaseListItemDemoState.Size.Default -> "OudsListItem" + BaseListItemDemoState.Size.Small -> "OudsSmallListItem" + } + functionCall(functionName) { + baseListItemArguments(state, themeDrawableResources) + + if (!divider) typedArgument("divider", divider) + if (background) typedArgument("background", background) + if (!edgeToEdge) typedArgument("edgeToEdge", edgeToEdge) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/listitem/ListItemDemoState.kt b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/ListItemDemoState.kt new file mode 100644 index 0000000000..a53f26727b --- /dev/null +++ b/app/src/main/java/com/orange/ouds/app/ui/components/listitem/ListItemDemoState.kt @@ -0,0 +1,254 @@ +/* + * 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.listitem + +import androidx.compose.foundation.pager.rememberPagerState +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 androidx.compose.ui.res.stringResource +import com.orange.ouds.app.R +import com.orange.ouds.core.component.OudsListItemDefaults +import com.orange.ouds.core.component.OudsListItemIconSize +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemImageSize +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsListItemVerticalAlignment + +@Composable +fun rememberListItemDemoState( + size: BaseListItemDemoState.Size, + background: Boolean = false, + edgeToEdge: Boolean = true, + selectedTabIndex: Int = 0, + label: String = stringResource(id = R.string.app_components_common_label_label), + clickable: Boolean = false, + indicator: BaseListItemDemoState.Indicator = BaseListItemDemoState.Indicator.Next, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + overline: String? = null, + extraLabel: String? = null, + description: String? = null, + leading: BaseListItemDemoState.Leading = BaseListItemDemoState.Leading.None, + leadingIconSize: OudsListItemIconSize = OudsListItemDefaults.IconSize, + leadingStatusIcon: BaseListItemDemoState.StatusIcon = BaseListItemDemoState.StatusIcon.None, + leadingImageSize: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + leadingImageRatio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + leadingImageRoundedCorners: Boolean = false, + trailing: BaseListItemDemoState.Trailing = BaseListItemDemoState.Trailing.None, + trailingIconSize: OudsListItemIconSize = OudsListItemDefaults.IconSize, + trailingStatusIcon: BaseListItemDemoState.StatusIcon = BaseListItemDemoState.StatusIcon.None, + trailingImageSize: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + trailingImageRatio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + trailingImageRoundedCorners: Boolean = false, + trailingTextLabel: String = stringResource(id = R.string.app_components_common_label_label), + trailingTextExtraLabel: String? = null, + trailingTextStyle: OudsListItemTextStyle = OudsListItemTextStyle.Label, + divider: Boolean = true, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true +): ListItemDemoState { + val state = rememberSaveable( + background, + edgeToEdge, + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled, + saver = ListItemDemoState.Saver + ) { + ListItemDemoState( + background, + edgeToEdge, + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled + ) + } + + val pagerState = rememberPagerState(initialPage = selectedTabIndex) { + BaseListItemDemoState.CustomizationTab.entries.size + } + state.pagerState = pagerState + return state +} + +class ListItemDemoState( + background: Boolean, + edgeToEdge: Boolean, + size: Size, + selectedTabIndex: Int, + label: String, + clickable: Boolean, + indicator: Indicator, + verticalAlignment: OudsListItemVerticalAlignment, + overline: String?, + extraLabel: String?, + description: String?, + leading: Leading, + leadingIconSize: OudsListItemIconSize, + leadingStatusIcon: StatusIcon, + leadingImageSize: OudsListItemImageSize, + leadingImageRatio: OudsListItemImageRatio, + leadingImageRoundedCorners: Boolean, + trailing: Trailing, + trailingIconSize: OudsListItemIconSize, + trailingStatusIcon: StatusIcon, + trailingImageSize: OudsListItemImageSize, + trailingImageRatio: OudsListItemImageRatio, + trailingImageRoundedCorners: Boolean, + trailingTextLabel: String, + trailingTextExtraLabel: String?, + trailingTextStyle: OudsListItemTextStyle, + divider: Boolean, + helperText: String?, + boldLabel: Boolean, + enabled: Boolean, +) : BaseListItemDemoState( + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled +) { + + companion object { + val Saver = listSaver( + save = { state -> + with(state) { + listOf( + background, + edgeToEdge, + with(BaseListItemDemoState.Saver) { save(state) } + ) + } + }, + restore = { list: List -> + val baseListItemDemoState = list[2]?.let { BaseListItemDemoState.Saver.restore(it) } + baseListItemDemoState?.run { + ListItemDemoState( + list[0] as Boolean, + list[1] as Boolean, + size, + selectedTabIndex, + label, + clickable, + indicator, + verticalAlignment, + overline, + extraLabel, + description, + leading, + leadingIconSize, + leadingStatusIcon, + leadingImageSize, + leadingImageRatio, + leadingImageRoundedCorners, + trailing, + trailingIconSize, + trailingStatusIcon, + trailingImageSize, + trailingImageRatio, + trailingImageRoundedCorners, + trailingTextLabel, + trailingTextExtraLabel, + trailingTextStyle, + divider, + helperText, + boldLabel, + enabled + ) + } + } + ) + } + + var background: Boolean by mutableStateOf(background) + + var edgeToEdge: Boolean by mutableStateOf(edgeToEdge) +} diff --git a/app/src/main/java/com/orange/ouds/app/ui/components/radiobutton/RadioButtonItemDemoScreen.kt b/app/src/main/java/com/orange/ouds/app/ui/components/radiobutton/RadioButtonItemDemoScreen.kt index e53e3fc9e7..7152ed3439 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/components/radiobutton/RadioButtonItemDemoScreen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/components/radiobutton/RadioButtonItemDemoScreen.kt @@ -65,7 +65,7 @@ private fun RadioButtonItemDemoBottomSheetContent(state: RadioButtonItemDemoStat controlItemCustomization(9) { CustomizationTextInput( applyTopPadding = true, - label = stringResource(R.string.app_components_radioButton_radioButtonItem_extraLabel_tech), + label = stringResource(R.string.app_components_common_extraLabel_tech), value = extraLabel.orEmpty(), onValueChange = { value -> extraLabel = value } ) 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 index a57af444bf..c4cf398a7d 100644 --- 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 @@ -154,7 +154,7 @@ class TopAppBarDemoState( } enum class ActionAvatar(@StringRes val labelRes: Int) { - Image(R.string.app_components_topAppBar_imageActionAvatar_tech), + Image(R.string.app_components_common_image_tech), Monogram(R.string.app_components_topAppBar_monogramActionAvatar_tech) } diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/PainterResources.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/PainterResources.kt index e584241334..a4ae72b5a3 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/PainterResources.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/PainterResources.kt @@ -15,9 +15,13 @@ package com.orange.ouds.app.ui.utilities import androidx.annotation.DrawableRes import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.graphics.drawscope.DrawScope import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.res.painterResource import com.orange.ouds.app.R +import com.orange.ouds.core.theme.OudsTheme data class LightDarkResourceId(@DrawableRes val light: Int, @DrawableRes val dark: Int) @@ -26,7 +30,31 @@ fun painterResource(id: LightDarkResourceId): Painter { return if (isSystemInDarkTheme()) painterResource(id = id.dark) else painterResource(id = id.light) } +private val untintedPainterBackgroundColor + @Composable + get() = OudsTheme.colorScheme.surface.brand.primary + +@Composable +fun rememberUntintedIconPainter(): Painter = rememberUntintedPainter(resId = R.drawable.ic_untinted_square) + @Composable -fun rememberUntintedIconPainter(): Painter { - return painterResource(R.drawable.ic_untinted_icon) +fun rememberImagePainter(): Painter = rememberUntintedPainter(resId = R.drawable.ic_untinted_widescreen) + +@Composable +private fun rememberUntintedPainter(@DrawableRes resId: Int): Painter { + val painter = painterResource(resId) + val backgroundColor = untintedPainterBackgroundColor + return remember(painter, backgroundColor) { + object : Painter() { + override val intrinsicSize: Size + get() = painter.intrinsicSize + + override fun DrawScope.onDraw() { + drawRect(color = backgroundColor) + with(painter) { + draw(size) + } + } + } + } } 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 a042fc4009..796f2f359d 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 @@ -74,6 +74,7 @@ fun CustomizationBottomSheetScaffold( bottomSheetScaffoldState: BottomSheetScaffoldState, titleResId: Int = R.string.app_common_customize_label, bottomSheetContent: @Composable ColumnScope.() -> Unit, + bottomSheetTabs: (@Composable () -> Unit)?, content: @Composable ColumnScope.() -> Unit ) { val coroutineScope = rememberCoroutineScope() @@ -130,11 +131,17 @@ fun CustomizationBottomSheetScaffold( ) } + bottomSheetTabs?.invoke() + val scrollState = rememberScrollState() + val sheetContentModifier = if (bottomSheetTabs == null) { + Modifier.heightIn(max = customizationContentMaxHeight) + } else { + Modifier.height(customizationContentMaxHeight) // Fix content height in case of tabs in order to prevent sheet resizing on tab selection + } Column( - modifier = Modifier - .heightIn(max = customizationContentMaxHeight) + modifier = sheetContentModifier .verticalScrollbar(scrollState) .verticalScroll(scrollState) .padding(bottom = OudsTheme.spaces.fixed.small) @@ -198,10 +205,12 @@ private fun Modifier.verticalScrollbar(scrollState: ScrollState): Modifier { val scrollBarHeight = (viewportHeight / totalContentHeight) * viewportHeight val scrollBarStartOffset = (scrollState.value.toFloat() / totalContentHeight) * viewportHeight - drawRect( - color = scrollBarColor, - topLeft = Offset(viewportWidth - scrollBarWidth.toPx(), scrollBarStartOffset), - size = Size(scrollBarWidth.toPx(), scrollBarHeight) - ) + if (totalContentHeight > viewportHeight) { + drawRect( + color = scrollBarColor, + topLeft = Offset(viewportWidth - scrollBarWidth.toPx(), scrollBarStartOffset), + size = Size(scrollBarWidth.toPx(), scrollBarHeight) + ) + } } } \ No newline at end of file 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 17de53fc31..d55924f70a 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 @@ -47,6 +47,7 @@ import androidx.compose.ui.text.TextRange import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp import com.orange.ouds.app.R import com.orange.ouds.core.component.OudsFilterChip import com.orange.ouds.core.component.OudsSwitchItem @@ -81,7 +82,7 @@ fun CustomizationSwitchItem(label: String, checked: Boolean, onCheckedChange: (B @JvmName("CustomizationFilterChipsLabels") @Composable fun CustomizationFilterChips( - label: String, + label: String?, chipLabels: List, selectedChipIndex: Int, onSelectionChange: (Int) -> Unit, @@ -103,7 +104,7 @@ fun CustomizationFilterChips( @OptIn(ExperimentalMaterial3Api::class) @Composable fun CustomizationFilterChips( - label: String, + label: String?, chips: List, selectedChipIndex: Int, onSelectionChange: (Int) -> Unit, @@ -116,9 +117,11 @@ fun CustomizationFilterChips( Column( modifier = modifier .fillMaxWidth() - .semantics(mergeDescendants = true) {} + .semantics(mergeDescendants = true) {}, ) { - CustomizationText(label = label, enabled = chips.any { it.enabled }) + label?.let { + CustomizationText(label = label, enabled = chips.any { it.enabled }) + } // Setting an horizontalScroll in the Row breaks the canFocus parameter of the focusProperties Modifier // in the parent Column of CustomizationBottomSheetScaffold @@ -135,7 +138,8 @@ fun CustomizationFilterChips( .horizontalScroll(state = rememberScrollState()) .selectableGroup() .focusProperties { canFocus = chipsRowCanFocus } - .padding(horizontal = OudsTheme.grids.margin, vertical = OudsTheme.spaces.fixed.extraSmall), + .padding(horizontal = OudsTheme.grids.margin) + .padding(top = if (label != null) OudsTheme.spaces.fixed.extraSmall else 0.dp, bottom = OudsTheme.spaces.fixed.extraSmall), horizontalArrangement = Arrangement.spacedBy(OudsTheme.spaces.fixed.extraSmall) ) { chips.forEachIndexed { index, chip -> diff --git a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt index fa48536ce8..b20fd5dab0 100644 --- a/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt +++ b/app/src/main/java/com/orange/ouds/app/ui/utilities/composable/Screen.kt @@ -45,13 +45,15 @@ fun DemoScreen( demoContent: @Composable () -> Unit, demoContentOnColoredBox: Boolean = false, demoContentPaddingValues: PaddingValues = PaddingValues(horizontal = OudsTheme.grids.margin), + bottomSheetTabs: (@Composable () -> Unit)? = null, description: String? = null, version: String? = null ) { Screen { CustomizationBottomSheetScaffold( bottomSheetScaffoldState = rememberBottomSheetScaffoldState(), - bottomSheetContent = bottomSheetContent + bottomSheetContent = bottomSheetContent, + bottomSheetTabs = bottomSheetTabs ) { if (description != null) { DetailScreenDescription( diff --git a/app/src/main/res/drawable/ic_untinted_icon.png b/app/src/main/res/drawable/ic_untinted_icon.png deleted file mode 100644 index c48bb5ef5c..0000000000 Binary files a/app/src/main/res/drawable/ic_untinted_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_untinted_square.png b/app/src/main/res/drawable/ic_untinted_square.png new file mode 100644 index 0000000000..8ffb2d5473 Binary files /dev/null and b/app/src/main/res/drawable/ic_untinted_square.png differ diff --git a/app/src/main/res/drawable/ic_untinted_widescreen.png b/app/src/main/res/drawable/ic_untinted_widescreen.png new file mode 100644 index 0000000000..6606e644c3 Binary files /dev/null and b/app/src/main/res/drawable/ic_untinted_widescreen.png differ diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 32720c6c67..2d14aff781 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -36,6 +36,7 @@ تغيير إعدادات السمة رسائل التنبيه بزوايا مستديرة زر بزوايا مستديرة + عناصر بطاقات ذات زوايا مستديرة مؤشرات التقدم ذات الزوايا المستديرة حقول إدخال نص بزوايا مستديرة @@ -153,6 +154,11 @@ Link هو عنصر واجهة مستخدم يسمح بالتنقل من مكان إلى آخر، سواء داخل نفس الصفحة أو عبر صفحات مختلفة في نفس المورد، أو إلى مورد خارجي + + List item عبارة عن صف أفقي يُستخدم لعرض وحدة معلوماتية ضمن قائمة. وتُرتَّب عناصر القائمة بشكل عمودي لتنظيم المحتوى المترابط وتسهيل المسح البصري السريع والتفاعل؛ حيث يمكن أن يشتمل كل عنصر على مكونات -مثل التسمية والنص التوضيحي والأيقونات والصور- وذلك حسب السياق. + وصف الأيقونة + وصف الصورة + Navigation bars يوفر الوصول إلى الوجهات الرئيسية للتطبيق باستخدام 3 إلى 5 علامات تبويب دائمة. يتم تمثيل كل وجهة بواسطة أيقونة وعلامة نصية اختيارية. الصفحة الرئيسية diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 83ed4ddb41..3763f12dee 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -34,10 +34,11 @@ Appliquer Annuler Changer les réglages du thème - Messages d\'alerte avec coins arrondis + Alert messages avec coins arrondis Buttons avec coins arrondis + Card items avec coins arrondis Progress indicators avec coins arrondis - Text Inputs avec coins arrondis + Text inputs avec coins arrondis Tokens @@ -151,6 +152,11 @@ Un Link (ou lien) est un élément d\'interface utilisateur qui permet de naviguer d\'un emplacement à un autre, que ce soit au sein de la même page, entre différentes pages de la même ressource ou vers une ressource externe. + + Un List item (ou élément de liste) est un élément construit horizontalement et utilisé pour afficher une entité d\'information au sein d\'une liste. Ces éléments sont empilés verticalement pour organiser les contenus associés et faciliter une lecture rapide ainsi que l\'interaction. Chaque élément peut contenir, selon le contexte, des composants tels qu\'une étiquette, un texte d\'accompagnement, des icônes ou des images. + Description de l\'icône + Description de l\'image + Une Navigation bar (ou barre de navigation) permet d\'accéder aux principales destinations d\'une application grâce à 3 à 5 onglets permanents. Chaque destination est représentée par une icône et, éventuellement, par un libellé textuel. Accueil diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f396919e75..a0b764c122 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -39,6 +39,7 @@ Change theme settings Rounded corner alert messages Rounded corner buttons + Rounded corner card items Rounded corner progress indicators Rounded corner text inputs @@ -129,14 +130,18 @@ Color Constrained max width Description + Divider + Edge to edge Error message Error @string/app_components_common_errorMessage_tech Error message + Extra label Helper text Icon Icon Icon only + Image @string/app_components_common_label_tech Label Layout @@ -256,10 +261,7 @@ Button Link - - Edge to edge - Divider Reversed @@ -281,6 +283,32 @@ Next External + + List item + List item is a horizontal row used to display a unit of information within a list. List items are vertically stacked to organise related content and support quick scanning and interaction. Each item can contain elements such as a label, supporting text, icons, images depending on the context. + @string/app_components_listItem_tech + Small list item + Card item + Decoration + Small card item + Clickable + Indicator + Vertical alignment + Icon size + Status icon + Image size + Image ratio + Rounded corner image + Background + Bold label + Overline + Icon content description + Image content description + Text + Text label + Text style + Text extra label + Navigation bar Navigation bar provides access to an app’s primary destinations using 3 to 5 persistent tabs. Each destination is represented by an icon and optionally a text label. @@ -328,7 +356,6 @@ Radio button is a UI element that allows to select a single option from a set of mutually exclusive choices. Radio button Radio button item - Extra label Radio button %s content description one contact method to proceed.]]> @@ -383,7 +410,6 @@ Action count Last action icon badge Action avatar - Image Monogram Action avatar monogram diff --git a/buildSrc/src/main/kotlin/icons.gradle.kts b/buildSrc/src/main/kotlin/icons.gradle.kts index 4c92c780db..3d554abf89 100644 --- a/buildSrc/src/main/kotlin/icons.gradle.kts +++ b/buildSrc/src/main/kotlin/icons.gradle.kts @@ -78,6 +78,8 @@ abstract class ImportIconsTask : DefaultTask() { "component/checkbox/checkbox-selected.svg", "component/checkbox/checkbox-undetermined.svg", "component/chip/tick.svg", + "component/control-item/next.svg", + "component/control-item/previous.svg", "component/link/external-link.svg", "component/link/next.svg", "component/link/previous.svg", @@ -87,6 +89,7 @@ abstract class ImportIconsTask : DefaultTask() { // Functional "functional/actions/delete-cross-round.svg", + "functional/actions/external-link.svg", "functional/navigation/form-chevron-left.svg", "functional/navigation/menu-grid-ui-round.svg", "functional/settings-and-tools/accessibility-hide.svg", diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsCardItemTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsCardItemTest.kt new file mode 100644 index 0000000000..decac1601d --- /dev/null +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsCardItemTest.kt @@ -0,0 +1,80 @@ +/* + * 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) +internal class OudsCardItemTest { + + @RunWith(Parameterized::class) + class Static(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.CardItem.Static, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.CardItem.Static.parameters + } + } + + @RunWith(Parameterized::class) + class StaticWithRoundedCorners(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.CardItem.StaticWithRoundedCorners, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.CardItem.StaticWithRoundedCorners.parameters + } + } + + @RunWith(Parameterized::class) + class Navigation(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.CardItem.Navigation, + parameter, + OudsComponentTestSuite.theme, + heightDp = OudsPreviewableComponent.CardItem.Navigation.PreviewHeightDp + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.CardItem.Navigation.parameters + } + } + + @RunWith(Parameterized::class) + class NavigationWithRoundedCorners(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.CardItem.NavigationWithRoundedCorners, + parameter = parameter, + OudsComponentTestSuite.theme, + heightDp = OudsPreviewableComponent.CardItem.Navigation.PreviewHeightDp + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.CardItem.NavigationWithRoundedCorners.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 a436984263..c274ab9acd 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 @@ -23,6 +23,7 @@ import org.junit.runners.Suite OudsBottomSheetScaffoldTest::class, OudsBulletListTest::class, OudsButtonTest::class, + OudsCardItemTest::class, OudsCheckboxItemTest::class, OudsCheckboxTest::class, OudsCircularProgressIndicatorTest::class, @@ -34,6 +35,7 @@ import org.junit.runners.Suite OudsInputTagTest::class, OudsLinearProgressIndicatorTest::class, OudsLinkTest::class, + OudsListItemTest::class, OudsModalBottomSheetTest::class, OudsNavigationBarTest::class, OudsNavigationBarItemTest::class, @@ -43,6 +45,8 @@ import org.junit.runners.Suite OudsRadioButtonItemTest::class, OudsRadioButtonTest::class, OudsSmallButtonTest::class, + OudsSmallCardItemTest::class, + OudsSmallListItemTest::class, OudsSuggestionChipTest::class, OudsSwitchItemTest::class, OudsSwitchTest::class, diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsListItemTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsListItemTest.kt new file mode 100644 index 0000000000..cd43269f10 --- /dev/null +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsListItemTest.kt @@ -0,0 +1,57 @@ +/* + * 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) +internal class OudsListItemTest { + + @RunWith(Parameterized::class) + class Static(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.ListItem.Static, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.ListItem.Static.parameters + } + } + + @RunWith(Parameterized::class) + class Navigation(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.ListItem.Navigation, + parameter, + OudsComponentTestSuite.theme, + heightDp = OudsPreviewableComponent.ListItem.Navigation.PreviewHeightDp + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.ListItem.Navigation.parameters + } + } + + class WithUntintedIcon : OudsComponentSnapshotTest( + OudsPreviewableComponent.ListItem.WithUntintedIcon, + parameter = null, + OudsComponentTestSuite.theme + ) +} diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsSmallCardItemTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsSmallCardItemTest.kt new file mode 100644 index 0000000000..e0f56f646c --- /dev/null +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsSmallCardItemTest.kt @@ -0,0 +1,80 @@ +/* + * 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) +internal class OudsSmallCardItemTest { + + @RunWith(Parameterized::class) + class Static(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.SmallCardItem.Static, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.SmallCardItem.Static.parameters + } + } + + @RunWith(Parameterized::class) + class StaticWithRoundedCorners(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.SmallCardItem.StaticWithRoundedCorners, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.SmallCardItem.StaticWithRoundedCorners.parameters + } + } + + @RunWith(Parameterized::class) + class Navigation(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.SmallCardItem.Navigation, + parameter, + OudsComponentTestSuite.theme, + heightDp = OudsPreviewableComponent.SmallCardItem.Navigation.PreviewHeightDp + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.SmallCardItem.Navigation.parameters + } + } + + @RunWith(Parameterized::class) + class NavigationWithRoundedCorners(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.SmallCardItem.NavigationWithRoundedCorners, + parameter, + OudsComponentTestSuite.theme, + heightDp = OudsPreviewableComponent.SmallCardItem.Navigation.PreviewHeightDp + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.SmallCardItem.NavigationWithRoundedCorners.parameters + } + } +} diff --git a/core-test/src/main/java/com/orange/ouds/core/test/OudsSmallListItemTest.kt b/core-test/src/main/java/com/orange/ouds/core/test/OudsSmallListItemTest.kt new file mode 100644 index 0000000000..67ee7889e1 --- /dev/null +++ b/core-test/src/main/java/com/orange/ouds/core/test/OudsSmallListItemTest.kt @@ -0,0 +1,51 @@ +/* + * 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) +internal class OudsSmallListItemTest { + + @RunWith(Parameterized::class) + class Static(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.SmallListItem.Static, + parameter, + OudsComponentTestSuite.theme + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.SmallListItem.Static.parameters + } + } + + @RunWith(Parameterized::class) + class Navigation(parameter: Any) : OudsComponentSnapshotTest( + OudsPreviewableComponent.SmallListItem.Navigation, + parameter, + OudsComponentTestSuite.theme, + heightDp = OudsPreviewableComponent.SmallListItem.Navigation.PreviewHeightDp + ) { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsPreviewableComponent.SmallListItem.Navigation.parameters + } + } +} diff --git a/core/src/androidTest/java/com/orange/ouds/core/component/OudsCardItemTest.kt b/core/src/androidTest/java/com/orange/ouds/core/component/OudsCardItemTest.kt new file mode 100644 index 0000000000..5ef090b762 --- /dev/null +++ b/core/src/androidTest/java/com/orange/ouds/core/component/OudsCardItemTest.kt @@ -0,0 +1,222 @@ +/* + * 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.outlined.Favorite +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.assertIsNotDisplayed +import androidx.compose.ui.test.junit4.v2.createComposeRule +import androidx.compose.ui.test.onNodeWithContentDescription +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.performClick +import com.orange.ouds.core.extension.setOudsContent +import org.junit.Rule +import org.junit.Test +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify + +internal class OudsCardItemTest { + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun oudsCardItem_click_succeeds() { + with(composeTestRule) { + val testTag = "OudsCardItem" + val onClick = mock<() -> Unit>() + + setOudsContent { + OudsCardItem( + label = "Label", + onClick = onClick, + modifier = Modifier.testTag(testTag) + ) + } + + onNodeWithTag(testTag).performClick() + verify(onClick).invoke() + } + } + + @Test + fun oudsCardItem_withDescription_descriptionDisplayed() { + with(composeTestRule) { + val description = "Description" + + setOudsContent { + OudsCardItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsDisplayed() + } + } + + @Test + fun oudsCardItem_withBlankDescription_descriptionNotDisplayed() { + with(composeTestRule) { + val description = " " + + setOudsContent { + OudsCardItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsNotDisplayed() + } + } + + @Test + fun oudsCardItem_withExtraLabel_extraLabelDisplayed() { + with(composeTestRule) { + val extraLabel = "Extra label" + + setOudsContent { + OudsCardItem( + label = "Label", + extraLabel = extraLabel + ) + } + + onNodeWithText(extraLabel).assertIsDisplayed() + } + } + + @Test + fun oudsCardItem_withBlankExtraLabel_extraLabelNotDisplayed() { + with(composeTestRule) { + val extraLabel = " " + + setOudsContent { + OudsCardItem( + label = "Label", + extraLabel = extraLabel + ) + } + + onNodeWithText(extraLabel).assertIsNotDisplayed() + } + } + + @Test + fun oudsCardItem_withOverline_overlineDisplayed() { + with(composeTestRule) { + val overline = "Overline" + + setOudsContent { + OudsCardItem( + label = "Label", + overline = overline + ) + } + + onNodeWithText(overline).assertIsDisplayed() + } + } + + @Test + fun oudsCardItem_withBlankOverline_overlineNotDisplayed() { + with(composeTestRule) { + val overline = " " + + setOudsContent { + OudsCardItem( + label = "Label", + overline = overline + ) + } + + onNodeWithText(overline).assertIsNotDisplayed() + } + } + + @Test + fun oudsCardItem_withHelperText_helperTextDisplayed() { + with(composeTestRule) { + val helperText = "Helper text" + + setOudsContent { + OudsCardItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsDisplayed() + } + } + + @Test + fun oudsCardItem_withBlankHelperText_helperTextNotDisplayed() { + with(composeTestRule) { + val helperText = " " + + setOudsContent { + OudsCardItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsNotDisplayed() + } + } + + @Test + fun oudsCardItem_withLeadingIcon_leadingIconDisplayed() { + with(composeTestRule) { + val leadingIconContentDescription = "Leading icon" + + setOudsContent { + OudsCardItem( + label = "Label", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = leadingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(leadingIconContentDescription).assertIsDisplayed() + } + } + + @Test + fun oudsCardItem_withTrailingIcon_trailingIconDisplayed() { + with(composeTestRule) { + val trailingIconContentDescription = "Trailing icon" + + setOudsContent { + OudsCardItem( + label = "Label", + trailing = OudsListItemTrailing.Icon( + imageVector = Icons.Outlined.FavoriteBorder, + contentDescription = trailingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(trailingIconContentDescription).assertIsDisplayed() + } + } +} diff --git a/core/src/androidTest/java/com/orange/ouds/core/component/OudsListItemTest.kt b/core/src/androidTest/java/com/orange/ouds/core/component/OudsListItemTest.kt new file mode 100644 index 0000000000..47f67e4a60 --- /dev/null +++ b/core/src/androidTest/java/com/orange/ouds/core/component/OudsListItemTest.kt @@ -0,0 +1,222 @@ +/* + * 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.outlined.Favorite +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.assertIsNotDisplayed +import androidx.compose.ui.test.junit4.v2.createComposeRule +import androidx.compose.ui.test.onNodeWithContentDescription +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.performClick +import com.orange.ouds.core.extension.setOudsContent +import org.junit.Rule +import org.junit.Test +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify + +internal class OudsListItemTest { + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun oudsListItem_click_succeeds() { + with(composeTestRule) { + val testTag = "OudsListItem" + val onClick = mock<() -> Unit>() + + setOudsContent { + OudsListItem( + label = "Label", + onClick = onClick, + modifier = Modifier.testTag(testTag) + ) + } + + onNodeWithTag(testTag).performClick() + verify(onClick).invoke() + } + } + + @Test + fun oudsListItem_withDescription_descriptionDisplayed() { + with(composeTestRule) { + val description = "Description" + + setOudsContent { + OudsListItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsDisplayed() + } + } + + @Test + fun oudsListItem_withBlankDescription_descriptionNotDisplayed() { + with(composeTestRule) { + val description = " " + + setOudsContent { + OudsListItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsNotDisplayed() + } + } + + @Test + fun oudsListItem_withExtraLabel_extraLabelDisplayed() { + with(composeTestRule) { + val extraLabel = "Extra label" + + setOudsContent { + OudsListItem( + label = "Label", + extraLabel = extraLabel + ) + } + + onNodeWithText(extraLabel).assertIsDisplayed() + } + } + + @Test + fun oudsListItem_withBlankExtraLabel_extraLabelNotDisplayed() { + with(composeTestRule) { + val extraLabel = " " + + setOudsContent { + OudsListItem( + label = "Label", + extraLabel = extraLabel + ) + } + + onNodeWithText(extraLabel).assertIsNotDisplayed() + } + } + + @Test + fun oudsListItem_withOverline_overlineDisplayed() { + with(composeTestRule) { + val overline = "Overline" + + setOudsContent { + OudsListItem( + label = "Label", + overline = overline + ) + } + + onNodeWithText(overline).assertIsDisplayed() + } + } + + @Test + fun oudsListItem_withBlankOverline_overlineNotDisplayed() { + with(composeTestRule) { + val overline = " " + + setOudsContent { + OudsListItem( + label = "Label", + overline = overline + ) + } + + onNodeWithText(overline).assertIsNotDisplayed() + } + } + + @Test + fun oudsListItem_withHelperText_helperTextDisplayed() { + with(composeTestRule) { + val helperText = "Helper text" + + setOudsContent { + OudsListItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsDisplayed() + } + } + + @Test + fun oudsListItem_withBlankHelperText_helperTextNotDisplayed() { + with(composeTestRule) { + val helperText = " " + + setOudsContent { + OudsListItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsNotDisplayed() + } + } + + @Test + fun oudsListItem_withLeadingIcon_leadingIconDisplayed() { + with(composeTestRule) { + val leadingIconContentDescription = "Leading icon" + + setOudsContent { + OudsListItem( + label = "Label", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = leadingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(leadingIconContentDescription).assertIsDisplayed() + } + } + + @Test + fun oudsListItem_withTrailingIcon_trailingIconDisplayed() { + with(composeTestRule) { + val trailingIconContentDescription = "Trailing icon" + + setOudsContent { + OudsListItem( + label = "Label", + trailing = OudsListItemTrailing.Icon( + imageVector = Icons.Outlined.FavoriteBorder, + contentDescription = trailingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(trailingIconContentDescription).assertIsDisplayed() + } + } +} diff --git a/core/src/androidTest/java/com/orange/ouds/core/component/OudsSmallCardItemTest.kt b/core/src/androidTest/java/com/orange/ouds/core/component/OudsSmallCardItemTest.kt new file mode 100644 index 0000000000..5919aa9c5e --- /dev/null +++ b/core/src/androidTest/java/com/orange/ouds/core/component/OudsSmallCardItemTest.kt @@ -0,0 +1,158 @@ +/* + * 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.outlined.Favorite +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.assertIsNotDisplayed +import androidx.compose.ui.test.junit4.v2.createComposeRule +import androidx.compose.ui.test.onNodeWithContentDescription +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.performClick +import com.orange.ouds.core.extension.setOudsContent +import org.junit.Rule +import org.junit.Test +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify + +internal class OudsSmallCardItemTest { + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun oudsSmallCardItem_click_succeeds() { + with(composeTestRule) { + val testTag = "OudsSmallCardItem" + val onClick = mock<() -> Unit>() + + setOudsContent { + OudsSmallCardItem( + label = "Label", + onClick = onClick, + modifier = Modifier.testTag(testTag) + ) + } + + onNodeWithTag(testTag).performClick() + verify(onClick).invoke() + } + } + + @Test + fun oudsSmallCardItem_withDescription_descriptionDisplayed() { + with(composeTestRule) { + val description = "Description" + + setOudsContent { + OudsSmallCardItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsDisplayed() + } + } + + @Test + fun oudsSmallCardItem_withBlankDescription_descriptionNotDisplayed() { + with(composeTestRule) { + val description = " " + + setOudsContent { + OudsSmallCardItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsNotDisplayed() + } + } + + @Test + fun oudsSmallCardItem_withHelperText_helperTextDisplayed() { + with(composeTestRule) { + val helperText = "Helper text" + + setOudsContent { + OudsSmallCardItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsDisplayed() + } + } + + @Test + fun oudsSmallCardItem_withBlankHelperText_helperTextNotDisplayed() { + with(composeTestRule) { + val helperText = " " + + setOudsContent { + OudsSmallCardItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsNotDisplayed() + } + } + + @Test + fun oudsSmallCardItem_withLeadingIcon_leadingIconDisplayed() { + with(composeTestRule) { + val leadingIconContentDescription = "Leading icon" + + setOudsContent { + OudsSmallCardItem( + label = "Label", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = leadingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(leadingIconContentDescription).assertIsDisplayed() + } + } + + @Test + fun oudsSmallCardItem_withTrailingIcon_trailingIconDisplayed() { + with(composeTestRule) { + val trailingIconContentDescription = "Trailing icon" + + setOudsContent { + OudsSmallCardItem( + label = "Label", + trailing = OudsSmallListItemTrailing.Icon( + imageVector = Icons.Outlined.FavoriteBorder, + contentDescription = trailingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(trailingIconContentDescription).assertIsDisplayed() + } + } +} diff --git a/core/src/androidTest/java/com/orange/ouds/core/component/OudsSmallListItemTest.kt b/core/src/androidTest/java/com/orange/ouds/core/component/OudsSmallListItemTest.kt new file mode 100644 index 0000000000..2b4b866de8 --- /dev/null +++ b/core/src/androidTest/java/com/orange/ouds/core/component/OudsSmallListItemTest.kt @@ -0,0 +1,158 @@ +/* + * 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.outlined.Favorite +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.assertIsNotDisplayed +import androidx.compose.ui.test.junit4.v2.createComposeRule +import androidx.compose.ui.test.onNodeWithContentDescription +import androidx.compose.ui.test.onNodeWithTag +import androidx.compose.ui.test.onNodeWithText +import androidx.compose.ui.test.performClick +import com.orange.ouds.core.extension.setOudsContent +import org.junit.Rule +import org.junit.Test +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify + +internal class OudsSmallListItemTest { + + @get:Rule + val composeTestRule = createComposeRule() + + @Test + fun oudsSmallListItem_click_succeeds() { + with(composeTestRule) { + val testTag = "OudsSmallListItem" + val onClick = mock<() -> Unit>() + + setOudsContent { + OudsSmallListItem( + label = "Label", + onClick = onClick, + modifier = Modifier.testTag(testTag) + ) + } + + onNodeWithTag(testTag).performClick() + verify(onClick).invoke() + } + } + + @Test + fun oudsSmallListItem_withDescription_descriptionDisplayed() { + with(composeTestRule) { + val description = "Description" + + setOudsContent { + OudsSmallListItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsDisplayed() + } + } + + @Test + fun oudsSmallListItem_withBlankDescription_descriptionNotDisplayed() { + with(composeTestRule) { + val description = " " + + setOudsContent { + OudsSmallListItem( + label = "Label", + description = description + ) + } + + onNodeWithText(description).assertIsNotDisplayed() + } + } + + @Test + fun oudsSmallListItem_withHelperText_helperTextDisplayed() { + with(composeTestRule) { + val helperText = "Helper text" + + setOudsContent { + OudsSmallListItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsDisplayed() + } + } + + @Test + fun oudsSmallListItem_withBlankHelperText_helperTextNotDisplayed() { + with(composeTestRule) { + val helperText = " " + + setOudsContent { + OudsSmallListItem( + label = "Label", + helperText = helperText + ) + } + + onNodeWithText(helperText).assertIsNotDisplayed() + } + } + + @Test + fun oudsSmallListItem_withLeadingIcon_leadingIconDisplayed() { + with(composeTestRule) { + val leadingIconContentDescription = "Leading icon" + + setOudsContent { + OudsSmallListItem( + label = "Label", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = leadingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(leadingIconContentDescription).assertIsDisplayed() + } + } + + @Test + fun oudsSmallListItem_withTrailingIcon_trailingIconDisplayed() { + with(composeTestRule) { + val trailingIconContentDescription = "Trailing icon" + + setOudsContent { + OudsSmallListItem( + label = "Label", + trailing = OudsSmallListItemTrailing.Icon( + imageVector = Icons.Outlined.FavoriteBorder, + contentDescription = trailingIconContentDescription + ) + ) + } + + onNodeWithContentDescription(trailingIconContentDescription).assertIsDisplayed() + } + } +} 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 index 5b6e308a60..f810619422 100644 --- a/core/src/androidTest/java/com/orange/ouds/core/component/OudsTopAppBarTest.kt +++ b/core/src/androidTest/java/com/orange/ouds/core/component/OudsTopAppBarTest.kt @@ -21,7 +21,6 @@ import androidx.compose.ui.test.junit4.v2.createComposeRule import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.onNodeWithTag 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.CheckerboardPainter import org.junit.Rule @@ -78,7 +77,7 @@ class OudsTopAppBarTest { onClick = onIconClick ), OudsTopAppBarAction.Avatar( - painter = CheckerboardPainter(4.dp, Color.White, Color.Black), + painter = CheckerboardPainter, contentDescription = imageAvatarContentDescription, onClick = onImageAvatarClick ), diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsAvatar.kt b/core/src/main/java/com/orange/ouds/core/component/OudsAvatar.kt index caa85e4739..54965a18d5 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsAvatar.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsAvatar.kt @@ -224,13 +224,7 @@ internal fun PreviewOudsAvatar( ) } else { OudsAvatar( - painter = remember { - CheckerboardPainter( - squareSize = 6.dp, - primaryColor = Color(0xff247a85), - secondaryColor = Color(0xfffbcd00) - ) - }, + painter = remember { CheckerboardPainter }, onClick = {} ) } diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsBasicChip.kt b/core/src/main/java/com/orange/ouds/core/component/OudsBasicChip.kt index eecf0c9f58..133cfc2b53 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsBasicChip.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsBasicChip.kt @@ -42,6 +42,7 @@ import androidx.compose.ui.unit.dp import com.orange.ouds.core.component.common.outerBorder import com.orange.ouds.core.extensions.InteractionState import com.orange.ouds.core.extensions.collectInteractionStateAsState +import com.orange.ouds.core.extensions.iconSize import com.orange.ouds.core.theme.OudsTheme import com.orange.ouds.core.theme.takeUnlessHairline import com.orange.ouds.core.theme.value @@ -161,7 +162,7 @@ internal fun OudsBasicChip( val iconContent: @Composable (Modifier) -> Unit = { modifier -> icon?.Content( modifier = modifier - .size(chipTokens.sizeIcon.value * iconScale) + .iconSize(chipTokens.sizeIcon.value * iconScale, tinted = icon.tinted) .semantics { contentDescription = if (label == null) icon.contentDescription else "" }, diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsCardItem.kt b/core/src/main/java/com/orange/ouds/core/component/OudsCardItem.kt new file mode 100644 index 0000000000..360828ff4d --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/OudsCardItem.kt @@ -0,0 +1,312 @@ +/* + * 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 android.content.res.Configuration.UI_MODE_NIGHT_YES +import android.content.res.Configuration.UI_MODE_TYPE_NORMAL +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.OudsPreviewDevice +import com.orange.ouds.core.utilities.OudsPreviewLightDark +import com.orange.ouds.core.utilities.OudsPreviewableComponent +import com.orange.ouds.core.utilities.PreviewEnumEntries +import com.orange.ouds.core.utilities.PreviewPaddingDefault +import com.orange.ouds.core.utilities.getPreviewTheme +import com.orange.ouds.core.utilities.mapSettings +import com.orange.ouds.foundation.ExperimentalOudsApi +import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider +import com.orange.ouds.theme.OudsThemeContract + +/** + * TODO update description when available and add version and guideline link + * + * Static card item displays non-clickable information in a card format with visual emphasis. + * + * A static card item can be used to present read-only information in a contained format. + * Cards are ideal for displaying grouped content like product cards, destination highlights, or + * feature summaries. The card supports various decorations outlined, background with or without divider. + * + * @param label The main label of the card item. + * @param modifier [Modifier] applied to the layout of the card item. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param decoration The decoration style of the card. Defaults to [OudsListItemDecoration.Background] (with divider). + * @param overline Optional text displayed above the label. + * @param extraLabel Optional strong accompanying label for the main label, displayed between the [label] and the [description]. + * @param description Optional text displayed below the [label] and [extraLabel]. + * @param leading Optional leading content such as an icon or image displayed at the start of the card item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the card item. + * @param helperText Optional helper text displayed below the card item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the card item. When `false`, the content is displayed in a disabled state. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this card item. + * + * @sample com.orange.ouds.core.component.samples.OudsStaticCardItemSample + * @sample com.orange.ouds.core.component.samples.OudsCardItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsCardItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsCardItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsCardItem( + label: String, + modifier: Modifier = Modifier, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + decoration: OudsListItemDecoration = OudsCardItemDefaults.Decoration, + overline: String? = null, + extraLabel: String? = null, + description: String? = null, + leading: OudsListItemLeading? = null, + trailing: OudsListItemTrailing? = null, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Small, + label = label, + onClick = null, + modifier = modifier, + indicator = null, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = leading, + trailing = trailing, + decoration = decoration, + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = false, + card = true, + interactionSource = interactionSource + ) +} + +/** + * TODO update description when available and add version and guideline link + * + * Navigation card item allows users to navigate to another screen or perform an action in a card format. + * + * A navigation card item is clickable and presented in a card format with visual emphasis. + * It can be used for navigable product cards, destination selections, or feature highlights. + * The indicator type can be customized to show forward navigation, backward navigation, or + * external links. The card supports various decorations to adapt to different visual styles: + * outlined, background with or without divider. + * + * @param label The main label of the card item. + * @param modifier [Modifier] applied to the layout of the card item. + * @param onClick Callback invoked when the card item is clicked. + * @param indicator The navigation indicator to display. Defaults to [OudsListItemIndicator.Next]. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param decoration The decoration style of the card. Defaults to [OudsListItemDecoration.Background] (with divider). + * @param overline Optional text displayed above the label. + * @param extraLabel Optional strong accompanying label for the main label, displayed between the [label] and the [description]. + * @param description Optional text displayed below the [label] and [extraLabel]. + * @param leading Optional leading content such as an icon or image displayed at the start of the card item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the card item. + * @param helperText Optional helper text displayed below the card item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the card item. When `false`, the item is not clickable and content is displayed in a disabled state. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this card item. + * + * @sample com.orange.ouds.core.component.samples.OudsNavigationCardItemSample + * @sample com.orange.ouds.core.component.samples.OudsCardItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsCardItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsCardItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsCardItem( + label: String, + modifier: Modifier = Modifier, + onClick: () -> Unit, + indicator: OudsListItemIndicator = OudsListItemDefaults.Indicator, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + decoration: OudsListItemDecoration = OudsCardItemDefaults.Decoration, + overline: String? = null, + extraLabel: String? = null, + description: String? = null, + leading: OudsListItemLeading? = null, + trailing: OudsListItemTrailing? = null, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Small, + label = label, + onClick = onClick, + modifier = modifier, + indicator = indicator, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = leading, + trailing = trailing, + decoration = decoration, + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = false, + card = true, + interactionSource = interactionSource + ) +} + +/** + * Default values for [OudsCardItem]. + */ +object OudsCardItemDefaults { + /** + * Default decoration of an [OudsCardItem]. + */ + val Decoration = OudsListItemDecoration.Background(true) +} + +@OudsPreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsStaticCardItem(@PreviewParameter(OudsCardItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsStaticCardItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsStaticCardItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsCardItem( + label = label, + decoration = decoration, + overline = overline, + extraLabel = extraLabel, + description = description, + helperText = helperText, + verticalAlignment = verticalAlignment, + leading = leading, + trailing = trailing, + boldLabel = boldLabel, + enabled = enabled + ) + } +} + +@OudsPreview +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsStaticCardItemWithRoundedCorners(@PreviewParameter(OudsCardItemWithRoundedCornersParameterProvider::class) decoration: OudsListItemDecoration) { + PreviewOudsStaticCardItemWithRoundedCorners(theme = getPreviewTheme(), decoration = decoration) +} + +@Composable +internal fun PreviewOudsStaticCardItemWithRoundedCorners(theme: OudsThemeContract, decoration: OudsListItemDecoration) = + OudsPreview(theme = theme.mapSettings { it.copy(roundedCornerCardItems = true) }) { + OudsCardItem( + modifier = Modifier.padding(PreviewPaddingDefault), + label = "Label", + decoration = decoration, + description = "Description", + overline = "Overline", + extraLabel = "Extra label", + helperText = "Helper text", + ) + } + +@Preview(name = "Light", heightDp = OudsPreviewableComponent.CardItem.Navigation.PreviewHeightDp, device = OudsPreviewDevice) +@Preview( + name = "Dark", + uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, + heightDp = OudsPreviewableComponent.CardItem.Navigation.PreviewHeightDp, + device = OudsPreviewDevice +) +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationCardItem(@PreviewParameter(OudsCardItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsNavigationCardItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsNavigationCardItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsCardItem( + onClick = {}, + decoration = decoration, + indicator = indicator, + label = label, + overline = overline, + extraLabel = extraLabel, + description = description, + helperText = helperText, + verticalAlignment = verticalAlignment, + leading = leading, + trailing = trailing, + enabled = enabled + ) + } + } +} + +@Preview(name = "Light", heightDp = OudsPreviewableComponent.CardItem.Navigation.PreviewHeightDp, device = OudsPreviewDevice) +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationCardItemWithRoundedCorners(@PreviewParameter(OudsCardItemWithRoundedCornersParameterProvider::class) decoration: OudsListItemDecoration) { + PreviewOudsNavigationCardItemWithRoundedCorners(theme = getPreviewTheme(), decoration = decoration) +} + +@Composable +internal fun PreviewOudsNavigationCardItemWithRoundedCorners(theme: OudsThemeContract, decoration: OudsListItemDecoration) = + OudsPreview(theme = theme.mapSettings { it.copy(roundedCornerCardItems = true) }) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsCardItem( + onClick = {}, + label = "Label", + decoration = decoration, + description = "Description", + overline = "Overline", + extraLabel = "Extra label", + helperText = "Helper text", + ) + } + } + +internal class OudsCardItemPreviewParameterProvider : OudsBasicListItemPreviewParameterProvider( + leading = listItemPreviewParameterLeading, + trailing = listItemPreviewParameterTrailing, + decoration = { index -> + when (index) { + 0 -> OudsCardItemDefaults.Decoration + 1 -> OudsListItemDecoration.Outlined + else -> OudsListItemDecoration.BackgroundOnInteraction(divider = false) + } + } +) + +internal class OudsCardItemWithRoundedCornersParameterProvider : + BasicPreviewParameterProvider(OudsListItemDecoration.Outlined, OudsListItemDecoration.Background(true)) diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsListItem.kt b/core/src/main/java/com/orange/ouds/core/component/OudsListItem.kt new file mode 100644 index 0000000000..788b899db5 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/OudsListItem.kt @@ -0,0 +1,1492 @@ +/* + * 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 android.content.res.Configuration.UI_MODE_NIGHT_YES +import android.content.res.Configuration.UI_MODE_TYPE_NORMAL +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.sizeIn +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +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.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import com.orange.ouds.core.R +import com.orange.ouds.core.component.common.bottomBorder +import com.orange.ouds.core.component.common.outerBorder +import com.orange.ouds.core.component.content.OudsComponentContent +import com.orange.ouds.core.component.content.OudsComponentIcon +import com.orange.ouds.core.component.content.OudsComponentImage +import com.orange.ouds.core.component.content.OudsPolymorphicComponentContent +import com.orange.ouds.core.component.content.PolymorphicContent +import com.orange.ouds.core.extensions.InteractionState +import com.orange.ouds.core.extensions.collectInteractionStateAsState +import com.orange.ouds.core.theme.LocalThemeSettings +import com.orange.ouds.core.theme.OudsTheme +import com.orange.ouds.core.theme.takeUnlessHairline +import com.orange.ouds.core.theme.value +import com.orange.ouds.core.utilities.CheckerboardPainter +import com.orange.ouds.core.utilities.LayeredTintedPainter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.OudsPreviewDevice +import com.orange.ouds.core.utilities.OudsPreviewLightDark +import com.orange.ouds.core.utilities.OudsPreviewableComponent +import com.orange.ouds.core.utilities.PreviewEnumEntries +import com.orange.ouds.core.utilities.getPreviewEnumEntry +import com.orange.ouds.core.utilities.getPreviewTheme +import com.orange.ouds.core.utilities.rememberRainbowHeartPainter +import com.orange.ouds.foundation.ExperimentalOudsApi +import com.orange.ouds.foundation.extensions.orElse +import com.orange.ouds.foundation.utilities.BasicPreviewParameterProvider +import com.orange.ouds.theme.OudsThemeContract + +/** + * TODO update description when available and add version and guideline link + * + * Static list item displays non-clickable information in a structured format. + * They are designed to be stacked within a list, with no spacing between the elements. + * + * A static list item can be used to present read-only information such as contact details, + * product specifications, or settings values. + * These items are designed to be stacked within a list, with no spacing between the elements. + * + * @see [OudsCardItem] If you need spaced items displayed in a card format (with background or outlined). + * + * @param label The main label of the list item. + * @param modifier [Modifier] applied to the layout of the list item. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param overline Optional text displayed above the label. + * @param extraLabel Optional strong accompanying label for the main label, displayed between the [label] and the [description]. + * @param description Optional text displayed below the [label] and [extraLabel]. + * @param leading Optional leading content such as an icon or image displayed at the start of the list item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the list item. + * @param divider Controls the display of a divider at the bottom of the list item. Defaults to `true`. + * @param background Controls whether the list item has a background color. Defaults to `false`. + * @param helperText Optional helper text displayed below the list item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the list item. When `false`, the content is displayed in a disabled state. Defaults to `true`. + * @param edgeToEdge Controls the horizontal layout of the item. When `true`, the item is designed to span the full width of the screen or container. When `false`, + * it is adapted for use within constrained layouts or containers with their own padding. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this list item. + * + * @sample com.orange.ouds.core.component.samples.OudsStaticListItemSample + * @sample com.orange.ouds.core.component.samples.OudsListItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsListItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsListItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsListItem( + label: String, + modifier: Modifier = Modifier, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + overline: String? = null, + extraLabel: String? = null, + description: String? = null, + leading: OudsListItemLeading? = null, + trailing: OudsListItemTrailing? = null, + divider: Boolean = true, + background: Boolean = false, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + edgeToEdge: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Default, + label = label, + onClick = null, + modifier = modifier, + indicator = null, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = leading, + trailing = trailing, + decoration = listItemDecoration(background, divider), + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = edgeToEdge, + card = false, + interactionSource = interactionSource + ) +} + +/** + * TODO update description when available and add version and guideline link + * + * Navigation list item allows users to navigate to another screen or perform an action. + * They are designed to be stacked within a list, with no spacing between the elements. + * + * A navigation list item is clickable and typically includes a navigation indicator. + * It can be used for menu items, settings options, or any interactive list that leads to + * another destination. The indicator type can be customized to show forward navigation, + * backward navigation, or external links. + * These items are designed to be stacked within a list, with no spacing between the elements. + * + * @see [OudsCardItem] If you need spaced items displayed in a card format (with background or outlined). + * + * @param label The main label of the list item. + * @param onClick Callback invoked when the list item is clicked. + * @param modifier [Modifier] applied to the layout of the list item. + * @param indicator The navigation indicator to display. Defaults to [OudsListItemIndicator.Next]. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param overline Optional text displayed above the label. + * @param extraLabel Optional strong accompanying label for the main label, displayed between the [label] and the [description]. + * @param description Optional text displayed below the [label] and [extraLabel]. + * @param leading Optional leading content such as an icon or image displayed at the start of the list item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the list item. + * @param divider Controls the display of a divider at the bottom of the list item. Defaults to `true`. + * @param background Controls whether the list item has a background color. Defaults to `false`. + * @param helperText Optional helper text displayed below the list item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the list item. When `false`, the item is not clickable and content is displayed in a disabled state. Defaults to `true`. + * @param edgeToEdge Controls the horizontal layout of the item. When `true`, the item is designed to span the full width of the screen or container. When `false`, + * it is adapted for use within constrained layouts or containers with their own padding. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this list item. + * + * @sample com.orange.ouds.core.component.samples.OudsNavigationListItemSample + * @sample com.orange.ouds.core.component.samples.OudsListItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsListItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsListItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsListItem( + label: String, + onClick: () -> Unit, + modifier: Modifier = Modifier, + indicator: OudsListItemIndicator = OudsListItemDefaults.Indicator, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + overline: String? = null, + extraLabel: String? = null, + description: String? = null, + leading: OudsListItemLeading? = null, + trailing: OudsListItemTrailing? = null, + divider: Boolean = true, + background: Boolean = false, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + edgeToEdge: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Default, + label = label, + onClick = onClick, + modifier = modifier, + indicator = indicator, + verticalAlignment = verticalAlignment, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = leading, + trailing = trailing, + decoration = listItemDecoration(background, divider), + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = edgeToEdge, + card = false, + interactionSource = interactionSource + ) +} + +@Composable +internal fun OudsListItem( + size: OudsListItemSize, + label: String, + onClick: (() -> Unit)?, + modifier: Modifier, + indicator: OudsListItemIndicator?, + verticalAlignment: OudsListItemVerticalAlignment, + overline: String?, + extraLabel: String?, + description: String?, + leading: OudsListItemLeadingTrailing?, + trailing: OudsListItemLeadingTrailing?, + decoration: OudsListItemDecoration, + helperText: String?, + boldLabel: Boolean, + enabled: Boolean, + edgeToEdge: Boolean, + card: Boolean, + interactionSource: MutableInteractionSource? +) { + @Suppress("NAME_SHADOWING") val interactionSource = interactionSource ?: remember { MutableInteractionSource() } + val interactionState by interactionSource.collectInteractionStateAsState() + val state = getListItemState(enabled = enabled, interactionState = interactionState) + val backgroundColor = rememberInteractionColor(interactionState = interactionState) { listItemInteractionState -> + val listItemState = getListItemState(enabled = enabled, interactionState = listItemInteractionState) + backgroundColor(state = listItemState, decoration = decoration) + } + val outlineBorderColor = rememberInteractionColor(interactionState = interactionState) { listItemInteractionState -> + val listItemState = getListItemState(enabled = enabled, interactionState = listItemInteractionState) + outlineBorderColor(state = listItemState) + } + + with(OudsTheme.components.listItem) { + val borderRadius = borderRadius(card = card, focused = state == OudsListItemState.Focused) + val shape = shape(cornerRadius = borderRadius) + + val clickableModifier = if (onClick != null) { + Modifier.clickable( + onClick = onClick, + enabled = enabled, + interactionSource = interactionSource, + indication = interactionValuesIndication(backgroundColor, outlineBorderColor) + ) + } else { + Modifier + } + + Column( + modifier = modifier.sizeIn(minWidth = this.size.minWidth) + ) { + Row( + modifier = clickableModifier + .fillMaxWidth() + .heightIn(min = minHeight(size)) + .background(color = backgroundColor.value, shape = shape) + .border(state = state, decoration = decoration, cornerRadius = borderRadius, outlineColor = outlineBorderColor.value) + .outerBorder(state = state, shape = shape) + .containerPadding(size = size, verticalAlignment = verticalAlignment, edgeToEdge = edgeToEdge) + .semantics(mergeDescendants = true) { }, + horizontalArrangement = Arrangement.spacedBy(space.columnGap), + verticalAlignment = verticalAlignment(verticalAlignment) + ) { + if (indicator == OudsListItemIndicator.Previous) { + Indicator(drawableId = indicator.drawableId, state = state) + } else { + leading?.let { + when (leading) { + is OudsListItemLeadingTrailing.Icon -> { + leading.PolymorphicContent( + extraParameters = OudsListItemLeadingTrailing.Icon.ExtraParameters(state = state) + ) + } + is OudsListItemLeadingTrailing.Image -> leading.PolymorphicContent() + is OudsListItemLeadingTrailing.Text -> {} + } + } + } + + Column( + modifier = Modifier + .weight(1f) + .padding(top = topTextContainerPadding(verticalAlignment = verticalAlignment, size = size)) + ) { + if (!overline.isNullOrBlank()) { + Text(text = overline, style = OudsTheme.typography.label.small.moderate, color = contentColor(state = state, muted = true)) + } + Text( + text = label, + style = if (boldLabel) OudsTheme.typography.label.large.strong else OudsTheme.typography.label.large.default, + color = contentColor(state = state) + ) + if (!extraLabel.isNullOrBlank()) { + Text(text = extraLabel, style = OudsTheme.typography.label.medium.strong, color = contentColor(state = state)) + } + if (!description.isNullOrBlank()) { + Text(text = description, style = OudsTheme.typography.label.medium.default, color = contentColor(state = state, muted = true)) + } + } + + trailing?.let { + when (trailing) { + is OudsListItemLeadingTrailing.Icon -> trailing.PolymorphicContent( + extraParameters = OudsListItemLeadingTrailing.Icon.ExtraParameters( + state = state + ) + ) + is OudsListItemLeadingTrailing.Text -> { + trailing.PolymorphicContent( + extraParameters = OudsListItemLeadingTrailing.Text.ExtraParameters( + verticalAlignment = verticalAlignment, + size = size + ) + ) + } + is OudsListItemLeadingTrailing.Image -> trailing.PolymorphicContent() + } + } + + if (indicator != null && indicator in listOf(OudsListItemIndicator.Next, OudsListItemIndicator.External)) { + Indicator(drawableId = indicator.drawableId, state = state) + } + } + + if (!helperText.isNullOrBlank()) { + Text( + modifier = Modifier + .padding(top = space.paddingBlock.topHelperText) + .padding(horizontal = space.paddingInline), + text = helperText, + style = OudsTheme.typography.label.medium.default, + color = contentColor(state = state, muted = true) + ) + } + } + } +} + +@Composable +private fun Indicator(drawableId: Int, state: OudsListItemState) { + with(OudsTheme.components.listItem) { + Icon( + modifier = Modifier.size(size.asset.small), + painter = painterResource(drawableId), + contentDescription = null, + tint = indicatorColor(state = state) + ) + } +} + +@Composable +private fun getListItemState(enabled: Boolean, interactionState: InteractionState): OudsListItemState { + return getPreviewEnumEntry().orElse { + when { + !enabled -> OudsListItemState.Disabled + interactionState == InteractionState.Hovered -> OudsListItemState.Hovered + interactionState == InteractionState.Pressed -> OudsListItemState.Pressed + interactionState == InteractionState.Focused -> OudsListItemState.Focused + else -> OudsListItemState.Enabled + } + } +} + +@Composable +private fun Modifier.containerPadding(size: OudsListItemSize, verticalAlignment: OudsListItemVerticalAlignment, edgeToEdge: Boolean) = + with(OudsTheme.components.listItem) { + when (size) { + OudsListItemSize.Small -> when (verticalAlignment) { + OudsListItemVerticalAlignment.CenterVertically -> padding(vertical = space.paddingBlock.small) + OudsListItemVerticalAlignment.Top -> padding( + top = space.paddingBlock.topAlignment.topCounterweightSmall, + bottom = space.paddingBlock.small + ) + } + OudsListItemSize.Default -> when (verticalAlignment) { + OudsListItemVerticalAlignment.CenterVertically -> padding(vertical = space.paddingBlock.default) + OudsListItemVerticalAlignment.Top -> padding( + top = space.paddingBlock.topAlignment.topCounterweightDefault, + bottom = space.paddingBlock.default + ) + } + }.padding(horizontal = contentHorizontalPadding(edgeToEdge = edgeToEdge)) + } + +@Composable +private fun contentHorizontalPadding(edgeToEdge: Boolean) = + if (edgeToEdge) OudsTheme.grids.margin else OudsTheme.componentsTokens.listItem.spacePaddingInline.value + +@Composable +private fun backgroundColor(state: OudsListItemState, decoration: OudsListItemDecoration?) = with(OudsTheme.colorScheme.action.support) { + val backgroundDecoration = decoration is OudsListItemDecoration.Background || decoration is OudsListItemDecoration.BackgroundOnInteraction + when (state) { + OudsListItemState.Enabled, OudsListItemState.Disabled -> if (decoration is OudsListItemDecoration.Background) enabled else Color.Transparent + OudsListItemState.Focused -> if (backgroundDecoration) focus else Color.Transparent + OudsListItemState.Hovered -> if (backgroundDecoration) hover else Color.Transparent + OudsListItemState.Pressed -> if (backgroundDecoration) pressed else Color.Transparent + } +} + +@Composable +private fun Modifier.border(state: OudsListItemState, decoration: OudsListItemDecoration, cornerRadius: Dp, outlineColor: Color): Modifier { + val outlined = decoration is OudsListItemDecoration.Outlined || (decoration is OudsListItemDecoration.OutlinedOnInteraction && state in listOf( + OudsListItemState.Hovered, + OudsListItemState.Pressed, + OudsListItemState.Focused + )) + val width = OudsTheme.borders.width.default.takeUnlessHairline + + return when { + width != null && outlined -> border(width = width, color = outlineColor, shape = shape(cornerRadius = cornerRadius)) + width != null && decoration.divider -> bottomBorder(width = width, color = OudsTheme.colorScheme.border.muted, cornerRadius = cornerRadius) + else -> this + } +} + +@Composable +private fun borderRadius(card: Boolean, focused: Boolean) = with(OudsTheme.components.listItem) { + when { + card && LocalThemeSettings.current.roundedCornerCardItems == true -> border.radius.rounded + card || focused -> border.radius.default + else -> 0.dp + } +} + +@Composable +private fun shape(cornerRadius: Dp) = RoundedCornerShape(cornerRadius) + +@Composable +private fun outlineBorderColor(state: OudsListItemState) = with(OudsTheme.colorScheme.action) { + when (state) { + OudsListItemState.Enabled -> OudsTheme.colorScheme.border.default + OudsListItemState.Focused -> focus + OudsListItemState.Hovered -> hover + OudsListItemState.Pressed -> pressed + OudsListItemState.Disabled -> disabled + } +} + +@Composable +private fun contentColor(state: OudsListItemState, muted: Boolean = false) = + when { + state == OudsListItemState.Disabled -> OudsTheme.colorScheme.content.disabled + muted -> OudsTheme.colorScheme.content.muted + else -> OudsTheme.colorScheme.content.default + } + +@Composable +private fun actionColor(state: OudsListItemState, tint: Color? = null) = when { + state == OudsListItemState.Disabled -> OudsTheme.colorScheme.action.disabled + tint != null -> tint + else -> OudsTheme.colorScheme.content.default +} + +@Composable +private fun indicatorColor(state: OudsListItemState) = with(OudsTheme.colorScheme.action) { + when (state) { + OudsListItemState.Enabled -> OudsTheme.components.link.color.chevron.enabled + OudsListItemState.Focused -> focus + OudsListItemState.Hovered -> hover + OudsListItemState.Pressed -> pressed + OudsListItemState.Disabled -> disabled + } +} + +@Composable +private fun minHeight(size: OudsListItemSize) = with(OudsTheme.components.listItem) { + when (size) { + OudsListItemSize.Default -> this.size.minHeightDefault + OudsListItemSize.Small -> this.size.minHeightSmall + } +} + +@Composable +private fun verticalAlignment(verticalAlignment: OudsListItemVerticalAlignment) = when (verticalAlignment) { + OudsListItemVerticalAlignment.CenterVertically -> Alignment.CenterVertically + OudsListItemVerticalAlignment.Top -> Alignment.Top +} + +@Composable +private fun topTextContainerPadding(verticalAlignment: OudsListItemVerticalAlignment, size: OudsListItemSize) = + with(OudsTheme.components.listItem.space.paddingBlock.topAlignment) { + when (verticalAlignment) { + OudsListItemVerticalAlignment.Top -> when (size) { + OudsListItemSize.Default -> topTextContainerDefault + OudsListItemSize.Small -> topTextContainerSmall + } + OudsListItemVerticalAlignment.CenterVertically -> 0.dp + } + } + +internal fun listItemDecoration(background: Boolean, divider: Boolean): OudsListItemDecoration { + return if (background) OudsListItemDecoration.Background(divider) else OudsListItemDecoration.BackgroundOnInteraction(divider) +} + +/** + * Default values for [OudsListItem]. + */ +object OudsListItemDefaults { + + /** + * Default vertical alignment of an [OudsListItem]. + */ + val VerticalAlignment = OudsListItemVerticalAlignment.CenterVertically + + /** + * Default navigation indicator of an [OudsListItem]. + */ + val Indicator = OudsListItemIndicator.Next + + /** + * Default size of an [OudsListItem] icon. + */ + val IconSize = OudsListItemIconSize.Medium + + /** + * Default size of an [OudsListItem] image. + */ + val ImageSize = OudsListItemImageSize.Medium + + /** + * Default ratio of an [OudsListItem] image. + */ + val ImageRatio = OudsListItemImageRatio.Square + + /** + * Default content scale of an [OudsListItem] image. + */ + val ImageContentScale = ContentScale.Fit +} + +/** + * Represents the size of an [OudsListItem]. + */ +internal enum class OudsListItemSize { + /** + * Default size. + */ + Default, + + /** + * Small size. + */ + Small +} + +/** + * Represents the vertical alignment of an [OudsListItem] content. + */ +enum class OudsListItemVerticalAlignment { + /** + * Elements are vertically centered. + */ + CenterVertically, + + /** + * Elements are aligned to the top. + */ + Top +} + +/** + * Represents the navigation indicator of an [OudsListItem]. + */ +sealed interface OudsListItemIndicator { + + @get:Composable + val drawableId: Int + + /** + * Used in a standard navigation context. This indicator is positioned at the end of the list item and is not customizable. + */ + object Next : OudsListItemIndicator { + override val drawableId + @Composable + get() = OudsTheme.drawableResources.component.controlItem.next + } + + /** + * Used for "backward" navigation. This indicator is positioned at the start of the list item and is not customizable. + */ + object Previous : OudsListItemIndicator { + override val drawableId + @Composable + get() = OudsTheme.drawableResources.component.controlItem.previous + } + + /** + * Used for "external" navigation (outside the current context). This indicator is positioned at the end of the list item and is not customizable. + */ + object External : OudsListItemIndicator { + override val drawableId + @Composable + get() = OudsTheme.drawableResources.functional.actions.externalLink + } +} + +/** + * Represents the decoration applied to an [OudsCardItem] or an [OudsSmallCardItem]. + * Decorations allow customizing the visual appearance of card items, such as adding a background, an outline, or a divider. + */ +sealed class OudsListItemDecoration(val divider: Boolean) { + /** + * An outline is displayed around the card item. Use when the item needs clearer visual separation from a surface with a similar background. + */ + object Outlined : OudsListItemDecoration(false) + + /** + * An outline is displayed around the card item only on interaction states (hovered, pressed, focused). + */ + object OutlinedOnInteraction : OudsListItemDecoration(false) + + /** + * A background is applied to the card. + * Use it when the card item needs stronger visual separation from its surrounding context or represents a distinct destination within a card-based layout. + * + * @property divider Controls the display of a divider at the bottom of the item. Set it to `true` when several items are vertically grouped within the same + * shared surface and additional visual separation improves scanning. Avoid using a divider when each item already has a clearly separated background. + */ + class Background(divider: Boolean) : OudsListItemDecoration(divider) + + /** + * A background is applied to the card item only on interaction states (hovered, pressed, focused). + * + * @property divider Controls the display of a divider at the bottom of the item. Set it to `true` when several items are vertically grouped within the same + * shared surface and additional visual separation improves scanning. Avoid using a divider when each item already has a clearly separated background. + */ + class BackgroundOnInteraction(divider: Boolean) : OudsListItemDecoration(divider) +} + +internal enum class OudsListItemState { + Enabled, Hovered, Pressed, Disabled, Focused +} + +sealed interface OudsListItemLeadingTrailing : OudsPolymorphicComponentContent { + + interface Icon : OudsListItemLeadingTrailing { + @ConsistentCopyVisibility + data class ExtraParameters internal constructor(internal val state: OudsListItemState) : OudsComponentContent.ExtraParameters() + } + + interface Image : OudsListItemLeadingTrailing { + val ratio: OudsListItemImageRatio + } + + interface Text : OudsListItemLeadingTrailing { + @ConsistentCopyVisibility + data class ExtraParameters internal constructor(internal val verticalAlignment: OudsListItemVerticalAlignment, internal val size: OudsListItemSize) : + OudsComponentContent.ExtraParameters() + } +} + +internal enum class OudsListItemAssetSize { + Small, Medium, Large, ExtraLarge; + + val value: Dp + @Composable + get() = with(OudsTheme.components.listItem) { + when (this@OudsListItemAssetSize) { + Small -> size.asset.small + Medium -> size.asset.medium + Large -> size.asset.large + ExtraLarge -> size.asset.extraLarge + } + } +} + +/** + * Represents the size of an [OudsListItemIcon]. + */ +enum class OudsListItemIconSize { + + /** + * Use for standard and compact list items. This is the preferred size when the icon provides secondary visual support. + */ + Medium, + + /** + * Use when the icon needs stronger prominence or when the item has a larger height, multiline content or additional supporting information. + */ + Large; + + internal fun toAssetSize() = when (this) { + Medium -> OudsListItemAssetSize.Medium + Large -> OudsListItemAssetSize.Large + } +} + +internal enum class OudsListItemIconStatus( + val painterProvider: @Composable () -> Painter, + val contentDescriptionProvider: (@Composable () -> String) = { "" } +) { + Negative( + { painterResource(OudsTheme.drawableResources.component.alert.importantFill) }, + { stringResource(R.string.core_common_error_a11y) } + ), + + Positive({ painterResource(OudsTheme.drawableResources.component.alert.tickConfirmationFill) }), + + Info({ painterResource(OudsTheme.drawableResources.component.alert.infoFill) }), + + Warning( + { + val iconTokens = OudsTheme.components.icon + LayeredTintedPainter( + backPainter = painterResource(id = OudsTheme.drawableResources.component.alert.warningExternalShape), + backPainterColor = iconTokens.color.content.status.warning.externalShape, + frontPainter = painterResource(id = OudsTheme.drawableResources.component.alert.warningInternalShape), + frontPainterColor = iconTokens.color.content.status.warning.internalShape + ) + }, + { stringResource(R.string.core_common_warning_a11y) } + ); + + val tint + @Composable + get() = with(OudsTheme.colorScheme.content) { + when (this@OudsListItemIconStatus) { + Positive -> status.positive + Warning -> Color.Unspecified + Negative -> status.negative + Info -> status.info + } + } +} + +/** + * Defines the aspect ratio of the image container. + */ +enum class OudsListItemImageRatio { + /** + * Use for square visual content such as products, logos, album covers or profile-related imagery. + */ + Square, + + /** + * Use for landscape content such as editorial images or wide media thumbnails. + */ + Widescreen; + + internal val value: Float + get() = when (this) { + Square -> 1f + Widescreen -> 16f / 9f + } +} + +/** + * Controls the dimensions and visual prominence of an [OudsListItemImage]. + */ +enum class OudsListItemImageSize { + /** + * Use in compact or information-dense lists where the image remains secondary to the text. + */ + Medium, + + /** + * Use in standard content lists where visual identification is important. + */ + Large, + + /** + * Use when the image is a significant part of the content, such as a product or media preview. + */ + ExtraLarge; + + internal fun toAssetSize() = when (this) { + Medium -> OudsListItemAssetSize.Medium + Large -> OudsListItemAssetSize.Large + ExtraLarge -> OudsListItemAssetSize.ExtraLarge + } +} + +/** + * Represents the text style of a text in an [OudsListItem]. + */ +enum class OudsListItemTextStyle { + + /** + * Use [Label] for standard secondary information that should remain clearly readable without drawing more attention than the primary label. + */ + Label, + + /** + * Use [LabelMuted] for low-priority metadata that supports the item but is not essential to its immediate understanding. + */ + LabelMuted, + + /** + * Use [LabelStrong] when the trailing value requires additional visual emphasis, for example when users need to compare important values across + * a navigation list. + */ + LabelStrong +} + +open class OudsListItemIcon internal constructor( + graphicsObjectProvider: @Composable (OudsListItemIcon) -> Any, + contentDescriptionProvider: @Composable (OudsListItemIcon) -> String, + override val tinted: Boolean, + internal val size: OudsListItemAssetSize, + internal val status: OudsListItemIconStatus? +) : OudsComponentIcon( + OudsListItemLeadingTrailing.Icon.ExtraParameters::class.java, + graphicsObjectProvider, + contentDescriptionProvider +), OudsListItemLeadingTrailing.Icon { + + override val tint: Color? + @Composable + get() = actionColor( + state = extraParameters.state, + tint = status?.tint + ) + + @Composable + override fun Content(modifier: Modifier) { + super.Content(modifier.size(size.value)) + } +} + +open class OudsListItemImage internal constructor( + graphicsObject: Any, + contentDescription: String, + internal val size: OudsListItemAssetSize, + override val ratio: OudsListItemImageRatio, + contentScale: ContentScale, + internal val roundedCorner: Boolean +) : OudsComponentImage(Nothing::class.java, graphicsObject, contentDescription, contentScale = contentScale), OudsListItemLeadingTrailing.Image { + + @Composable + override fun Content(modifier: Modifier) { + val cornerRadius = with(OudsTheme.components.listItem.border.radius) { if (roundedCorner) mediaRounded else media } + super.Content( + modifier = modifier + .height(size.value) + .width(size.value * ratio.value) + .clip(RoundedCornerShape(cornerRadius)) + ) + } +} + +open class OudsListItemText internal constructor( + private val label: String, + private val style: OudsListItemTextStyle, + private val extraLabel: String? +) : OudsComponentContent(OudsListItemLeadingTrailing.Text.ExtraParameters::class.java), + OudsListItemLeadingTrailing.Text { + + @Composable + override fun Content(modifier: Modifier) { + Column(modifier = modifier) { + Text( + modifier = modifier.padding( + top = topTextContainerPadding(verticalAlignment = extraParameters.verticalAlignment, size = extraParameters.size) + ), + text = label, + style = when (style) { + OudsListItemTextStyle.Label, OudsListItemTextStyle.LabelMuted -> OudsTheme.typography.label.large.default + OudsListItemTextStyle.LabelStrong -> OudsTheme.typography.label.large.strong + }, + color = if (style == OudsListItemTextStyle.LabelMuted) OudsTheme.colorScheme.content.muted else OudsTheme.colorScheme.content.default + ) + extraLabel?.let { + Text( + text = extraLabel, + style = OudsTheme.typography.label.medium.strong, + color = OudsTheme.colorScheme.content.default + ) + } + } + } +} + +/** + * A leading content of an [OudsListItem]. + */ +sealed interface OudsListItemLeading : OudsListItemLeadingTrailing { + + /** + * An icon as a list item leading content. + */ + open class Icon internal constructor( + graphicsObjectProvider: @Composable (OudsListItemIcon) -> Any, + contentDescriptionProvider: @Composable (OudsListItemIcon) -> String, + override val tinted: Boolean, + size: OudsListItemIconSize, + status: OudsListItemIconStatus? + ) : OudsListItemIcon(graphicsObjectProvider, contentDescriptionProvider, tinted, size.toAssetSize(), status), OudsListItemLeading { + + /** + * Creates an instance of [OudsListItemLeading.Icon]. + * + * @param painter Painter of the icon. + * @param contentDescription The content description associated with this [OudsListItemLeading.Icon]. + * @param size Size of the icon among [OudsListItemIconSize] values. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + painter: Painter, + contentDescription: String, + size: OudsListItemIconSize = OudsListItemDefaults.IconSize, + tinted: Boolean = true + ) : this({ painter as Any }, { contentDescription }, tinted, size, null) + + /** + * Creates an instance of [OudsListItemLeading.Icon]. + * + * @param imageVector Image vector of the icon. + * @param contentDescription The content description associated with this [OudsListItemLeading.Icon]. + * @param size Size of the icon among [OudsListItemIconSize] values. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + size: OudsListItemIconSize = OudsListItemDefaults.IconSize, + tinted: Boolean = true + ) : this({ imageVector as Any }, { contentDescription }, tinted, size, null) + + /** + * Creates an instance of [OudsListItemLeading.Icon]. + * Use an icon to reinforce the meaning of the destination or help users identify a familiar category, object or service. + * + * @param bitmap Image bitmap of the icon. + * @param contentDescription The content description associated with this [OudsListItemLeading.Icon]. + * @param size Size of the icon among [OudsListItemIconSize] values. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + size: OudsListItemIconSize = OudsListItemDefaults.IconSize, + tinted: Boolean = true + ) : this({ bitmap as Any }, { contentDescription }, tinted, size, null) + + private constructor(size: OudsListItemIconSize, status: OudsListItemIconStatus) : this( + { status.painterProvider() }, + { status.contentDescriptionProvider() }, + true, + size, + status + ) + + /** + * Creates an instance of [OudsListItemLeading.Icon] representing an info status. + * Use for neutral information that requires additional attention. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Info(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Info) + + /** + * Creates an instance of [OudsListItemLeading.Icon] representing a negative status. + * Use for errors, failures, destructive outcomes or critical problems. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Negative(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Negative) + + /** + * Creates an instance of [OudsListItemLeading.Icon] representing a positive status. + * Use for successful, completed or beneficial states. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Positive(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Positive) + + /** + * Creates an instance of [OudsListItemLeading.Icon] representing a warning status. + * Use for situations that may require caution or user awareness. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Warning(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Warning) + } + + /** + * An image as a list item leading content. + */ + class Image internal constructor( + graphicsObject: Any, + contentDescription: String, + size: OudsListItemAssetSize, + ratio: OudsListItemImageRatio, + contentScale: ContentScale, + roundedCorner: Boolean + ) : OudsListItemImage(graphicsObject, contentDescription, size, ratio, contentScale, roundedCorner), OudsListItemLeading { + + /** + * Creates an instance of [OudsListItemLeading.Image]. + * + * @param painter Painter of the image. + * @param contentDescription The content description associated with this image. + * @param size Size of the image among [OudsListItemImageSize] values. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [painter]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + painter: Painter, + contentDescription: String, + size: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(painter, contentDescription, size.toAssetSize(), ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsListItemLeading.Image]. + * + * @param imageVector Image vector of the image. + * @param contentDescription The content description associated with this image. + * @param size Size of the image among [OudsListItemImageSize] values. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [imageVector]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + size: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(imageVector, contentDescription, size.toAssetSize(), ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsListItemLeading.Image]. + * + * @param bitmap Image bitmap of the image. + * @param contentDescription The content description associated with this image. + * @param size Size of the image among [OudsListItemImageSize] values. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [bitmap]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + size: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(bitmap, contentDescription, size.toAssetSize(), ratio, contentScale, roundedCorner) + } +} + +/** + * A trailing content of an [OudsListItem]. + */ +sealed interface OudsListItemTrailing : OudsListItemLeadingTrailing { + + /** + * An icon as a list item trailing content. + */ + open class Icon internal constructor( + graphicsObjectProvider: @Composable (OudsListItemIcon) -> Any, + contentDescriptionProvider: @Composable (OudsListItemIcon) -> String, + override val tinted: Boolean, + size: OudsListItemIconSize, + status: OudsListItemIconStatus? + ) : OudsListItemIcon(graphicsObjectProvider, contentDescriptionProvider, tinted, size.toAssetSize(), status), OudsListItemTrailing { + + /** + * Creates an instance of [OudsListItemTrailing.Icon]. + * + * @param painter Painter of the icon. + * @param contentDescription The content description associated with this [OudsListItemTrailing.Icon]. + * @param size Size of the icon among [OudsListItemIconSize] values. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + painter: Painter, + contentDescription: String, + size: OudsListItemIconSize = OudsListItemDefaults.IconSize, + tinted: Boolean = true + ) : this({ painter as Any }, { contentDescription }, tinted, size, null) + + /** + * Creates an instance of [OudsListItemTrailing.Icon]. + * + * @param imageVector Image vector of the icon. + * @param contentDescription The content description associated with this [OudsListItemTrailing.Icon]. + * @param size Size of the icon among [OudsListItemIconSize] values. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + size: OudsListItemIconSize = OudsListItemDefaults.IconSize, + tinted: Boolean = true + ) : this({ imageVector as Any }, { contentDescription }, tinted, size, null) + + /** + * Creates an instance of [OudsListItemTrailing.Icon]. + * + * @param bitmap Image bitmap of the icon. + * @param contentDescription The content description associated with this [OudsListItemTrailing.Icon]. + * @param size Size of the icon among [OudsListItemIconSize] values. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + size: OudsListItemIconSize = OudsListItemDefaults.IconSize, + tinted: Boolean = true + ) : this({ bitmap as Any }, { contentDescription }, tinted, size, null) + + private constructor(size: OudsListItemIconSize, status: OudsListItemIconStatus) : this( + { status.painterProvider() }, + { status.contentDescriptionProvider() }, + true, + size, + status + ) + + /** + * Creates an instance of [OudsListItemTrailing.Icon] representing an info status. + * Use for neutral information that requires additional attention. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Info(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Info) + + /** + * Creates an instance of [OudsListItemTrailing.Icon] representing a negative status. + * Use for errors, failures, destructive outcomes or critical problems. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Negative(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Negative) + + /** + * Creates an instance of [OudsListItemTrailing.Icon] representing a positive status. + * Use for successful, completed or beneficial states. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Positive(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Positive) + + /** + * Creates an instance of [OudsListItemTrailing.Icon] representing a warning status. + * Use for situations that may require caution or user awareness. + * + * @param size Size of the icon among [OudsListItemIconSize] values. + */ + class Warning(size: OudsListItemIconSize = OudsListItemDefaults.IconSize) : Icon(size, OudsListItemIconStatus.Warning) + } + + /** + * An image as a list item trailing content. + */ + class Image internal constructor( + graphicsObject: Any, + contentDescription: String, + size: OudsListItemAssetSize, + ratio: OudsListItemImageRatio, + contentScale: ContentScale, + roundedCorner: Boolean + ) : OudsListItemImage(graphicsObject, contentDescription, size, ratio, contentScale, roundedCorner), OudsListItemTrailing { + + /** + * Creates an instance of [OudsListItemTrailing.Image]. + * + * @param painter Painter of the image. + * @param contentDescription The content description associated with this image. + * @param size Size of the image among [OudsListItemImageSize] values. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [painter]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + painter: Painter, + contentDescription: String, + size: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(painter, contentDescription, size.toAssetSize(), ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsListItemTrailing.Image]. + * + * @param imageVector Image vector of the image. + * @param contentDescription The content description associated with this image. + * @param size Size of the image among [OudsListItemImageSize] values. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [imageVector]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + size: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(imageVector, contentDescription, size.toAssetSize(), ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsListItemTrailing.Image]. + * + * @param bitmap Image bitmap of the image. + * @param contentDescription The content description associated with this image. + * @param size Size of the image among [OudsListItemImageSize] values. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [bitmap]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + size: OudsListItemImageSize = OudsListItemDefaults.ImageSize, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(bitmap, contentDescription, size.toAssetSize(), ratio, contentScale, roundedCorner) + } + + /** + * Text as a list item trailing content. + */ + class Text private constructor( + label: String, + style: OudsListItemTextStyle, + extraLabel: String? + ) : OudsListItemText(label, style, extraLabel), OudsListItemTrailing { + + /** + * Creates an instance of [OudsListItemTrailing.Text]. + * Use it to display a short value or secondary piece of information associated with the navigation destination. + * + * @param label Label displayed in trailing. + * @param style Style applied to the label among [OudsListItemTextStyle] values. + */ + constructor(label: String, style: OudsListItemTextStyle = OudsListItemTextStyle.Label) : this(label, style, null) + + /** + * Creates an instance of [OudsListItemTrailing.Text] with an extra label. + * Use it when a value requires a short qualifier, unit or supporting label. + * Note that when an [extraLabel] is provided, the [label] retains the [OudsListItemTextStyle.Label] style. + * + * @param label Label displayed in trailing. + * @param extraLabel Label displayed below the main label. + */ + constructor(label: String, extraLabel: String) : this(label, OudsListItemTextStyle.Label, extraLabel) + } +} + +@OudsPreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsStaticListItem(@PreviewParameter(OudsListItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsStaticListItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsStaticListItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsListItem( + label = label, + overline = overline, + extraLabel = extraLabel, + description = description, + helperText = helperText, + verticalAlignment = verticalAlignment, + leading = leading, + trailing = trailing, + divider = decoration.divider, + background = decoration is OudsListItemDecoration.Background, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = false + ) + } +} + +@Preview(name = "Light", heightDp = OudsPreviewableComponent.ListItem.Navigation.PreviewHeightDp, device = OudsPreviewDevice) +@Preview( + name = "Dark", + uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, + heightDp = OudsPreviewableComponent.ListItem.Navigation.PreviewHeightDp, + device = OudsPreviewDevice +) +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationListItem(@PreviewParameter(OudsListItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsNavigationListItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsNavigationListItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsListItem( + onClick = {}, + indicator = indicator, + label = label, + overline = overline, + extraLabel = extraLabel, + description = description, + helperText = helperText, + verticalAlignment = verticalAlignment, + leading = leading, + trailing = trailing, + divider = decoration.divider, + background = decoration is OudsListItemDecoration.Background, + enabled = enabled, + edgeToEdge = false + ) + } + } +} + +@OudsPreview +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationListItemWithUntintedIcon() = PreviewOudsNavigationListItemWithUntintedIcon(getPreviewTheme()) + +@Composable +internal fun PreviewOudsNavigationListItemWithUntintedIcon(theme: OudsThemeContract) = OudsPreview(theme = theme) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsListItem( + onClick = {}, + label = "Label", + description = "Description", + leading = OudsListItemLeading.Icon( + painter = rememberRainbowHeartPainter(), + contentDescription = "", + tinted = false + ), + background = true, + edgeToEdge = false + ) + } +} + +internal data class OudsListItemPreviewParameter( + val label: String, + val indicator: OudsListItemIndicator = OudsListItemDefaults.Indicator, + val verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + val overline: String? = null, + val extraLabel: String? = null, + val description: String? = null, + val leading: T? = null, + val trailing: S? = null, + val decoration: OudsListItemDecoration = OudsListItemDecoration.BackgroundOnInteraction(divider = true), + val helperText: String? = null, + val boldLabel: Boolean = false, + val enabled: Boolean = true +) + +internal class OudsListItemPreviewParameterProvider : OudsBasicListItemPreviewParameterProvider( + leading = listItemPreviewParameterLeading, + trailing = listItemPreviewParameterTrailing +) + +internal val listItemPreviewParameterLeading: (Int) -> OudsListItemLeading? = { index -> + when (index) { + 0 -> OudsListItemLeading.Icon.Info() + 1 -> OudsListItemLeading.Icon(Icons.Outlined.FavoriteBorder, "") + 2 -> OudsListItemLeading.Image(CheckerboardPainter, "", OudsListItemImageSize.Medium, OudsListItemImageRatio.Square, roundedCorner = true) + else -> null + } +} + +internal val listItemPreviewParameterTrailing: (Int) -> OudsListItemTrailing? = { index -> + when (index) { + 0 -> OudsListItemTrailing.Icon(Icons.Outlined.FavoriteBorder, "") + 1 -> OudsListItemTrailing.Text(label = "Label", extraLabel = "Extra label") + 2 -> OudsListItemTrailing.Image(CheckerboardPainter, "", OudsListItemImageSize.ExtraLarge, OudsListItemImageRatio.Widescreen) + else -> null + } +} + +internal open class OudsBasicListItemPreviewParameterProvider( + leading: (Int) -> T?, + trailing: (Int) -> S?, + decoration: (Int) -> OudsListItemDecoration = { index -> + if (index == 1) OudsListItemDecoration.Background(divider = true) else OudsListItemDecoration.BackgroundOnInteraction(divider = true) + } +) : BasicPreviewParameterProvider>(*getListItemPreviewParameterValues(leading, trailing, decoration).toTypedArray()) + +private fun getListItemPreviewParameterValues( + leading: (Int) -> T?, + trailing: (Int) -> S?, + decoration: (Int) -> OudsListItemDecoration +): List> where T : OudsListItemLeadingTrailing, S : OudsListItemLeadingTrailing { + val label = "Label" + val overline = "Overline" + val extraLabel = "Extra label" + val description = "Description" + val helperText = "Helper text" + + return List(3) { index -> + when (index) { + 0 -> OudsListItemPreviewParameter( + label = label, + overline = overline, + extraLabel = extraLabel, + description = description, + helperText = helperText, + leading = leading(index), + trailing = trailing(index), + verticalAlignment = OudsListItemVerticalAlignment.Top, + decoration = decoration(index) + ) + 1 -> OudsListItemPreviewParameter( + label = label, + indicator = OudsListItemIndicator.External, + leading = leading(index), + trailing = trailing(index), + decoration = decoration(index), + boldLabel = true + ) + else -> OudsListItemPreviewParameter( + label = label, + indicator = OudsListItemIndicator.Previous, + overline = overline, + extraLabel = extraLabel, + description = description, + leading = leading(index), + trailing = trailing(index), + decoration = decoration(index) + ) + } + } +} diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsSmallCardItem.kt b/core/src/main/java/com/orange/ouds/core/component/OudsSmallCardItem.kt new file mode 100644 index 0000000000..5addeba3d8 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/OudsSmallCardItem.kt @@ -0,0 +1,284 @@ +/* + * 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 android.content.res.Configuration.UI_MODE_NIGHT_YES +import android.content.res.Configuration.UI_MODE_TYPE_NORMAL +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.OudsPreviewDevice +import com.orange.ouds.core.utilities.OudsPreviewLightDark +import com.orange.ouds.core.utilities.OudsPreviewableComponent +import com.orange.ouds.core.utilities.PreviewEnumEntries +import com.orange.ouds.core.utilities.PreviewPaddingDefault +import com.orange.ouds.core.utilities.getPreviewTheme +import com.orange.ouds.core.utilities.mapSettings +import com.orange.ouds.foundation.ExperimentalOudsApi +import com.orange.ouds.theme.OudsThemeContract + +/** + * TODO update description when available and add version and guideline link + * + * Static small card item displays non-clickable information in a compact card format. + * + * A static small card item combines the compact size of a small list item with the visual + * emphasis of a card. It is ideal for displaying condensed, grouped content in a contained + * format, such as compact feature cards, quick access tiles, or dense information grids. + * Unlike the standard card item, it omits overline and extra label to maintain a smaller footprint. + * + * @param label The main label of the small card item. + * @param modifier [Modifier] applied to the layout of the small card item. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param decoration The decoration style of the card. Defaults to [OudsListItemDecoration.Background] (with divider). + * @param description Optional text displayed below the [label]. + * @param leading Optional leading content such as an icon or image displayed at the start of the small card item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the small card item. + * @param helperText Optional helper text displayed below the small card item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the small card item. When `false`, the content is displayed in a disabled state. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this small card item. + * + * @sample com.orange.ouds.core.component.samples.OudsStaticSmallCardItemSample + * @sample com.orange.ouds.core.component.samples.OudsSmallCardItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsSmallCardItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsSmallCardItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsSmallCardItem( + label: String, + modifier: Modifier = Modifier, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + decoration: OudsListItemDecoration = OudsCardItemDefaults.Decoration, + description: String? = null, + leading: OudsSmallListItemLeading? = null, + trailing: OudsSmallListItemTrailing? = null, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Small, + label = label, + onClick = null, + modifier = modifier, + indicator = null, + verticalAlignment = verticalAlignment, + overline = null, + extraLabel = null, + description = description, + leading = leading, + trailing = trailing, + decoration = decoration, + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = false, + card = true, + interactionSource = interactionSource + ) +} + +/** + * TODO update description when available and add version and guideline link + * + * Navigation small card item allows users to navigate to another screen or perform an action in a compact card format. + * + * A navigation small card item combines the compact size of a small list item with the visual + * emphasis of a card, while remaining interactive. It is ideal for compact, navigable feature cards, + * quick action tiles, or dense interactive grids. The indicator type can be customized to show + * forward navigation, backward navigation, or external links. Unlike the standard card item, + * it omits overline and extra label to maintain a smaller footprint while remaining clickable. + * + * @param label The main label of the small card item. + * @param modifier [Modifier] applied to the layout of the small card item. + * @param onClick Callback invoked when the small card item is clicked. + * @param indicator The navigation indicator to display. Defaults to [OudsListItemIndicator.Next]. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param decoration The decoration style of the card. Defaults to [OudsListItemDecoration.Background] (with divider). + * @param description Optional text displayed below the [label]. + * @param leading Optional leading content such as an icon or image displayed at the start of the small card item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the small card item. + * @param helperText Optional helper text displayed below the small card item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the small card item. When `false`, the item is not clickable and content is displayed in a disabled state. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this small card item. + * + * @sample com.orange.ouds.core.component.samples.OudsNavigationSmallCardItemSample + * @sample com.orange.ouds.core.component.samples.OudsSmallCardItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsSmallCardItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsSmallCardItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsSmallCardItem( + label: String, + modifier: Modifier = Modifier, + onClick: () -> Unit, + indicator: OudsListItemIndicator = OudsListItemDefaults.Indicator, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + decoration: OudsListItemDecoration = OudsCardItemDefaults.Decoration, + description: String? = null, + leading: OudsSmallListItemLeading? = null, + trailing: OudsSmallListItemTrailing? = null, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Small, + label = label, + onClick = onClick, + modifier = modifier, + indicator = indicator, + verticalAlignment = verticalAlignment, + overline = null, + extraLabel = null, + description = description, + leading = leading, + trailing = trailing, + decoration = decoration, + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = false, + card = true, + interactionSource = interactionSource + ) +} + +@OudsPreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsStaticSmallCardItem(@PreviewParameter(OudsSmallCardItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsStaticSmallCardItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsStaticSmallCardItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsSmallCardItem( + label = label, + decoration = decoration, + description = description, + helperText = helperText, + leading = leading, + trailing = trailing, + enabled = enabled + ) + } +} + +@OudsPreview +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsStaticSmallCardItemWithRoundedCorners(@PreviewParameter(OudsCardItemWithRoundedCornersParameterProvider::class) decoration: OudsListItemDecoration) { + PreviewOudsStaticSmallCardItemWithRoundedCorners(theme = getPreviewTheme(), decoration = decoration) +} + +@Composable +internal fun PreviewOudsStaticSmallCardItemWithRoundedCorners( + theme: OudsThemeContract, + decoration: OudsListItemDecoration +) = OudsPreview(theme = theme.mapSettings { it.copy(roundedCornerCardItems = true) }) { + OudsSmallCardItem( + modifier = Modifier.padding(PreviewPaddingDefault), + label = "Label", + decoration = decoration, + description = "Description", + helperText = "Helper text", + ) +} + +@Preview(name = "Light", heightDp = OudsPreviewableComponent.SmallCardItem.Navigation.PreviewHeightDp, device = OudsPreviewDevice) +@Preview( + name = "Dark", + uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, + heightDp = OudsPreviewableComponent.SmallCardItem.Navigation.PreviewHeightDp, + device = OudsPreviewDevice +) +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationSmallCardItem(@PreviewParameter(OudsSmallCardItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsNavigationSmallCardItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsNavigationSmallCardItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsSmallCardItem( + onClick = {}, + decoration = decoration, + indicator = indicator, + label = label, + description = description, + helperText = helperText, + verticalAlignment = verticalAlignment, + leading = leading, + trailing = trailing, + boldLabel = boldLabel, + enabled = enabled + ) + } + } +} + +@Preview(name = "Light", heightDp = OudsPreviewableComponent.SmallCardItem.Navigation.PreviewHeightDp, device = OudsPreviewDevice) +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationSmallCardItemWithRoundedCorners(@PreviewParameter(OudsCardItemWithRoundedCornersParameterProvider::class) decoration: OudsListItemDecoration) { + PreviewOudsNavigationSmallCardItemWithRoundedCorners(theme = getPreviewTheme(), decoration = decoration) +} + +@Composable +internal fun PreviewOudsNavigationSmallCardItemWithRoundedCorners(theme: OudsThemeContract, decoration: OudsListItemDecoration) = + OudsPreview(theme = theme.mapSettings { it.copy(roundedCornerCardItems = true) }) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsSmallCardItem( + onClick = {}, + label = "Label", + decoration = decoration, + description = "Description", + helperText = "Helper text", + ) + } + } + +internal class OudsSmallCardItemPreviewParameterProvider : OudsBasicListItemPreviewParameterProvider( + leading = smallListItemPreviewParameterLeading, + trailing = smallListItemPreviewParameterTrailing, + decoration = { index -> + when (index) { + 0 -> OudsListItemDecoration.Outlined + 1 -> OudsCardItemDefaults.Decoration + else -> OudsListItemDecoration.BackgroundOnInteraction(divider = false) + } + } +) diff --git a/core/src/main/java/com/orange/ouds/core/component/OudsSmallListItem.kt b/core/src/main/java/com/orange/ouds/core/component/OudsSmallListItem.kt new file mode 100644 index 0000000000..09bdeaed76 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/OudsSmallListItem.kt @@ -0,0 +1,588 @@ +/* + * 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 android.content.res.Configuration.UI_MODE_NIGHT_YES +import android.content.res.Configuration.UI_MODE_TYPE_NORMAL +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +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.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter +import com.orange.ouds.core.utilities.CheckerboardPainter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.OudsPreviewDevice +import com.orange.ouds.core.utilities.OudsPreviewLightDark +import com.orange.ouds.core.utilities.OudsPreviewableComponent +import com.orange.ouds.core.utilities.PreviewEnumEntries +import com.orange.ouds.core.utilities.getPreviewTheme +import com.orange.ouds.foundation.ExperimentalOudsApi +import com.orange.ouds.theme.OudsThemeContract + +/** + * TODO update description when available and add version and guideline link + * + * Static small list item displays non-clickable information in a compact format. + * + * A static small list item provides a condensed way to present read-only information. + * It is ideal for compact lists, quick settings displays, or dense information layouts. + * Unlike the standard list item, it omits overline and extra label to maintain a smaller footprint. + * These items are designed to be stacked within a list, with no spacing between the elements. + * + * @see [OudsSmallCardItem] If you need spaced items displayed in a card format (with background or outlined). + * + * @param label The main label of the small list item. + * @param modifier [Modifier] applied to the layout of the small list item. + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemVerticalAlignment.CenterVertically]. + * @param description Optional text displayed below the [label]. + * @param leading Optional leading content such as an icon or image displayed at the start of the small list item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the small list item. + * @param divider Controls the display of a divider at the bottom of the small list item. Defaults to `true`. + * @param background Controls whether the small list item has a background color. Defaults to `true`. + * @param helperText Optional helper text displayed below the small list item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the small list item. When `false`, the content is displayed in a disabled state. Defaults to `true`. + * @param edgeToEdge Controls the horizontal layout of the item. When `true`, the item is designed to span the full width of the screen or container. When `false`, + * it is adapted for use within constrained layouts or containers with their own padding. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this small list item. + * + * @sample com.orange.ouds.core.component.samples.OudsStaticSmallListItemSample + * @sample com.orange.ouds.core.component.samples.OudsSmallListItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsSmallListItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsSmallListItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsSmallListItem( + label: String, + modifier: Modifier = Modifier, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + description: String? = null, + leading: OudsSmallListItemLeading? = null, + trailing: OudsSmallListItemTrailing? = null, + divider: Boolean = true, + background: Boolean = true, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + edgeToEdge: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Small, + label = label, + onClick = null, + modifier = modifier, + indicator = null, + verticalAlignment = verticalAlignment, + overline = null, + extraLabel = null, + description = description, + leading = leading, + trailing = trailing, + decoration = listItemDecoration(background, divider), + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = edgeToEdge, + card = false, + interactionSource = interactionSource + ) +} + +/** + * TODO update description when available and add version and guideline link + * + * Navigation small list item allows users to navigate to another screen or perform an action in a compact format. + * + * A navigation small list item is clickable and provides a condensed way to navigate. + * It is ideal for compact menus, quick settings with actions, or dense navigation lists. + * The indicator type can be customized to show forward navigation, backward navigation, or + * external links. Unlike the standard list item, it omits overline and extra label to maintain + * a smaller footprint while remaining interactive. + * These items are designed to be stacked within a list, with no spacing between the elements. + * + * @see [OudsSmallCardItem] If you need spaced items displayed in a card format (with background or outlined). + * + * @param label The main label of the small list item. + * @param modifier [Modifier] applied to the layout of the small list item. + * @param onClick Callback invoked when the small list item is clicked. + * @param indicator The navigation indicator to display. Defaults to [OudsListItemDefaults.Indicator] (Next). + * @param verticalAlignment Controls the vertical alignment of the content. Defaults to [OudsListItemDefaults.VerticalAlignment]. + * @param description Optional text displayed below the [label]. + * @param leading Optional leading content such as an icon or image displayed at the start of the small list item. + * @param trailing Optional trailing content such as an icon, image, or text displayed at the end of the small list item. + * @param divider Controls the display of a divider at the bottom of the small list item. Defaults to `true`. + * @param background Controls whether the small list item has a background color. Defaults to `false`. + * @param helperText Optional helper text displayed below the small list item. + * @param boldLabel Controls whether the label text is displayed in bold. Defaults to `false`. + * @param enabled Controls the enabled state of the small list item. When `false`, the item is not clickable and content is displayed in a disabled state. Defaults to `true`. + * @param edgeToEdge Controls the horizontal layout of the item. When `true`, the item is designed to span the full width of the screen or container. When `false`, + * it is adapted for use within constrained layouts or containers with their own padding. Defaults to `true`. + * @param interactionSource Optional hoisted [MutableInteractionSource] for observing and emitting interactions for this small list item. + * + * @sample com.orange.ouds.core.component.samples.OudsNavigationSmallListItemSample + * @sample com.orange.ouds.core.component.samples.OudsSmallListItemWithAllElementsSample + * @sample com.orange.ouds.core.component.samples.OudsSmallListItemWithImageSample + * @sample com.orange.ouds.core.component.samples.OudsSmallListItemWithUntintedIconSample + */ +@ExperimentalOudsApi +@Composable +fun OudsSmallListItem( + label: String, + modifier: Modifier = Modifier, + onClick: () -> Unit, + indicator: OudsListItemIndicator = OudsListItemDefaults.Indicator, + verticalAlignment: OudsListItemVerticalAlignment = OudsListItemDefaults.VerticalAlignment, + description: String? = null, + leading: OudsSmallListItemLeading? = null, + trailing: OudsSmallListItemTrailing? = null, + divider: Boolean = true, + background: Boolean = false, + helperText: String? = null, + boldLabel: Boolean = false, + enabled: Boolean = true, + edgeToEdge: Boolean = true, + interactionSource: MutableInteractionSource? = null +) { + OudsListItem( + size = OudsListItemSize.Small, + label = label, + onClick = onClick, + modifier = modifier, + indicator = indicator, + verticalAlignment = verticalAlignment, + overline = null, + extraLabel = null, + description = description, + leading = leading, + trailing = trailing, + decoration = listItemDecoration(background, divider), + helperText = helperText, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = edgeToEdge, + card = false, + interactionSource = interactionSource + ) +} + +internal val SmallListItemAssetSize = OudsListItemAssetSize.Small + +/** + * A leading content of an [OudsSmallListItem]. + */ +sealed interface OudsSmallListItemLeading : OudsListItemLeadingTrailing { + + /** + * An icon as a small list item leading content. + */ + open class Icon internal constructor( + graphicsObjectProvider: @Composable (OudsListItemIcon) -> Any, + contentDescriptionProvider: @Composable (OudsListItemIcon) -> String, + override val tinted: Boolean, + status: OudsListItemIconStatus? + ) : OudsListItemIcon(graphicsObjectProvider, contentDescriptionProvider, tinted, SmallListItemAssetSize, status), OudsSmallListItemLeading { + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon]. + * + * @param painter Painter of the icon. + * @param contentDescription The content description associated with this icon. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + painter: Painter, contentDescription: String, tinted: Boolean = true + ) : this({ painter }, { contentDescription }, tinted, null) + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon]. + * + * @param imageVector Image vector of the icon. + * @param contentDescription The content description associated with this icon. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + imageVector: ImageVector, contentDescription: String, tinted: Boolean = true + ) : this({ imageVector }, { contentDescription }, tinted, null) + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon]. + * + * @param bitmap Image bitmap of the icon. + * @param contentDescription The content description associated with this icon. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + bitmap: ImageBitmap, contentDescription: String, tinted: Boolean = true + ) : this({ bitmap }, { contentDescription }, tinted, null) + + private constructor(status: OudsListItemIconStatus) : this( + { status.painterProvider() }, + { status.contentDescriptionProvider() }, + true, + status + ) + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon] representing an info status. + * Use for neutral information that requires additional attention. + */ + object Info : Icon(OudsListItemIconStatus.Info) + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon] representing a negative status. + * Use for errors, failures, destructive outcomes or critical problems. + */ + object Negative : Icon(OudsListItemIconStatus.Negative) + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon] representing a positive status. + * Use for successful, completed or beneficial states. + */ + object Positive : Icon(OudsListItemIconStatus.Positive) + + /** + * Creates an instance of [OudsSmallListItemLeading.Icon] representing a warning status. + * Use for situations that may require caution or user awareness. + */ + object Warning : Icon(OudsListItemIconStatus.Warning) + } + + /** + * An image as a small list item leading content. + */ + class Image internal constructor( + graphicsObject: Any, + contentDescription: String, + ratio: OudsListItemImageRatio, + contentScale: ContentScale, + roundedCorner: Boolean + ) : OudsListItemImage(graphicsObject, contentDescription, SmallListItemAssetSize, ratio, contentScale, roundedCorner), OudsSmallListItemLeading { + + /** + * Creates an instance of [OudsSmallListItemLeading.Image]. + * + * @param painter Painter of the image. + * @param contentDescription The content description associated with this image. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [painter]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + painter: Painter, + contentDescription: String, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(painter as Any, contentDescription, ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsSmallListItemLeading.Image]. + * + * @param imageVector Image vector of the image. + * @param contentDescription The content description associated with this image. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [imageVector]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(imageVector as Any, contentDescription, ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsSmallListItemLeading.Image]. + * + * @param bitmap Image bitmap of the image. + * @param contentDescription The content description associated with this image. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [bitmap]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(bitmap as Any, contentDescription, ratio, contentScale, roundedCorner) + } +} + +/** + * A trailing content of an [OudsSmallListItem]. + */ +sealed interface OudsSmallListItemTrailing : OudsListItemLeadingTrailing { + + /** + * An icon as a small list item trailing content. + */ + open class Icon internal constructor( + graphicsObjectProvider: @Composable () -> Any, + contentDescriptionProvider: @Composable () -> String, + override val tinted: Boolean, + status: OudsListItemIconStatus? + ) : OudsListItemIcon({ graphicsObjectProvider() }, { contentDescriptionProvider() }, tinted, SmallListItemAssetSize, status), OudsSmallListItemTrailing { + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon]. + * + * @param painter Painter of the icon. + * @param contentDescription The content description associated with this icon. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + painter: Painter, contentDescription: String, tinted: Boolean = true + ) : this({ painter }, { contentDescription }, tinted, null) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon]. + * + * @param imageVector Image vector of the icon. + * @param contentDescription The content description associated with this icon. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + imageVector: ImageVector, contentDescription: String, tinted: Boolean = true + ) : this({ imageVector }, { contentDescription }, tinted, null) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon]. + * + * @param bitmap Image bitmap of the icon. + * @param contentDescription The content description associated with this icon. + * @param tinted Controls whether the icon should be tinted with the theme color. Defaults to `true`. + * When set to `false`, the icon is displayed with its original colors (e.g., for multicolor icons). + * Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons. + */ + constructor( + bitmap: ImageBitmap, contentDescription: String, tinted: Boolean = true + ) : this({ bitmap }, { contentDescription }, tinted, null) + + private constructor(status: OudsListItemIconStatus) : this(status.painterProvider, status.contentDescriptionProvider, true, status) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon] representing an info status. + * Use for neutral information that requires additional attention. + */ + object Info : Icon(OudsListItemIconStatus.Info) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon] representing a negative status. + * Use for errors, failures, destructive outcomes or critical problems. + */ + object Negative : Icon(OudsListItemIconStatus.Negative) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon] representing a positive status. + * Use for successful, completed or beneficial states. + */ + object Positive : Icon(OudsListItemIconStatus.Positive) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Icon] representing a warning status. + * Use for situations that may require caution or user awareness. + */ + object Warning : Icon(OudsListItemIconStatus.Warning) + } + + /** + * Image as a small list item trailing content. + */ + class Image internal constructor( + graphicsObject: Any, + contentDescription: String, + ratio: OudsListItemImageRatio, + contentScale: ContentScale, + roundedCorner: Boolean + ) : OudsListItemImage(graphicsObject, contentDescription, SmallListItemAssetSize, ratio, contentScale, roundedCorner), OudsSmallListItemTrailing { + + /** + * Creates an instance of [OudsSmallListItemTrailing.Image]. + * + * @param painter Painter of the image. + * @param contentDescription The content description associated with this image. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [painter]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + painter: Painter, + contentDescription: String, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(painter as Any, contentDescription, ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Image]. + * + * @param imageVector Image vector of the image. + * @param contentDescription The content description associated with this image. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [imageVector]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + imageVector: ImageVector, + contentDescription: String, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(imageVector as Any, contentDescription, ratio, contentScale, roundedCorner) + + /** + * Creates an instance of [OudsSmallListItemTrailing.Image]. + * + * @param bitmap Image bitmap of the image. + * @param contentDescription The content description associated with this image. + * @param ratio Ratio of the image among [OudsListItemImageRatio] values. + * @param contentScale Scale parameter used to determine the aspect ratio scaling to be used if the bounds are a different size from the intrinsic size + * of the [bitmap]. + * @param roundedCorner Controls whether the image is displayed with square or rounded corners. False by default. + */ + constructor( + bitmap: ImageBitmap, + contentDescription: String, + ratio: OudsListItemImageRatio = OudsListItemDefaults.ImageRatio, + contentScale: ContentScale = OudsListItemDefaults.ImageContentScale, + roundedCorner: Boolean = false + ) : this(bitmap as Any, contentDescription, ratio, contentScale, roundedCorner) + } + + /** + * Label as a small list item trailing content. + */ + class Text( + label: String, + style: OudsListItemTextStyle + ) : OudsListItemText(label, style, null), OudsSmallListItemTrailing +} + +@OudsPreviewLightDark +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsStaticSmallListItem(@PreviewParameter(OudsSmallListItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsStaticSmallListItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsStaticSmallListItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + OudsSmallListItem( + label = label, + description = description, + helperText = helperText, + leading = leading, + trailing = trailing, + divider = decoration.divider, + background = decoration is OudsListItemDecoration.Background, + verticalAlignment = verticalAlignment, + boldLabel = boldLabel, + enabled = enabled, + edgeToEdge = false + ) + } +} + +@Preview(name = "Light", heightDp = OudsPreviewableComponent.SmallListItem.Navigation.PreviewHeightDp, device = OudsPreviewDevice) +@Preview( + name = "Dark", + uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, + heightDp = OudsPreviewableComponent.SmallListItem.Navigation.PreviewHeightDp, + device = OudsPreviewDevice +) +@Composable +@Suppress("PreviewShouldNotBeCalledRecursively") +private fun PreviewOudsNavigationSmallListItem(@PreviewParameter(OudsSmallListItemPreviewParameterProvider::class) parameter: OudsListItemPreviewParameter) { + PreviewOudsNavigationSmallListItem(theme = getPreviewTheme(), darkThemeEnabled = isSystemInDarkTheme(), parameter = parameter) +} + +@Composable +internal fun PreviewOudsNavigationSmallListItem( + theme: OudsThemeContract, + darkThemeEnabled: Boolean, + parameter: OudsListItemPreviewParameter +) = OudsPreview(theme = theme, darkThemeEnabled = darkThemeEnabled) { + with(parameter) { + PreviewEnumEntries(maxEnumEntriesInEachRow = 1) { + OudsSmallListItem( + onClick = {}, + indicator = indicator, + label = label, + description = description, + helperText = helperText, + verticalAlignment = verticalAlignment, + leading = leading, + trailing = trailing, + divider = decoration.divider, + background = decoration is OudsListItemDecoration.Background, + enabled = enabled, + edgeToEdge = false + ) + } + } +} + +internal class OudsSmallListItemPreviewParameterProvider : OudsBasicListItemPreviewParameterProvider( + leading = smallListItemPreviewParameterLeading, + trailing = smallListItemPreviewParameterTrailing +) + +internal val smallListItemPreviewParameterLeading: (Int) -> OudsSmallListItemLeading? = { index -> + when (index) { + 0 -> OudsSmallListItemLeading.Icon.Info + 1 -> OudsSmallListItemLeading.Icon(Icons.Outlined.FavoriteBorder, "") + 2 -> OudsSmallListItemLeading.Image(CheckerboardPainter, "", OudsListItemImageRatio.Widescreen) + else -> null + } +} + +internal val smallListItemPreviewParameterTrailing: (Int) -> OudsSmallListItemTrailing? = { index -> + when (index) { + 0 -> OudsSmallListItemTrailing.Icon(Icons.Outlined.FavoriteBorder, "") + 1 -> OudsSmallListItemTrailing.Text(label = "Label", style = OudsListItemTextStyle.LabelStrong) + 2 -> OudsSmallListItemTrailing.Image(CheckerboardPainter, "", OudsListItemImageRatio.Square) + else -> null + } +} 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 index b2889dc187..2a63411972 100644 --- a/core/src/main/java/com/orange/ouds/core/component/OudsTopAppBar.kt +++ b/core/src/main/java/com/orange/ouds/core/component/OudsTopAppBar.kt @@ -794,11 +794,7 @@ private val previewParameterValues: List onClick = {} ), OudsTopAppBarAction.Avatar( - painter = CheckerboardPainter( - squareSize = 6.dp, - primaryColor = Color(0xff247a85), - secondaryColor = Color(0xfffbcd00) - ), + painter = CheckerboardPainter, contentDescription = "", onClick = {} ), diff --git a/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentImage.kt b/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentImage.kt new file mode 100644 index 0000000000..368b887022 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/content/OudsComponentImage.kt @@ -0,0 +1,58 @@ +/* + * 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.foundation.Image +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +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 + +abstract class OudsComponentImage internal constructor( + extraParametersClass: Class, + private val graphicsObject: Any, + private val contentDescription: String?, + private val alignment: Alignment = Alignment.Center, + private val contentScale: ContentScale = ContentScale.Fit +) : OudsComponentContent(extraParametersClass) where T : OudsComponentContent.ExtraParameters { + + @Composable + override fun Content(modifier: Modifier) { + when (graphicsObject) { + is Painter -> Image( + painter = graphicsObject, + contentDescription = contentDescription, + modifier = modifier, + alignment = alignment, + contentScale = contentScale + ) + is ImageVector -> Image( + imageVector = graphicsObject, + contentDescription = contentDescription, + modifier = modifier, + alignment = alignment, + contentScale = contentScale + ) + is ImageBitmap -> Image( + bitmap = graphicsObject, + contentDescription = contentDescription, + modifier = modifier, + alignment = alignment, + contentScale = contentScale + ) + } + } +} \ No newline at end of file diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsCardItemSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsCardItemSamples.kt new file mode 100644 index 0000000000..a08b1974ca --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsCardItemSamples.kt @@ -0,0 +1,160 @@ +/* + * 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.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Favorite +import androidx.compose.material.icons.outlined.LocationOn +import androidx.compose.material.icons.outlined.Star +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.PreviewLightDark +import androidx.compose.ui.unit.dp +import com.orange.ouds.core.component.OudsCardItem +import com.orange.ouds.core.component.OudsListItemDecoration +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemImageSize +import com.orange.ouds.core.component.OudsListItemIndicator +import com.orange.ouds.core.component.OudsListItemLeading +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsListItemTrailing +import com.orange.ouds.core.utilities.CheckerboardPainter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.rememberRainbowHeartPainter + +@Composable +internal fun OudsStaticCardItemSample() { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + OudsCardItem( + label = "Hotel Paradise", + description = "Luxury hotel in the city center", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.LocationOn, + contentDescription = "Location icon" + ), + trailing = OudsListItemTrailing.Text(label = "4.5★", style = OudsListItemTextStyle.LabelStrong) + ) + OudsCardItem( + label = "Beach Resort", + description = "Relaxing resort by the sea", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Star, + contentDescription = "Star icon" + ), + trailing = OudsListItemTrailing.Text(label = "4.8★", style = OudsListItemTextStyle.LabelStrong) + ) + } +} + +@Composable +internal fun OudsNavigationCardItemSample() { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + OudsCardItem( + label = "Return to search", + onClick = { /* Navigate back */ }, + indicator = OudsListItemIndicator.Previous, + decoration = OudsListItemDecoration.Outlined + ) + OudsCardItem( + label = "View details", + onClick = { /* Navigate forward */ }, + indicator = OudsListItemIndicator.Next, + decoration = OudsListItemDecoration.Outlined + ) + OudsCardItem( + label = "Book on partner website", + onClick = { /* Open browser */ }, + indicator = OudsListItemIndicator.External, + decoration = OudsListItemDecoration.Outlined + ) + } +} + +@Composable +internal fun OudsCardItemWithAllElementsSample() { + OudsCardItem( + overline = "Featured destination", + label = "Paris, France", + extraLabel = "Special offer", + description = "Discover the city of lights with exclusive deals.", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = "Favorite icon" + ), + trailing = OudsListItemTrailing.Text(label = "From €299", style = OudsListItemTextStyle.LabelStrong), + helperText = "Limited time offer - Book now!", + boldLabel = true, + decoration = OudsListItemDecoration.Background(divider = true) + ) +} + +@Composable +internal fun OudsCardItemWithImageSample() { + OudsCardItem( + label = "Premium Suite", + description = "Spacious room with panoramic view", + leading = OudsListItemLeading.Image( + painter = CheckerboardPainter, + contentDescription = "Suite image", + size = OudsListItemImageSize.Large, + ratio = OudsListItemImageRatio.Square + ), + trailing = OudsListItemTrailing.Text(label = "€450/night", style = OudsListItemTextStyle.LabelStrong), + decoration = OudsListItemDecoration.Outlined + ) +} + +@Composable +internal fun OudsCardItemWithUntintedIconSample() { + OudsCardItem( + label = "Wishlist", + description = "Your favorite destinations", + leading = OudsListItemLeading.Icon( + painter = rememberRainbowHeartPainter(), + contentDescription = "Wishlist icon", + tinted = false + ), + decoration = OudsListItemDecoration.Outlined + ) +} + +@PreviewLightDark +@Composable +private fun PreviewOudsStaticCardItemSample() = OudsPreview { + OudsStaticCardItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsNavigationCardItemSample() = OudsPreview { + OudsNavigationCardItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsCardItemWithAllElementsSample() = OudsPreview { + OudsCardItemWithAllElementsSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsCardItemWithImageSample() = OudsPreview { + OudsCardItemWithImageSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsCardItemWithUntintedIconSample() = OudsPreview { + OudsCardItemWithUntintedIconSample() +} diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsListItemSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsListItemSamples.kt new file mode 100644 index 0000000000..5d69ad6eff --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsListItemSamples.kt @@ -0,0 +1,160 @@ +/* + * 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.foundation.layout.Column +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Email +import androidx.compose.material.icons.outlined.Favorite +import androidx.compose.material.icons.outlined.Person +import androidx.compose.material.icons.outlined.Phone +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.PreviewLightDark +import com.orange.ouds.core.component.OudsListItem +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemImageSize +import com.orange.ouds.core.component.OudsListItemIndicator +import com.orange.ouds.core.component.OudsListItemLeading +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsListItemTrailing +import com.orange.ouds.core.utilities.CheckerboardPainter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.rememberRainbowHeartPainter + +@Composable +internal fun OudsStaticListItemSample() { + Column { + OudsListItem( + label = "Name", + description = "John Doe", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Person, + contentDescription = "Person icon" + ) + ) + OudsListItem( + label = "Email", + description = "john.doe@example.com", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Email, + contentDescription = "Email icon" + ) + ) + OudsListItem( + label = "Phone", + description = "+33 6 12 34 56 78", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Phone, + contentDescription = "Phone icon" + ) + ) + } +} + +@Composable +internal fun OudsNavigationListItemSample() { + Column { + OudsListItem( + label = "Back to previous screen", + onClick = { /* Navigate back */ }, + indicator = OudsListItemIndicator.Previous + ) + OudsListItem( + label = "Go to next screen", + onClick = { /* Navigate forward */ }, + indicator = OudsListItemIndicator.Next + ) + OudsListItem( + label = "Open external link", + onClick = { /* Open browser */ }, + indicator = OudsListItemIndicator.External + ) + } +} + +@Composable +internal fun OudsListItemWithAllElementsSample() { + OudsListItem( + overline = "Overline text", + label = "Main label", + extraLabel = "Extra label", + description = "This is a description that provides additional context.", + leading = OudsListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = "Favorite icon" + ), + trailing = OudsListItemTrailing.Text(label = "99+", style = OudsListItemTextStyle.Label), + helperText = "Helper text appears below the item", + boldLabel = true, + background = true, + divider = true + ) +} + +@Composable +internal fun OudsListItemWithImageSample() { + OudsListItem( + label = "Product name", + description = "Product description with details", + leading = OudsListItemLeading.Image( + painter = CheckerboardPainter, + contentDescription = "Product image", + size = OudsListItemImageSize.Large, + ratio = OudsListItemImageRatio.Square + ), + trailing = OudsListItemTrailing.Text(label = "€29.99", style = OudsListItemTextStyle.Label) + ) +} + +@Composable +internal fun OudsListItemWithUntintedIconSample() { + OudsListItem( + label = "Favorites", + description = "View your favorite items", + leading = OudsListItemLeading.Icon( + painter = rememberRainbowHeartPainter(), + contentDescription = "Favorites icon", + tinted = false + ) + ) +} + +@PreviewLightDark +@Composable +private fun PreviewOudsStaticListItemSample() = OudsPreview { + OudsStaticListItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsNavigationListItemSample() = OudsPreview { + OudsNavigationListItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsListItemWithAllElementsSample() = OudsPreview { + OudsListItemWithAllElementsSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsListItemWithImageSample() = OudsPreview { + OudsListItemWithImageSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsListItemWithUntintedIconSample() = OudsPreview { + OudsListItemWithUntintedIconSample() +} diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsSmallCardItemSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsSmallCardItemSamples.kt new file mode 100644 index 0000000000..3444bcc5e8 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsSmallCardItemSamples.kt @@ -0,0 +1,157 @@ +/* + * 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.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Favorite +import androidx.compose.material.icons.outlined.Info +import androidx.compose.material.icons.outlined.Notifications +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.PreviewLightDark +import androidx.compose.ui.unit.dp +import com.orange.ouds.core.component.OudsListItemDecoration +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemIndicator +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsSmallCardItem +import com.orange.ouds.core.component.OudsSmallListItemLeading +import com.orange.ouds.core.component.OudsSmallListItemTrailing +import com.orange.ouds.core.utilities.CheckerboardPainter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.rememberRainbowHeartPainter + +@Composable +internal fun OudsStaticSmallCardItemSample() { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + OudsSmallCardItem( + label = "Notifications", + description = "3 new alerts", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Notifications, + contentDescription = "Notifications icon" + ), + decoration = OudsListItemDecoration.Outlined + ) + OudsSmallCardItem( + label = "Important", + description = "Requires attention", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Info, + contentDescription = "Info icon" + ), + decoration = OudsListItemDecoration.Outlined + ) + } +} + +@Composable +internal fun OudsNavigationSmallCardItemSample() { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { + OudsSmallCardItem( + label = "Previous", + onClick = { /* Navigate back */ }, + indicator = OudsListItemIndicator.Previous, + decoration = OudsListItemDecoration.Outlined + ) + OudsSmallCardItem( + label = "Next", + onClick = { /* Navigate forward */ }, + indicator = OudsListItemIndicator.Next, + decoration = OudsListItemDecoration.Outlined + ) + OudsSmallCardItem( + label = "External", + onClick = { /* Open browser */ }, + indicator = OudsListItemIndicator.External, + decoration = OudsListItemDecoration.Outlined + ) + } +} + +@Composable +internal fun OudsSmallCardItemWithAllElementsSample() { + OudsSmallCardItem( + label = "Paris, France", + description = "Discover the city of lights with exclusive deals.", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = "Favorite icon" + ), + trailing = OudsSmallListItemTrailing.Text(label = "From €299", style = OudsListItemTextStyle.LabelStrong), + helperText = "Limited time offer - Book now!", + boldLabel = true, + decoration = OudsListItemDecoration.Background(divider = true) + ) +} + +@Composable +internal fun OudsSmallCardItemWithImageSample() { + OudsSmallCardItem( + label = "Special offer", + description = "Limited time only", + leading = OudsSmallListItemLeading.Image( + painter = CheckerboardPainter, + contentDescription = "Offer image", + ratio = OudsListItemImageRatio.Square + ), + trailing = OudsSmallListItemTrailing.Text(label = "-50%", style = OudsListItemTextStyle.LabelStrong), + decoration = OudsListItemDecoration.Outlined + ) +} + +@Composable +internal fun OudsSmallCardItemWithUntintedIconSample() { + OudsSmallCardItem( + label = "Featured", + description = "Exclusive content", + leading = OudsSmallListItemLeading.Icon( + painter = rememberRainbowHeartPainter(), + contentDescription = "Featured icon", + tinted = false + ), + decoration = OudsListItemDecoration.Outlined + ) +} + +@PreviewLightDark +@Composable +private fun PreviewOudsStaticSmallCardItemSample() = OudsPreview { + OudsStaticSmallCardItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsNavigationSmallCardItemSample() = OudsPreview { + OudsNavigationSmallCardItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsSmallCardItemWithAllElementsSample() = OudsPreview { + OudsSmallCardItemWithAllElementsSample() +} + + +@PreviewLightDark +@Composable +private fun PreviewOudsSmallCardItemWithImageSample() = OudsPreview { + OudsSmallCardItemWithImageSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsSmallCardItemWithUntintedIconSample() = OudsPreview { + OudsSmallCardItemWithUntintedIconSample() +} diff --git a/core/src/main/java/com/orange/ouds/core/component/samples/OudsSmallListItemSamples.kt b/core/src/main/java/com/orange/ouds/core/component/samples/OudsSmallListItemSamples.kt new file mode 100644 index 0000000000..37a4a15ab6 --- /dev/null +++ b/core/src/main/java/com/orange/ouds/core/component/samples/OudsSmallListItemSamples.kt @@ -0,0 +1,156 @@ +/* + * 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.foundation.layout.Column +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Favorite +import androidx.compose.material.icons.outlined.Notifications +import androidx.compose.material.icons.outlined.Settings +import androidx.compose.material.icons.outlined.Share +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.PreviewLightDark +import com.orange.ouds.core.component.OudsListItemImageRatio +import com.orange.ouds.core.component.OudsListItemIndicator +import com.orange.ouds.core.component.OudsListItemTextStyle +import com.orange.ouds.core.component.OudsSmallListItem +import com.orange.ouds.core.component.OudsSmallListItemLeading +import com.orange.ouds.core.component.OudsSmallListItemTrailing +import com.orange.ouds.core.utilities.CheckerboardPainter +import com.orange.ouds.core.utilities.OudsPreview +import com.orange.ouds.core.utilities.rememberRainbowHeartPainter + +@Composable +internal fun OudsStaticSmallListItemSample() { + Column { + OudsSmallListItem( + label = "Notifications", + description = "Push notifications enabled", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Notifications, + contentDescription = "Notifications icon" + ) + ) + OudsSmallListItem( + label = "Share", + description = "Share app with friends", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Share, + contentDescription = "Share icon" + ) + ) + OudsSmallListItem( + label = "Settings", + description = "App preferences", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Settings, + contentDescription = "Settings icon" + ) + ) + } +} + +@Composable +internal fun OudsNavigationSmallListItemSample() { + Column { + OudsSmallListItem( + label = "Go back", + onClick = { /* Navigate back */ }, + indicator = OudsListItemIndicator.Previous + ) + OudsSmallListItem( + label = "Continue", + onClick = { /* Navigate forward */ }, + indicator = OudsListItemIndicator.Next + ) + OudsSmallListItem( + label = "View on web", + onClick = { /* Open browser */ }, + indicator = OudsListItemIndicator.External + ) + } +} + +@Composable +internal fun OudsSmallListItemWithAllElementsSample() { + OudsSmallListItem( + label = "Main label", + description = "This is a description that provides additional context.", + leading = OudsSmallListItemLeading.Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = "Favorite icon" + ), + trailing = OudsSmallListItemTrailing.Text(label = "99+", style = OudsListItemTextStyle.Label), + helperText = "Helper text appears below the item", + boldLabel = true, + background = true, + divider = true + ) +} + +@Composable +internal fun OudsSmallListItemWithImageSample() { + OudsSmallListItem( + label = "Compact view", + description = "Quick access to content", + leading = OudsSmallListItemLeading.Image( + painter = CheckerboardPainter, + contentDescription = "Content image", + ratio = OudsListItemImageRatio.Square + ), + trailing = OudsSmallListItemTrailing.Text(label = "New", style = OudsListItemTextStyle.LabelStrong) + ) +} + +@Composable +internal fun OudsSmallListItemWithUntintedIconSample() { + OudsSmallListItem( + label = "Premium features", + description = "Unlock exclusive content", + leading = OudsSmallListItemLeading.Icon( + painter = rememberRainbowHeartPainter(), + contentDescription = "Premium icon", + tinted = false + ) + ) +} + +@PreviewLightDark +@Composable +private fun PreviewOudsStaticSmallListItemSample() = OudsPreview { + OudsStaticSmallListItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsNavigationSmallListItemSample() = OudsPreview { + OudsNavigationSmallListItemSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsSmallListItemWithAllElementsSample() = OudsPreview { + OudsSmallListItemWithAllElementsSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsSmallListItemWithImageSample() = OudsPreview { + OudsSmallListItemWithImageSample() +} + +@PreviewLightDark +@Composable +private fun PreviewOudsSmallListItemWithUntintedIconSample() = OudsPreview { + OudsSmallListItemWithUntintedIconSample() +} 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 ac5b43a7cd..5068b4ff57 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 @@ -62,7 +62,7 @@ data class OudsComponents internal constructor( val inputTag: InputTag, val link: Link, val linkMonochrome: LinkMonochrome, - internal val listItem: ListItem, + val listItem: ListItem, val pinCodeInput: PinCodeInput, val progressIndicator: ProgressIndicator, val progressIndicatorMonochrome: ProgressIndicatorMonochrome, 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 614d8626cf..13cccdf397 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 @@ -46,7 +46,6 @@ import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.orange.ouds.core.component.common.text.buildOudsAnnotatedErrorMessage @@ -298,19 +297,19 @@ internal val PreviewPaddingDefault = 16.dp 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." -internal class CheckerboardPainter(val squareSize: Dp, val primaryColor: Color, val secondaryColor: Color) : Painter() { +internal object CheckerboardPainter : Painter() { override val intrinsicSize = Size.Unspecified override fun DrawScope.onDraw() { - val squareSizePx = squareSize.toPx() + val squareSizePx = 6.dp.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 + val color = if ((row + column) % 2 == 0) Color(0xff247a85) else Color(0xfffbcd00) drawRect( color = color, topLeft = Offset(column * squareSizePx, row * squareSizePx), 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 abae8db081..661f6c488e 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 @@ -23,6 +23,8 @@ import com.orange.ouds.core.component.OudsBulletListPreviewParameterProvider 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.OudsCardItemPreviewParameterProvider +import com.orange.ouds.core.component.OudsCardItemWithRoundedCornersParameterProvider import com.orange.ouds.core.component.OudsCheckboxItemHighContrastModePreviewParameter import com.orange.ouds.core.component.OudsCheckboxItemHighContrastModePreviewParameterProvider import com.orange.ouds.core.component.OudsCheckboxItemPreviewParameter @@ -49,6 +51,11 @@ import com.orange.ouds.core.component.OudsLinkCompactDensityPreviewParameterProv import com.orange.ouds.core.component.OudsLinkPreviewParameter import com.orange.ouds.core.component.OudsLinkPreviewParameterProvider import com.orange.ouds.core.component.OudsLinkSize +import com.orange.ouds.core.component.OudsListItemDecoration +import com.orange.ouds.core.component.OudsListItemLeading +import com.orange.ouds.core.component.OudsListItemPreviewParameter +import com.orange.ouds.core.component.OudsListItemPreviewParameterProvider +import com.orange.ouds.core.component.OudsListItemTrailing import com.orange.ouds.core.component.OudsNavigationBarItemPreviewParameterProvider import com.orange.ouds.core.component.OudsNavigationBarPreviewParameterProvider import com.orange.ouds.core.component.OudsNavigationButtonPreviewParameter @@ -66,6 +73,10 @@ import com.orange.ouds.core.component.OudsRadioButtonItemPreviewParameter import com.orange.ouds.core.component.OudsRadioButtonItemPreviewParameterProvider import com.orange.ouds.core.component.OudsRadioButtonPreviewParameter import com.orange.ouds.core.component.OudsRadioButtonPreviewParameterProvider +import com.orange.ouds.core.component.OudsSmallCardItemPreviewParameterProvider +import com.orange.ouds.core.component.OudsSmallListItemLeading +import com.orange.ouds.core.component.OudsSmallListItemPreviewParameterProvider +import com.orange.ouds.core.component.OudsSmallListItemTrailing import com.orange.ouds.core.component.OudsSuggestionChipPreviewParameter import com.orange.ouds.core.component.OudsSuggestionChipPreviewParameterProvider import com.orange.ouds.core.component.OudsSwitchItemPreviewParameter @@ -136,6 +147,13 @@ import com.orange.ouds.core.component.PreviewOudsNavigationBarItem import com.orange.ouds.core.component.PreviewOudsNavigationButton import com.orange.ouds.core.component.PreviewOudsNavigationButtonOnTwoLines import com.orange.ouds.core.component.PreviewOudsNavigationButtonWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsNavigationCardItem +import com.orange.ouds.core.component.PreviewOudsNavigationCardItemWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsNavigationListItem +import com.orange.ouds.core.component.PreviewOudsNavigationListItemWithUntintedIcon +import com.orange.ouds.core.component.PreviewOudsNavigationSmallCardItem +import com.orange.ouds.core.component.PreviewOudsNavigationSmallCardItemWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsNavigationSmallListItem import com.orange.ouds.core.component.PreviewOudsPasswordInput import com.orange.ouds.core.component.PreviewOudsPasswordInputWithRichText import com.orange.ouds.core.component.PreviewOudsPinCodeInput @@ -154,6 +172,12 @@ import com.orange.ouds.core.component.PreviewOudsSmallButtonOnTwoLines import com.orange.ouds.core.component.PreviewOudsSmallButtonWithRoundedCorners import com.orange.ouds.core.component.PreviewOudsSmallButtonWithUntintedIcon import com.orange.ouds.core.component.PreviewOudsSmallFloatingActionButton +import com.orange.ouds.core.component.PreviewOudsStaticCardItem +import com.orange.ouds.core.component.PreviewOudsStaticCardItemWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsStaticListItem +import com.orange.ouds.core.component.PreviewOudsStaticSmallCardItem +import com.orange.ouds.core.component.PreviewOudsStaticSmallCardItemWithRoundedCorners +import com.orange.ouds.core.component.PreviewOudsStaticSmallListItem import com.orange.ouds.core.component.PreviewOudsSuggestionChip import com.orange.ouds.core.component.PreviewOudsSuggestionChipOnTwoLines import com.orange.ouds.core.component.PreviewOudsSuggestionChipWithUntintedIcon @@ -417,6 +441,67 @@ interface OudsPreviewableComponent { } } + object CardItem { + + object Navigation : OudsPreviewableComponent { + const val PreviewHeightDp = 880 + + override val parameters: List = OudsCardItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsNavigationCardItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object NavigationWithRoundedCorners : OudsPreviewableComponent { + override val parameters: List = OudsCardItemWithRoundedCornersParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsNavigationCardItemWithRoundedCorners( + theme = theme, + decoration = parameter as OudsListItemDecoration + ) + } + + override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = darkThemeEnabled && !highContrastModeEnabled + } + + object Static : OudsPreviewableComponent { + override val parameters: List = OudsCardItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsStaticCardItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object StaticWithRoundedCorners : OudsPreviewableComponent { + override val parameters: List = OudsCardItemWithRoundedCornersParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsStaticCardItemWithRoundedCorners( + theme = theme, + decoration = parameter as OudsListItemDecoration + ) + } + + override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = !darkThemeEnabled && !highContrastModeEnabled + } + } + object CheckboxItem { object Default : OudsPreviewableComponent { @@ -866,6 +951,50 @@ interface OudsPreviewableComponent { } } + object ListItem { + + object Navigation : OudsPreviewableComponent { + const val PreviewHeightDp = 1000 + + override val parameters: List = OudsListItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsNavigationListItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object Static : OudsPreviewableComponent { + override val parameters: List = OudsListItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsStaticListItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object WithUntintedIcon : OudsPreviewableComponent { + override val parameters: List = emptyList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsNavigationListItemWithUntintedIcon(theme = theme) + } + + override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = !darkThemeEnabled && !highContrastModeEnabled + } + } + object ModalBottomSheet : OudsPreviewableComponent { override val parameters: List = emptyList() @@ -1244,6 +1373,100 @@ interface OudsPreviewableComponent { } } + object SmallCardItem { + + object Navigation : OudsPreviewableComponent { + const val PreviewHeightDp = 700 + + override val parameters: List = OudsSmallCardItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsNavigationSmallCardItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object NavigationWithRoundedCorners : OudsPreviewableComponent { + override val parameters: List = OudsCardItemWithRoundedCornersParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsNavigationSmallCardItemWithRoundedCorners( + theme = theme, + decoration = parameter as OudsListItemDecoration + ) + } + + override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = darkThemeEnabled && !highContrastModeEnabled + } + + object Static : OudsPreviewableComponent { + override val parameters: List = OudsSmallCardItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsStaticSmallCardItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object StaticWithRoundedCorners : OudsPreviewableComponent { + override val parameters: List = OudsCardItemWithRoundedCornersParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + PreviewOudsStaticSmallCardItemWithRoundedCorners( + theme = theme, + decoration = parameter as OudsListItemDecoration + ) + } + + override fun isPreviewAvailable(darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean) = !darkThemeEnabled && !highContrastModeEnabled + } + } + + object SmallListItem { + + object Navigation : OudsPreviewableComponent { + const val PreviewHeightDp = 700 + + override val parameters: List = OudsSmallListItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsNavigationSmallListItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + + object Static : OudsPreviewableComponent { + override val parameters: List = OudsSmallListItemPreviewParameterProvider().values.toList() + + @Composable + override fun Preview(theme: OudsThemeContract, darkThemeEnabled: Boolean, highContrastModeEnabled: Boolean, parameter: Any?) { + @Suppress("UNCHECKED_CAST") + PreviewOudsStaticSmallListItem( + theme = theme, + darkThemeEnabled = darkThemeEnabled, + parameter = parameter as OudsListItemPreviewParameter + ) + } + } + } + object SuggestionChip { object Default : OudsPreviewableComponent { 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 c0240b6719..466c7e6ec4 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 @@ -46,6 +46,7 @@ interface OudsDrawableResources { val button: Button val checkbox: Checkbox val chip: Chip + val controlItem: ControlItem val link: Link val radioButton: RadioButton val switch: Switch @@ -123,6 +124,14 @@ interface OudsDrawableResources { val tick: Int } + interface ControlItem { + @get:DrawableRes + val next: Int + + @get:DrawableRes + val previous: Int + } + interface Link { @get:DrawableRes val externalLink: Int @@ -159,6 +168,9 @@ interface OudsDrawableResources { interface Actions { @get:DrawableRes val deleteCrossRound: Int + + @get:DrawableRes + val externalLink: Int } interface Navigation { diff --git a/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeSettings.kt b/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeSettings.kt index c6b50b3d99..624b3a9679 100644 --- a/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeSettings.kt +++ b/theme-contract/src/main/java/com/orange/ouds/theme/OudsThemeSettings.kt @@ -42,7 +42,12 @@ import kotlinx.parcelize.Parcelize * For standard or business-oriented journeys, keep the default corners. * This evolution addresses the need for flexibility in adapting the design to certain brand contexts. * Set to `null` if this setting has no effect on the associated theme (theme has always the same appearance managed by tokens). - * + * @property roundedCornerCardItems Indicates if rounded corners should be applied to every card items. + * Set to `false` for a square finish, or `true` for a finish with rounded corner. + * To be favored in more emotional, immersive contexts or those tied to specific visual identities. + * For standard or business-oriented journeys, keep the default corners. + * This evolution addresses the need for flexibility in adapting the design to certain brand contexts. + * Set to `null` if this setting has no effect on the associated theme (theme has always the same appearance managed by tokens). * @constructor Creates an instance of [OudsThemeSettings]. */ @Parcelize @@ -50,5 +55,6 @@ data class OudsThemeSettings @JvmOverloads constructor( val roundedCornerButtons: Boolean? = null, val roundedCornerTextInputs: Boolean? = null, val roundedCornerAlertMessages: Boolean? = null, - val roundedCornerProgressIndicators: Boolean? = null + val roundedCornerProgressIndicators: Boolean? = null, + val roundedCornerCardItems: Boolean? = null ) : Parcelable \ 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 ce7dcd4176..2943ebd892 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 @@ -33,14 +33,14 @@ object OudsVersion { const val Link = "2.4.0" const val NavigationBar = "1.0.0" const val NavigationButton = "3.3.0" - const val NavigationCardItem = "1.0.0" - const val NavigationListItem = "1.0.0" + const val NavigationCardItem = "0.1.0" + const val NavigationListItem = "0.1.0" const val PasswordInput = "1.3.1" const val PinCodeInput = "1.3.0" const val ProgressIndicator = "1.0.0" const val RadioButton = "1.4.0" - const val StaticCardItem = "1.0.0" - const val StaticListItem = "1.0.0" + const val StaticCardItem = "0.1.0" + const val StaticListItem = "0.1.0" const val SuggestionChip = "1.5.0" const val Switch = "1.5.0" const val Tag = "1.5.0" diff --git a/theme-orange-compact/src/main/java/com/orange/ouds/theme/orangecompact/OrangeCompactTheme.kt b/theme-orange-compact/src/main/java/com/orange/ouds/theme/orangecompact/OrangeCompactTheme.kt index 690db2a620..d960cfe757 100644 --- a/theme-orange-compact/src/main/java/com/orange/ouds/theme/orangecompact/OrangeCompactTheme.kt +++ b/theme-orange-compact/src/main/java/com/orange/ouds/theme/orangecompact/OrangeCompactTheme.kt @@ -128,13 +128,15 @@ const val ORANGE_COMPACT_THEME_NAME = "Orange Compact" * @param roundedCornerTextInputs Whether text inputs have rounded corners. * @param roundedCornerAlertMessages Whether alert messages have rounded corners. * @param roundedCornerProgressIndicators Whether progress indicators have rounded corners. + * @param roundedCornerCardItems Whether card items have rounded corners. */ open class OrangeCompactTheme @JvmOverloads constructor( private val orangeFontFamily: OrangeFontFamily, private val roundedCornerButtons: Boolean = false, private val roundedCornerTextInputs: Boolean = true, private val roundedCornerAlertMessages: Boolean = false, - private val roundedCornerProgressIndicators: Boolean = false + private val roundedCornerProgressIndicators: Boolean = false, + private val roundedCornerCardItems: Boolean = false ) : OudsThemeContract { override val name: String @@ -149,7 +151,7 @@ open class OrangeCompactTheme @JvmOverloads constructor( } override val settings: OudsThemeSettings - get() = OudsThemeSettings(roundedCornerButtons, roundedCornerTextInputs, roundedCornerAlertMessages, roundedCornerProgressIndicators) + get() = OudsThemeSettings(roundedCornerButtons, roundedCornerTextInputs, roundedCornerAlertMessages, roundedCornerProgressIndicators, roundedCornerCardItems) override val colorTokens: OudsColorSemanticTokens get() = OrangeCompactColorSemanticTokens() diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..13aa1d15d9 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..29816d5175 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..2aa84d72c6 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..e22d820705 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..4c4b4ee836 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..679ce901b0 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..7400c8c427 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..efaf1b0b1b Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..9e94ad99ad Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..86aff6eb91 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..ba87faa587 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..5575c8cf59 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..aa5c0a3f26 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..ba4e714466 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..4066aeed97 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..46eeaaa57d Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..df1d99f401 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..e37b70ee39 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..80cb2095fc Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..22830d94f9 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..808ddcdfe2 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..44791185f5 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..6e511df725 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..4640d5b938 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..edea39bfac Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..6e9d4c678a Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..1be4c24588 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..5afa66f1b8 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..aa2c8a36ae Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png new file mode 100644 index 0000000000..2e02c29d4d Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..1983aee637 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..dddef4618f Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..eb1d819db7 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..6a6c411c70 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..a6c5bda63c Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..cb47277376 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..8ea549b1a5 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..76aadfb61b Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..ee73ad63cb Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..970abdc988 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..623a43fdb3 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..7a41d1af85 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..22ac9f6372 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..b4d156533a Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..8688994530 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..915169c81e Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..9707b0af89 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..f7b35f8cfe Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..6408b8ee5c Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..3cc523b267 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..d6f2c381fd Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..6b082bfab7 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..c1afaa6b4c Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..825f411f8c Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..114524ec78 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..bde567952a Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..ce400bc94a Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..24cf97f830 Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..50cca1514b Binary files /dev/null and b/theme-orange-compact/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png differ 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 0f8c9e6bf8..1e023fdf39 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 @@ -44,6 +44,7 @@ class OrangeDrawableResources : OudsDrawableResources { override val button = Button() override val checkbox = Checkbox() override val chip = Chip() + override val controlItem = ControlItem() override val link = Link() override val radioButton = RadioButton() override val switch = Switch() @@ -87,6 +88,11 @@ class OrangeDrawableResources : OudsDrawableResources { override val tick = R.drawable.ic_orange_component_chip_tick } + class ControlItem : OudsDrawableResources.Component.ControlItem { + override val next = R.drawable.ic_orange_component_control_item_next + override val previous = R.drawable.ic_orange_component_control_item_previous + } + class Link : OudsDrawableResources.Component.Link { override val externalLink = R.drawable.ic_orange_component_link_external_link override val next = R.drawable.ic_orange_component_link_next @@ -114,6 +120,7 @@ class OrangeDrawableResources : OudsDrawableResources { class Actions : OudsDrawableResources.Functional.Actions { override val deleteCrossRound = R.drawable.ic_orange_functional_actions_delete_cross_round + override val externalLink = R.drawable.ic_orange_functional_actions_external_link } class Navigation : OudsDrawableResources.Functional.Navigation { diff --git a/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt b/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt index 19e25a933b..35436b1c20 100644 --- a/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt +++ b/theme-orange/src/main/java/com/orange/ouds/theme/orange/OrangeTheme.kt @@ -121,13 +121,15 @@ const val ORANGE_THEME_NAME = "Orange" * @param roundedCornerTextInputs Whether text inputs have rounded corners. * @param roundedCornerAlertMessages Whether alert messages have rounded corners. * @param roundedCornerProgressIndicators Whether progress indicators have rounded corners. + * @param roundedCornerCardItems Whether card items have rounded corners. */ open class OrangeTheme @JvmOverloads constructor( private val orangeFontFamily: OrangeFontFamily, private val roundedCornerButtons: Boolean = false, private val roundedCornerTextInputs: Boolean = false, private val roundedCornerAlertMessages: Boolean = false, - private val roundedCornerProgressIndicators: Boolean = false + private val roundedCornerProgressIndicators: Boolean = false, + private val roundedCornerCardItems: Boolean = false ) : OudsThemeContract { /** @@ -157,7 +159,7 @@ open class OrangeTheme @JvmOverloads constructor( } override val settings: OudsThemeSettings - get() = OudsThemeSettings(roundedCornerButtons, roundedCornerTextInputs, roundedCornerAlertMessages, roundedCornerProgressIndicators) + get() = OudsThemeSettings(roundedCornerButtons, roundedCornerTextInputs, roundedCornerAlertMessages, roundedCornerProgressIndicators, roundedCornerCardItems) override val colorTokens: OudsColorSemanticTokens get() = OrangeColorSemanticTokens() diff --git a/theme-orange/src/main/res/drawable/ic_orange_component_control_item_next.xml b/theme-orange/src/main/res/drawable/ic_orange_component_control_item_next.xml new file mode 100644 index 0000000000..076e68b57d --- /dev/null +++ b/theme-orange/src/main/res/drawable/ic_orange_component_control_item_next.xml @@ -0,0 +1,20 @@ + + + + diff --git a/theme-orange/src/main/res/drawable/ic_orange_component_control_item_previous.xml b/theme-orange/src/main/res/drawable/ic_orange_component_control_item_previous.xml new file mode 100644 index 0000000000..621475bb42 --- /dev/null +++ b/theme-orange/src/main/res/drawable/ic_orange_component_control_item_previous.xml @@ -0,0 +1,20 @@ + + + + diff --git a/theme-orange/src/main/res/drawable/ic_orange_functional_actions_external_link.xml b/theme-orange/src/main/res/drawable/ic_orange_functional_actions_external_link.xml new file mode 100644 index 0000000000..e8baeae38e --- /dev/null +++ b/theme-orange/src/main/res/drawable/ic_orange_functional_actions_external_link.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..b861324efd Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..22e19f8660 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..d5fe32d6e5 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..dc97b1ca3f Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..d9e7adf82f Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..f4a0aa17d7 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..f8478007a2 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..7a61b9d88e Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..057947e457 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..110f5fc68a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..3832566535 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..8941db6b49 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..a19d4c1606 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..737b988fb0 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..8d163bb0dd Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..781b90ad00 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..e41fed356b Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..e47e4f51f5 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..b289e584b1 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..e8fd99baef Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..55819abda4 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..4b6cf45c2a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..0545b65d29 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..36b78b6d8b Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..31de343c8c Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..f93f0c517a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..79ca068e7a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..f4bfc810f6 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..22445161fd Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png new file mode 100644 index 0000000000..53e3423042 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..44eb572a4b Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..43233236bb Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..07a54ea857 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..025eda3f70 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..85139c66b3 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..6a08ce7a81 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..9b67a7a13a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..408fc0a41b Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..e3491b0274 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..0e17a7243d Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..ad285876c0 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..98304e8c21 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..92e8bf17d0 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..cff220237e Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..2a76d7229f Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..bcfc8a0d93 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..59e0494494 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..6e50d3124f Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..5e0feb6cbc Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..f8cb3e49d0 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..aceb088588 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..b48d277233 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..7908364d6c Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..d9ecda1f06 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..a429819d22 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..ac44e0a93a Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..4a3145c2b3 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..ea66cf695d Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..51d52bc411 Binary files /dev/null and b/theme-orange/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_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 149a7ed43b..2500fb0a86 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 @@ -39,6 +39,7 @@ internal class SoshDrawableResources : OudsDrawableResources { override val button = Button() override val checkbox = Checkbox() override val chip = Chip() + override val controlItem = ControlItem() override val link = Link() override val radioButton = RadioButton() override val switch = Switch() @@ -82,6 +83,11 @@ internal class SoshDrawableResources : OudsDrawableResources { override val tick = R.drawable.ic_sosh_component_chip_tick } + class ControlItem : OudsDrawableResources.Component.ControlItem { + override val next = R.drawable.ic_sosh_component_control_item_next + override val previous = R.drawable.ic_sosh_component_control_item_previous + } + class Link : OudsDrawableResources.Component.Link { override val externalLink = R.drawable.ic_sosh_component_link_external_link override val next = R.drawable.ic_sosh_component_link_next @@ -109,6 +115,7 @@ internal class SoshDrawableResources : OudsDrawableResources { class Actions : OudsDrawableResources.Functional.Actions { override val deleteCrossRound = R.drawable.ic_sosh_functional_actions_delete_cross_round + override val externalLink = R.drawable.ic_sosh_functional_actions_external_link } class Navigation : OudsDrawableResources.Functional.Navigation { diff --git a/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/tokens/components/SoshComponentsTokens.kt b/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/tokens/components/SoshComponentsTokens.kt index 512fcfb055..aeab00d2d0 100644 --- a/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/tokens/components/SoshComponentsTokens.kt +++ b/theme-sosh/src/main/java/com/orange/ouds/theme/sosh/tokens/components/SoshComponentsTokens.kt @@ -51,8 +51,8 @@ internal data class SoshComponentsTokens( override val icon: OudsIconTokens = SoshIconTokens(), override val inputTag: OudsInputTagTokens = SoshInputTagTokens(), override val link: OudsLinkTokens = SoshLinkTokens(), - override val listItem: OudsListItemTokens = SoshListItemTokens(), override val linkMonochrome: OudsLinkMonoTokens = SoshLinkMonoTokens(), + override val listItem: OudsListItemTokens = SoshListItemTokens(), override val pinCodeInput: OudsPinCodeInputTokens = SoshPinCodeInputTokens(), override val progressIndicator: OudsProgressIndicatorTokens = SoshProgressIndicatorTokens(), override val progressIndicatorMonochrome: OudsProgressIndicatorMonoTokens = SoshProgressIndicatorMonoTokens(), diff --git a/theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_next.xml b/theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_next.xml new file mode 100644 index 0000000000..9b7c0ae67f --- /dev/null +++ b/theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_next.xml @@ -0,0 +1,21 @@ + + + + diff --git a/theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_previous.xml b/theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_previous.xml new file mode 100644 index 0000000000..2ba04b72de --- /dev/null +++ b/theme-sosh/src/main/res/drawable/ic_sosh_component_control_item_previous.xml @@ -0,0 +1,21 @@ + + + + diff --git a/theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_external_link.xml b/theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_external_link.xml new file mode 100644 index 0000000000..ea2b00e9ca --- /dev/null +++ b/theme-sosh/src/main/res/drawable/ic_sosh_functional_actions_external_link.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..113399b405 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..21ddec65fe Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..bf53d4a7e3 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..4793e52799 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..5c9ec5fdec Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..050eacfe3d Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..cc01577c9c Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..1d92939465 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..4ff2af2e4c Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..18490f478a Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..62c263b60a Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..f53b8c5558 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..5aab16d5ae Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..0dcbe1fe95 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..ecbe574230 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..8c158161bc Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..338248ca94 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..b992f423cb Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..b055e22ca5 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..6df2b4321e Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..f0cbc6ba53 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..f1f13313d9 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..0bdee3ed5b Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..1a40f43a04 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..5ac35b629a Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..5ef7c442f5 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..d9290bffab Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..45e98beaa8 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..55667322d5 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png new file mode 100644 index 0000000000..c7e98bdaf7 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..16d5a977ef Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..8e4b046091 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..3d62098d17 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..9aad96e93a Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..ce46aaafd0 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..21115e3f17 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..5e3efbfce6 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..2fed8f1b96 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..351de8d284 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..98f8081f6c Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..e83b0772ae Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..eda3c789f2 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..6c6db6bfa4 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..263e8079d9 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..5782ce016e Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..9295f52323 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..2ffacb4a5d Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..99d6f81712 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..d9fb35c2c0 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..449e99ec0a Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..791aa3f003 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..3fc13eb070 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..c68985ee22 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..7af83e7db4 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..2d687971b0 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..f2c71c521c Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..ea7689fd38 Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..9fa18b00df Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..dd4334061f Binary files /dev/null and b/theme-sosh/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_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 f40ae2f727..80e9635fc3 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 @@ -39,6 +39,7 @@ internal class WireframeDrawableResources : OudsDrawableResources { override val button = Button() override val checkbox = Checkbox() override val chip = Chip() + override val controlItem = ControlItem() override val link = Link() override val radioButton = RadioButton() override val switch = Switch() @@ -82,6 +83,11 @@ internal class WireframeDrawableResources : OudsDrawableResources { override val tick = R.drawable.ic_wireframe_component_chip_tick } + class ControlItem : OudsDrawableResources.Component.ControlItem { + override val next = R.drawable.ic_wireframe_component_control_item_next + override val previous = R.drawable.ic_wireframe_component_control_item_previous + } + class Link : OudsDrawableResources.Component.Link { override val externalLink = R.drawable.ic_wireframe_component_link_external_link override val next = R.drawable.ic_wireframe_component_link_next @@ -109,6 +115,7 @@ internal class WireframeDrawableResources : OudsDrawableResources { class Actions : OudsDrawableResources.Functional.Actions { override val deleteCrossRound = R.drawable.ic_wireframe_functional_actions_delete_cross_round + override val externalLink = R.drawable.ic_wireframe_functional_actions_external_link } class Navigation : OudsDrawableResources.Functional.Navigation { diff --git a/theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_next.xml b/theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_next.xml new file mode 100644 index 0000000000..8a6496fd42 --- /dev/null +++ b/theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_next.xml @@ -0,0 +1,20 @@ + + + + diff --git a/theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_previous.xml b/theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_previous.xml new file mode 100644 index 0000000000..f8da7ee5e6 --- /dev/null +++ b/theme-wireframe/src/main/res/drawable/ic_wireframe_component_control_item_previous.xml @@ -0,0 +1,20 @@ + + + + diff --git a/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_external_link.xml b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_external_link.xml new file mode 100644 index 0000000000..17a8ce01df --- /dev/null +++ b/theme-wireframe/src/main/res/drawable/ic_wireframe_functional_actions_external_link.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..1403a4c934 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..57fd1aa506 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..4927969703 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..2ac25e3ce1 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..f73a72e330 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..0ec4f8a212 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..26411ab17a Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..8aae411e2d Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..432256a99c Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..90638d05d9 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..ff0591db16 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..2d9556d350 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..6e2be6f39f Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..ff6c05dffc Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..22a3a3d141 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..42ba79df7d Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..f62cffbcfd Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..e4e11951a1 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..6bd45ed8e0 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..38f0ba750c Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..7cd0929864 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..20a4b23771 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..4dd99f8260 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..2f12a5e543 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..8cb010448f Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..3ce76ed1f4 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..e67ae2a9af Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..b7c666a088 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..826c2ff2f6 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsListItemTest$WithUntintedIcon_takeLightThemeSnapshot.png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png new file mode 100644 index 0000000000..495e1fb510 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot.png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..4b11b140f5 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..f125dca5e1 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$NavigationWithRoundedCorners_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..51bc55062e Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..8f9da388a0 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..8810623c68 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..e71386e955 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..f4f91ea26e Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..3d1cbb5b0d Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png new file mode 100644 index 0000000000..02fc71890b Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot.png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..d923555480 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..a6445c6220 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$StaticWithRoundedCorners_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..874a0479cb Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..ec53601725 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..76e8a23998 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..4b938f0e32 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..21c0004863 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..39f608843e Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallCardItemTest$Static_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..63c655efa6 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..2fe968ed4f Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..07b9509fcb Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..b6ce1aff26 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..ba373f578e Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..3c6dd872d6 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Navigation_takeLightThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png new file mode 100644 index 0000000000..99db11c112 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png new file mode 100644 index 0000000000..3740e379c5 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png new file mode 100644 index 0000000000..c5f37ea36b Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeDarkThemeSnapshot[2].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png new file mode 100644 index 0000000000..ea9041cfc6 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[0].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png new file mode 100644 index 0000000000..c3ed569189 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[1].png differ diff --git a/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png new file mode 100644 index 0000000000..f354aaa3a2 Binary files /dev/null and b/theme-wireframe/src/test/snapshots/images/com.orange.ouds.core.test_OudsSmallListItemTest$Static_takeLightThemeSnapshot[2].png differ