From 623c5dc26bdf365f5cb6d6245ab27bbb94b6c646 Mon Sep 17 00:00:00 2001 From: Florent Maitre Date: Fri, 4 Aug 2023 15:23:56 +0200 Subject: [PATCH] [#578] Update Gradle to version 8.1 --- app/build.gradle.kts | 1 + .../com/orange/ods/app/ui/MainTopAppBar.kt | 4 +- .../ods/app/ui/about/AboutFileScreen.kt | 7 ++-- .../orange/ods/app/ui/about/AboutScreen.kt | 12 +++--- .../ui/components/ComponentDetailScreen.kt | 4 +- .../ods/app/ui/components/ComponentsScreen.kt | 8 ++-- .../appbars/top/ComponentTopAppBar.kt | 28 ++++++++----- .../ui/components/banners/ComponentBanners.kt | 6 +-- .../ComponentBottomNavigation.kt | 6 +-- .../ui/components/buttons/ButtonsContained.kt | 13 ++++-- .../ui/components/buttons/ButtonsOutlined.kt | 13 ++++-- .../app/ui/components/buttons/ButtonsText.kt | 13 ++++-- .../ui/components/buttons/ComponentButtons.kt | 10 ++--- .../components/buttons/icons/ButtonsIcon.kt | 13 ++++-- .../buttons/icons/ButtonsIconToggle.kt | 13 ++++-- .../buttons/icons/ButtonsIconToggleGroup.kt | 11 +++-- .../buttons/icons/ComponentButtonsIcons.kt | 2 +- .../app/ui/components/cards/CardHorizontal.kt | 4 +- .../ods/app/ui/components/cards/CardSmall.kt | 6 +-- .../cards/CardVerticalHeaderFirst.kt | 4 +- .../cards/CardVerticalImageFirst.kt | 4 +- .../app/ui/components/cards/ComponentCard.kt | 4 +- .../checkboxes/ComponentCheckboxes.kt | 4 +- .../ods/app/ui/components/chips/Chip.kt | 13 +++--- .../ods/app/ui/components/chips/ChipFilter.kt | 8 ++-- .../ui/components/dialogs/ComponentDialog.kt | 2 +- .../ComponentFloatingActionButton.kt | 8 ++-- .../imageitem/ComponentImageItem.kt | 10 ++--- .../app/ui/components/lists/ComponentLists.kt | 10 ++--- .../app/ui/components/menus/MenuDropdown.kt | 13 +++--- .../components/menus/MenuExposedDropdown.kt | 9 ++-- .../ComponentModalDrawers.kt | 6 +-- .../components/progress/ProgressCircular.kt | 4 +- .../ui/components/progress/ProgressLinear.kt | 6 +-- .../radiobuttons/ComponentRadioButtons.kt | 4 +- .../sheets/ComponentSheetsBottom.kt | 8 ++-- .../ui/components/sliders/ComponentSliders.kt | 4 +- .../snackbars/ComponentSnackbars.kt | 9 ++-- .../components/switches/ComponentSwitches.kt | 4 +- .../app/ui/components/tabs/ComponentTabs.kt | 4 +- .../textfields/ComponentTextField.kt | 14 +++---- .../app/ui/components/textfields/TextField.kt | 4 +- .../textfields/TextFieldPassword.kt | 2 +- .../utilities/ComponentLaunchContentColumn.kt | 16 ++++---- .../ods/app/ui/guidelines/GuidelinesScreen.kt | 4 +- .../guidelines/color/GuidelineColorScreen.kt | 41 ++++++++++--------- .../ui/guidelines/spacing/GuidelineSpacing.kt | 15 ++++--- .../spacing/GuidelineSpacingScreen.kt | 9 ++-- .../typography/GuidelineTypographyScreen.kt | 14 +++---- .../composable/CodeImplementation.kt | 8 ++-- .../composable/DetailScreenHeader.kt | 7 ++-- .../ods/app/ui/utilities/composable/Texts.kt | 8 ++-- buildSrc/build.gradle.kts | 12 +++--- .../kotlin/com/orange/ods/gradle/Versions.kt | 2 +- buildSrc/src/main/kotlin/library.gradle.kts | 1 - changelog.md | 2 +- docs/components/Chips.md | 2 +- docs/components/Snackbars.md | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- lib/build.gradle.kts | 1 + .../ods/theme/guideline/OdsGuideline.kt | 27 ++++++------ theme-orange/build.gradle.kts | 1 + .../orange/guideline/OrangeGuidelineColors.kt | 8 ++-- 63 files changed, 282 insertions(+), 234 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 03c327bcd..e808840a1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -93,6 +93,7 @@ android { } buildFeatures { + buildConfig = true compose = true viewBinding = true dataBinding = true diff --git a/app/src/main/java/com/orange/ods/app/ui/MainTopAppBar.kt b/app/src/main/java/com/orange/ods/app/ui/MainTopAppBar.kt index 5dc4bd3d7..ce627b0f4 100644 --- a/app/src/main/java/com/orange/ods/app/ui/MainTopAppBar.kt +++ b/app/src/main/java/com/orange/ods/app/ui/MainTopAppBar.kt @@ -216,8 +216,8 @@ private fun ChangeThemeDialog(themeManager: ThemeManager, dismissDialog: () -> U OdsTextH6( text = stringResource(R.string.top_app_bar_action_change_theme_desc), modifier = Modifier - .padding(top = dimensionResource(R.dimen.spacing_m), bottom = dimensionResource(id = R.dimen.spacing_s)) - .padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin)) + .padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_m), bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) + .padding(horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin)) ) themeManager.themeConfigurations.forEach { themeConfiguration -> OdsListItem( diff --git a/app/src/main/java/com/orange/ods/app/ui/about/AboutFileScreen.kt b/app/src/main/java/com/orange/ods/app/ui/about/AboutFileScreen.kt index 421f7736b..34eba1e21 100644 --- a/app/src/main/java/com/orange/ods/app/ui/about/AboutFileScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/about/AboutFileScreen.kt @@ -21,13 +21,12 @@ import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.viewinterop.AndroidView -import com.orange.ods.compose.theme.OdsTheme -import com.orange.ods.app.R import com.orange.ods.app.ui.LocalMainTopAppBarManager import com.orange.ods.app.ui.utilities.Markdown import com.orange.ods.app.ui.utilities.extension.injectLightDarkModeCss import com.orange.ods.app.ui.utilities.extension.isDarkModeEnabled import com.orange.ods.app.ui.utilities.launchUrl +import com.orange.ods.compose.theme.OdsTheme import java.io.BufferedReader import java.nio.charset.StandardCharsets @@ -42,8 +41,8 @@ fun AboutFileScreen(aboutItemId: Long) { val context = LocalContext.current val configuration = LocalConfiguration.current val colors = OdsTheme.colors - val horizontalPadding = dimensionResource(id = R.dimen.screen_horizontal_margin).value - val verticalPadding = dimensionResource(id = R.dimen.screen_vertical_margin).value + val horizontalPadding = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin).value + val verticalPadding = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin).value AndroidView( factory = { WebView(context).apply { diff --git a/app/src/main/java/com/orange/ods/app/ui/about/AboutScreen.kt b/app/src/main/java/com/orange/ods/app/ui/about/AboutScreen.kt index d732da98e..31aaf6a03 100644 --- a/app/src/main/java/com/orange/ods/app/ui/about/AboutScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/about/AboutScreen.kt @@ -45,7 +45,7 @@ fun AboutScreen(onAboutItemClick: (Long) -> Unit) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(bottom = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(bottom = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { val context = LocalContext.current Image( @@ -55,22 +55,22 @@ fun AboutScreen(onAboutItemClick: (Long) -> Unit) { contentScale = ContentScale.Crop, contentDescription = null ) - Column(Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin))) { + Column(Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin))) { OdsTextH4( text = stringResource(id = R.string.about_app_name), - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xl)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xl)) ) OdsTextCaption( text = getVersion(context), - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)) ) OdsTextCaption( text = stringResource(id = R.string.about_description), - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)) ) } - Spacer(modifier = Modifier.height(dimensionResource(id = R.dimen.spacing_m))) + Spacer(modifier = Modifier.height(dimensionResource(id = com.orange.ods.R.dimen.spacing_m))) for (aboutItem in aboutItems) { OdsListItem(text = stringResource(id = aboutItem.titleRes), modifier = Modifier.clickable { diff --git a/app/src/main/java/com/orange/ods/app/ui/components/ComponentDetailScreen.kt b/app/src/main/java/com/orange/ods/app/ui/components/ComponentDetailScreen.kt index e3d597023..7b6abd6a0 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/ComponentDetailScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/ComponentDetailScreen.kt @@ -40,7 +40,7 @@ fun ComponentDetailScreen( Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(bottom = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(bottom = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { DetailScreenHeader( imageRes = DrawableManager.getDrawableResIdForCurrentTheme(resId = component.imageRes), @@ -48,7 +48,7 @@ fun ComponentDetailScreen( descriptionRes = component.descriptionRes ) Column( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_m)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { if (component.variants.isEmpty()) { ComponentDetailLinkItem( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/ComponentsScreen.kt b/app/src/main/java/com/orange/ods/app/ui/components/ComponentsScreen.kt index 873ffc9d1..e0b9cbc42 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/ComponentsScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/ComponentsScreen.kt @@ -27,10 +27,10 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import com.orange.ods.compose.component.card.OdsSmallCard import com.orange.ods.app.R import com.orange.ods.app.ui.LocalMainTopAppBarManager import com.orange.ods.app.ui.utilities.DrawableManager +import com.orange.ods.compose.component.card.OdsSmallCard import com.orange.ods.utilities.extension.orElse @Composable @@ -42,12 +42,12 @@ fun ComponentsScreen(onComponentClick: (Long) -> Unit) { modifier = Modifier .fillMaxSize() .verticalScroll(scrollState) - .padding(dimensionResource(id = R.dimen.spacing_m)), - verticalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)) + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), + verticalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { components.sortedBy { context.getString(it.titleRes) }.chunked(2).forEach { rowCards -> Row( - horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)), + horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), ) { ComponentCard(component = rowCards[0], onComponentClick) if (rowCards.size == 2) { diff --git a/app/src/main/java/com/orange/ods/app/ui/components/appbars/top/ComponentTopAppBar.kt b/app/src/main/java/com/orange/ods/app/ui/components/appbars/top/ComponentTopAppBar.kt index dbf282dd2..824632300 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/appbars/top/ComponentTopAppBar.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/appbars/top/ComponentTopAppBar.kt @@ -86,7 +86,7 @@ fun ComponentTopAppBar(variant: Variant) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)), + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)), horizontalAlignment = Alignment.CenterHorizontally ) { if (isLargeCollapsible) { @@ -94,11 +94,11 @@ fun ComponentTopAppBar(variant: Variant) { BlinkingChevronDown( modifier = Modifier .rotate(180f) - .padding(vertical = dimensionResource(id = R.dimen.spacing_s)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) ) } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), contentBackground = false ) { CodeBackgroundColumn { @@ -145,18 +145,24 @@ fun ComponentTopAppBar(variant: Variant) { } if (isLargeCollapsible) { OdsTextBody2( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s), bottom = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding( + top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s), + bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs) + ), text = stringResource(id = R.string.component_app_bars_top_large_code_collapsing) ) OdsTextCaption( - modifier = Modifier.padding(bottom = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding(bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)), text = stringResource(id = R.string.component_app_bars_top_large_code_collapsing_step_1) ) CodeBackgroundColumn { TechnicalText(text = "val topBarScrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(rememberTopAppBarState())") } OdsTextCaption( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s), bottom = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding( + top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s), + bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs) + ), text = stringResource(id = R.string.component_app_bars_top_large_code_collapsing_step_2) ) CodeBackgroundColumn { @@ -167,7 +173,7 @@ fun ComponentTopAppBar(variant: Variant) { } if (isLargeCollapsible) { - BlinkingChevronDown(modifier = Modifier.padding(vertical = dimensionResource(id = R.dimen.spacing_s))) + BlinkingChevronDown(modifier = Modifier.padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s))) OdsTextBody2(text = stringResource(id = R.string.component_app_bars_top_large_scrolling_downward)) } } @@ -182,7 +188,7 @@ private fun CustomizationBottomSheetContent(customizationState: TopAppBarCustomi Subtitle(textRes = R.string.component_app_bars_top_large_scroll_behavior, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = scrollBehavior, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_app_bars_top_large_scroll_behavior_none, value = TopAppBarCustomizationState.ScrollBehavior.None) @@ -199,7 +205,7 @@ private fun CustomizationBottomSheetContent(customizationState: TopAppBarCustomi ) ) ComponentCountRow( - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), title = stringResource(id = R.string.component_app_bars_top_actions_count), count = actionCount, minusIconContentDescription = stringResource(id = R.string.component_app_bars_top_remove_action), @@ -219,8 +225,8 @@ private fun CustomizationBottomSheetContent(customizationState: TopAppBarCustomi OdsChoiceChipsFlowRow( selectedChip = title, modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.spacing_m)) - .padding(bottom = dimensionResource(id = R.dimen.spacing_s)), + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) + .padding(bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_app_bars_top_large_title_one_line, value = TopAppBarCustomizationState.Title.Short) diff --git a/app/src/main/java/com/orange/ods/app/ui/components/banners/ComponentBanners.kt b/app/src/main/java/com/orange/ods/app/ui/components/banners/ComponentBanners.kt index e8e3a3c84..f209e18fb 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/banners/ComponentBanners.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/banners/ComponentBanners.kt @@ -61,7 +61,7 @@ fun ComponentBanners() { count = textLinesCount, minusIconContentDescription = stringResource(id = R.string.component_remove_action_button), plusIconContentDescription = stringResource(id = R.string.component_add_action_button), - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), minCount = BannerCustomizationState.MinTextCount, maxCount = BannerCustomizationState.MaxTextCount ) @@ -70,7 +70,7 @@ fun ComponentBanners() { count = buttonsCount, minusIconContentDescription = stringResource(id = R.string.component_banner_remove_action_button), plusIconContentDescription = stringResource(id = R.string.component_banner_add_action_button), - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), minCount = BannerCustomizationState.MinActionButtonCount, maxCount = BannerCustomizationState.MaxActionButtonCount ) @@ -130,7 +130,7 @@ fun ComponentBanners() { ) CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/bottomnavigation/ComponentBottomNavigation.kt b/app/src/main/java/com/orange/ods/app/ui/components/bottomnavigation/ComponentBottomNavigation.kt index 963bb55bf..903098efe 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/bottomnavigation/ComponentBottomNavigation.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/bottomnavigation/ComponentBottomNavigation.kt @@ -58,7 +58,7 @@ fun ComponentBottomNavigation() { bottomSheetScaffoldState = rememberBottomSheetScaffoldState(), bottomSheetContent = { ComponentCountRow( - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), title = stringResource(id = R.string.component_bottom_navigation_navigation_item_count), count = selectedNavigationItemCount, minusIconContentDescription = stringResource(id = R.string.component_bottom_navigation_remove_item), @@ -70,7 +70,7 @@ fun ComponentBottomNavigation() { Column( modifier = Modifier .fillMaxSize() - .padding(top = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) .verticalScroll(rememberScrollState()) ) { OdsBottomNavigation { @@ -94,7 +94,7 @@ fun ComponentBottomNavigation() { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { FunctionCallCode(name = OdsComposable.OdsBottomNavigation.name) { navigationItems.take(2).forEach { item -> diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsContained.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsContained.kt index e0c2276e5..5cf3bf2fe 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsContained.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsContained.kt @@ -45,7 +45,7 @@ fun ButtonsContained(customizationState: ButtonCustomizationState) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { with(buttonStyle.value) { @@ -63,7 +63,7 @@ fun ButtonsContained(customizationState: ButtonCustomizationState) { fullScreenWidth = hasFullScreenWidth ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) InvertedBackgroundColumn { ContainedButton( @@ -76,7 +76,7 @@ fun ButtonsContained(customizationState: ButtonCustomizationState) { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( @@ -106,7 +106,12 @@ private fun ContainedButton( val text = stringResource(if (enabled) R.string.component_state_enabled else R.string.component_state_disabled) val iconId = R.drawable.ic_coffee - Box(modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin), vertical = dimensionResource(R.dimen.spacing_m))) { + Box( + modifier = Modifier.padding( + horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(com.orange.ods.R.dimen.spacing_m) + ) + ) { UiFramework( compose = { OdsButton( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsOutlined.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsOutlined.kt index 370f13845..f53f929f3 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsOutlined.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsOutlined.kt @@ -41,19 +41,19 @@ fun ButtonsOutlined(customizationState: ButtonCustomizationState) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { OutlinedButton(leadingIcon = hasLeadingIcon, enabled = isEnabled, fullScreenWidth = hasFullScreenWidth) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) InvertedBackgroundColumn { OutlinedButton(leadingIcon = hasLeadingIcon, enabled = isEnabled, fullScreenWidth = hasFullScreenWidth, displaySurface = displaySurface) } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( @@ -80,7 +80,12 @@ private fun OutlinedButton( val text = stringResource(if (enabled) R.string.component_state_enabled else R.string.component_state_disabled) val iconId = R.drawable.ic_coffee - Box(modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin), vertical = dimensionResource(R.dimen.spacing_m))) { + Box( + modifier = Modifier.padding( + horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(com.orange.ods.R.dimen.spacing_m) + ) + ) { UiFramework( compose = { OdsOutlinedButton( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsText.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsText.kt index 005ab4f37..af60e59f1 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsText.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ButtonsText.kt @@ -44,7 +44,7 @@ fun ButtonsText(customizationState: ButtonCustomizationState) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { Title( textRes = if (textButtonStyle.value == OdsTextButtonStyle.Default) R.string.component_button_style_default else R.string.component_button_style_primary, @@ -58,7 +58,7 @@ fun ButtonsText(customizationState: ButtonCustomizationState) { fullScreenWidth = hasFullScreenWidth ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) InvertedBackgroundColumn { TextButton( @@ -71,7 +71,7 @@ fun ButtonsText(customizationState: ButtonCustomizationState) { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( @@ -101,7 +101,12 @@ private fun TextButton( val text = stringResource(if (enabled) R.string.component_state_enabled else R.string.component_state_disabled) val iconId = R.drawable.ic_coffee - Box(modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin), vertical = dimensionResource(R.dimen.spacing_m))) { + Box( + modifier = Modifier.padding( + horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(com.orange.ods.R.dimen.spacing_m) + ) + ) { UiFramework( compose = { OdsTextButton( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ComponentButtons.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ComponentButtons.kt index 22abb3fd9..40d230670 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/ComponentButtons.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/ComponentButtons.kt @@ -62,7 +62,7 @@ fun ComponentButtons(variant: Variant) { Subtitle(textRes = R.string.component_button_style_functional, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = buttonStyle, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_button_style_functional_positive, value = OdsButtonStyle.FunctionalPositive) @@ -72,7 +72,7 @@ fun ComponentButtons(variant: Variant) { Subtitle(textRes = R.string.component_style, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = textButtonStyle, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_button_style_primary, value = OdsTextButtonStyle.Primary) @@ -125,13 +125,13 @@ fun InvertedBackgroundColumn( modifier = Modifier .fillMaxWidth() .background(color = backgroundColor) - .padding(bottom = dimensionResource(R.dimen.spacing_m)), + .padding(bottom = dimensionResource(com.orange.ods.R.dimen.spacing_m)), horizontalAlignment = horizontalAlignment ) { OdsTextBody2( modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.spacing_m)) - .padding(top = dimensionResource(id = R.dimen.spacing_s)) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) .fillMaxWidth() .align(Alignment.Start), text = stringResource(id = textRes), diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIcon.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIcon.kt index b2b120f52..b37c67633 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIcon.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIcon.kt @@ -45,7 +45,7 @@ fun ButtonsIcon(customizationState: ButtonIconCustomizationState) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { Row( modifier = Modifier.fillMaxWidth(), @@ -56,7 +56,7 @@ fun ButtonsIcon(customizationState: ButtonIconCustomizationState) { ) } - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) InvertedBackgroundColumn(horizontalAlignment = Alignment.CenterHorizontally) { IconButton( @@ -66,7 +66,7 @@ fun ButtonsIcon(customizationState: ButtonIconCustomizationState) { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( @@ -92,7 +92,12 @@ private fun IconButton( val contentDescription = stringResource(id = R.string.component_button_icon_search_desc) val onClick = { clickOnElement(context, context.getString(R.string.component_button_icon)) } - Box(modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin), vertical = dimensionResource(R.dimen.spacing_m))) { + Box( + modifier = Modifier.padding( + horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(com.orange.ods.R.dimen.spacing_m) + ) + ) { UiFramework( compose = { OdsIconButton( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggle.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggle.kt index 774e262b0..98c66411a 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggle.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggle.kt @@ -48,7 +48,7 @@ fun ButtonsIconToggle(customizationState: ButtonIconCustomizationState) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { val onCheckedChange: (Boolean) -> Unit = { checked -> buttonCheckedState.value = checked } @@ -63,7 +63,7 @@ fun ButtonsIconToggle(customizationState: ButtonIconCustomizationState) { ) } - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) InvertedBackgroundColumn(horizontalAlignment = Alignment.CenterHorizontally) { IconToggleButton( @@ -75,7 +75,7 @@ fun ButtonsIconToggle(customizationState: ButtonIconCustomizationState) { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( @@ -105,7 +105,12 @@ private fun IconToggleButton( val checkedIconResId = R.drawable.ic_heart val iconContentDescription = stringResource(id = R.string.component_button_icon_toggle_favorite_icon_desc) - Box(modifier = Modifier.padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin), vertical = dimensionResource(R.dimen.spacing_m))) { + Box( + modifier = Modifier.padding( + horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(com.orange.ods.R.dimen.spacing_m) + ) + ) { UiFramework( compose = { OdsIconToggleButton( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggleGroup.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggleGroup.kt index b2f2ca8be..ba3a5e217 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggleGroup.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ButtonsIconToggleGroup.kt @@ -26,7 +26,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.res.painterResource -import com.orange.ods.app.R import com.orange.ods.app.databinding.OdsIconToggleButtonsGroupBinding import com.orange.ods.app.domain.recipes.LocalRecipes import com.orange.ods.app.ui.UiFramework @@ -51,7 +50,7 @@ fun ButtonsIconToggleGroup(customizationState: ButtonIconCustomizationState) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) ) { ToggleButtonsRow( @@ -61,7 +60,7 @@ fun ButtonsIconToggleGroup(customizationState: ButtonIconCustomizationState) { toggleCount = toggleCount.value ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) InvertedBackgroundColumn { ToggleButtonsRow( @@ -74,7 +73,7 @@ fun ButtonsIconToggleGroup(customizationState: ButtonIconCustomizationState) { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), xmlAvailable = true ) { FunctionCallCode( @@ -109,8 +108,8 @@ private fun ToggleButtonsRow( Row( modifier = Modifier .fillMaxWidth() - .padding(top = dimensionResource(R.dimen.spacing_m)) - .padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin)), + .padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_m)) + .padding(horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin)), horizontalArrangement = Arrangement.Center ) { val buttons = iconToggleButtons.take(toggleCount) diff --git a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ComponentButtonsIcons.kt b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ComponentButtonsIcons.kt index 0b44b9884..baf3e9b3a 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ComponentButtonsIcons.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/buttons/icons/ComponentButtonsIcons.kt @@ -35,7 +35,7 @@ fun ComponentButtonsIcons(variant: Variant) { bottomSheetContent = { if (variant == Variant.ButtonsIconToggleGroup) { ComponentCountRow( - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), title = stringResource(id = R.string.component_button_icon_toggle_count), count = toggleCount, minusIconContentDescription = stringResource(id = R.string.component_button_icon_toggle_remove), diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt index 0c40a9230..eb8940682 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardHorizontal.kt @@ -43,7 +43,7 @@ fun CardHorizontal(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() - .padding(dimensionResource(id = R.dimen.spacing_m)) + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) .verticalScroll(state = rememberScrollState()), ) { val button1Text = stringResource(id = R.string.component_element_button1) @@ -70,7 +70,7 @@ fun CardHorizontal(customizationState: CardCustomizationState) { dividerEnabled = hasDivider ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt index f688b8d91..44129eb7b 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardSmall.kt @@ -46,13 +46,13 @@ fun CardSmall(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() - .padding(dimensionResource(id = R.dimen.spacing_m)) + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) .verticalScroll(state = rememberScrollState()), ) { Row( modifier = Modifier .fillMaxSize(), - horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)), + horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), ) { val cardText = stringResource(id = R.string.component_card_element_card) @@ -72,7 +72,7 @@ fun CardSmall(customizationState: CardCustomizationState) { Box(modifier = Modifier.weight(0.5f)) } - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt index 8bb24d2f6..38fe6e7b7 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalHeaderFirst.kt @@ -45,7 +45,7 @@ fun CardVerticalHeaderFirst(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() - .padding(dimensionResource(id = R.dimen.spacing_m)) + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) .verticalScroll(state = rememberScrollState()), ) { val button1Text = stringResource(id = R.string.component_element_button1) @@ -75,7 +75,7 @@ fun CardVerticalHeaderFirst(customizationState: CardCustomizationState) { onButton2Click = { clickOnElement(context, button2Text) } ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt index 2910678f6..7e6f5b921 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/CardVerticalImageFirst.kt @@ -43,7 +43,7 @@ fun CardVerticalImageFirst(customizationState: CardCustomizationState) { Column( modifier = Modifier .fillMaxSize() - .padding(dimensionResource(id = R.dimen.spacing_m)) + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) .verticalScroll(state = rememberScrollState()), ) { val button1Text = stringResource(id = R.string.component_element_button1) @@ -68,7 +68,7 @@ fun CardVerticalImageFirst(customizationState: CardCustomizationState) { onButton2Click = { clickOnElement(context, button2Text) } ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/cards/ComponentCard.kt b/app/src/main/java/com/orange/ods/app/ui/components/cards/ComponentCard.kt index cd8665db1..763e5c812 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/cards/ComponentCard.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/cards/ComponentCard.kt @@ -50,7 +50,7 @@ fun ComponentCard(variant: Variant) { Subtitle(textRes = R.string.component_card_horizontal_image_position, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = imagePosition, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_card_horizontal_image_position_start, value = OdsHorizontalCardImagePosition.Start) @@ -71,7 +71,7 @@ fun ComponentCard(variant: Variant) { count = actionButtonCount, minusIconContentDescription = stringResource(id = R.string.component_remove_action_button), plusIconContentDescription = stringResource(id = R.string.component_add_action_button), - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), minCount = CardCustomizationState.MinActionButtonCount, maxCount = CardCustomizationState.MaxActionButtonCount ) diff --git a/app/src/main/java/com/orange/ods/app/ui/components/checkboxes/ComponentCheckboxes.kt b/app/src/main/java/com/orange/ods/app/ui/components/checkboxes/ComponentCheckboxes.kt index dde102461..c47efd402 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/checkboxes/ComponentCheckboxes.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/checkboxes/ComponentCheckboxes.kt @@ -50,7 +50,7 @@ fun ComponentCheckboxes() { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.spacing_s)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) ) { recipe.ingredients.take(3).forEachIndexed { index, ingredient -> OdsListItem( @@ -63,7 +63,7 @@ fun ComponentCheckboxes() { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { FunctionCallCode( name = OdsComposable.OdsCheckbox.name, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/chips/Chip.kt b/app/src/main/java/com/orange/ods/app/ui/components/chips/Chip.kt index 66f5725c4..21377c57b 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/chips/Chip.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/chips/Chip.kt @@ -61,7 +61,7 @@ fun Chip(variant: Variant) { Subtitle(textRes = R.string.component_element_leading, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = leadingElement, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_element_none, value = LeadingElement.None) @@ -91,10 +91,13 @@ fun ChipTypeDemo(chipType: ChipType, content: @Composable () -> Unit) { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin), vertical = dimensionResource(id = R.dimen.screen_vertical_margin)) + .padding( + horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin) + ) ) { OdsTextBody2( - modifier = Modifier.padding(bottom = dimensionResource(id = R.dimen.spacing_s)), + modifier = Modifier.padding(bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), text = stringResource(id = chipType.descriptionRes) ) content() @@ -120,7 +123,7 @@ private fun Chip(chipCustomizationState: ChipCustomizationState) { } } - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( @@ -161,7 +164,7 @@ private fun Chip(chipCustomizationState: ChipCustomizationState) { } else null ) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/chips/ChipFilter.kt b/app/src/main/java/com/orange/ods/app/ui/components/chips/ChipFilter.kt index 9ddba3fc4..53ce9a3f1 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/chips/ChipFilter.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/chips/ChipFilter.kt @@ -59,7 +59,7 @@ fun ChipFilter() { Subtitle(textRes = R.string.component_element_leading, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = leadingElement, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_element_none, value = ChipCustomizationState.LeadingElement.None) @@ -75,7 +75,7 @@ fun ChipFilter() { }) { var selectedChipIndexes by rememberSaveable { mutableStateOf(emptySet()) } ChipTypeDemo(chipType = chipType.value) { - FlowRow(modifier = Modifier.fillMaxWidth(), mainAxisSpacing = dimensionResource(id = R.dimen.spacing_s)) { + FlowRow(modifier = Modifier.fillMaxWidth(), mainAxisSpacing = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) { recipe.ingredients.forEachIndexed { index, ingredient -> OdsFilterChip( text = ingredient.food.name, @@ -96,12 +96,12 @@ fun ChipFilter() { } } - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_s))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))) CodeImplementationColumn { FunctionCallCode( name = "FlowRow", - parameters = { simple("mainAxisSpacing", "dimensionResource(id = R.dimen.spacing_s))") } + parameters = { simple("mainAxisSpacing", "dimensionResource(id = com.orange.ods.R.dimen.spacing_s))") } ) { recipe.ingredients.forEachIndexed { index, ingredient -> FunctionCallCode( diff --git a/app/src/main/java/com/orange/ods/app/ui/components/dialogs/ComponentDialog.kt b/app/src/main/java/com/orange/ods/app/ui/components/dialogs/ComponentDialog.kt index 00d16006c..e101d007b 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/dialogs/ComponentDialog.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/dialogs/ComponentDialog.kt @@ -68,7 +68,7 @@ fun ComponentDialog() { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { FunctionCallCode( name = OdsComposable.OdsAlertDialog.name, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/floatingactionbuttons/ComponentFloatingActionButton.kt b/app/src/main/java/com/orange/ods/app/ui/components/floatingactionbuttons/ComponentFloatingActionButton.kt index 18ecaeee1..1e9a7306a 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/floatingactionbuttons/ComponentFloatingActionButton.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/floatingactionbuttons/ComponentFloatingActionButton.kt @@ -54,8 +54,8 @@ fun ComponentFloatingActionButton() { .let { if (isFullScreenWidth) it .padding( - start = dimensionResource(id = R.dimen.spacing_m), - end = dimensionResource(id = R.dimen.spacing_m), + start = dimensionResource(id = com.orange.ods.R.dimen.spacing_m), + end = dimensionResource(id = com.orange.ods.R.dimen.spacing_m), bottom = 64.dp ) .fillMaxWidth() @@ -91,7 +91,7 @@ fun ComponentFloatingActionButton() { Subtitle(textRes = R.string.component_size, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = size, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_floating_action_button_size_default, value = FabCustomizationState.Size.Default) @@ -109,7 +109,7 @@ fun ComponentFloatingActionButton() { Column(modifier = Modifier.verticalScroll(rememberScrollState())) { val usedComponentName = if (hasText) OdsComposable.OdsExtendedFloatingActionButton.name else OdsComposable.OdsFloatingActionButton.name CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { FunctionCallCode( name = usedComponentName, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/imageitem/ComponentImageItem.kt b/app/src/main/java/com/orange/ods/app/ui/components/imageitem/ComponentImageItem.kt index 7ea36ef3e..d10c4dceb 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/imageitem/ComponentImageItem.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/imageitem/ComponentImageItem.kt @@ -64,7 +64,7 @@ fun ComponentImageItem() { bottomSheetContent = { OdsChoiceChipsFlowRow( selectedChip = type, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { Subtitle(textRes = R.string.component_element_type) @@ -81,14 +81,14 @@ fun ComponentImageItem() { modifier = Modifier .fillMaxSize() .padding( - top = dimensionResource(id = R.dimen.screen_horizontal_margin), - start = dimensionResource(id = R.dimen.screen_horizontal_margin) + top = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin), + start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin) ), horizontalAlignment = Alignment.Start, ) { val imageSize = 200.dp val height = when (type.value) { - OdsImageItemTitleType.Below -> imageSize + dimensionResource(id = R.dimen.image_item_title_height) + OdsImageItemTitleType.Below -> imageSize + dimensionResource(id = com.orange.ods.R.dimen.image_item_title_height) OdsImageItemTitleType.Overlay, OdsImageItemTitleType.None -> imageSize } @@ -110,7 +110,7 @@ fun ComponentImageItem() { displayTitle = if (isOverlay) OdsImageItemTitleType.Overlay else if (isBelow) OdsImageItemTitleType.Below else OdsImageItemTitleType.None, ) CodeImplementationColumn( - modifier = Modifier.padding(end = dimensionResource(id = R.dimen.spacing_m)) + modifier = Modifier.padding(end = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { FunctionCallCode( name = OdsComposable.OdsImageItem.name, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/lists/ComponentLists.kt b/app/src/main/java/com/orange/ods/app/ui/components/lists/ComponentLists.kt index a41976ae8..99429445d 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/lists/ComponentLists.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/lists/ComponentLists.kt @@ -67,7 +67,7 @@ fun ComponentLists() { @Composable private fun ComponentListsBottomSheetContent(listItemCustomizationState: ListItemCustomizationState) { ComponentCountRow( - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), title = stringResource(id = R.string.component_list_item_size), count = listItemCustomizationState.lineCount, minusIconContentDescription = stringResource(id = R.string.component_list_item_remove_line), @@ -79,7 +79,7 @@ private fun ComponentListsBottomSheetContent(listItemCustomizationState: ListIte Subtitle(textRes = R.string.component_list_leading, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = listItemCustomizationState.selectedLeading, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_list_leading_none, value = ListItemCustomizationState.Leading.None) @@ -92,7 +92,7 @@ private fun ComponentListsBottomSheetContent(listItemCustomizationState: ListIte Subtitle(textRes = R.string.component_list_trailing, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = listItemCustomizationState.selectedTrailing, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { listItemCustomizationState.trailings.forEach { trailing -> @@ -185,8 +185,8 @@ private fun ListItemCustomizationState.getIconPainter(recipe: Recipe): Painter? ListItemCustomizationState.Leading.CircularImage, ListItemCustomizationState.Leading.SquareImage, ListItemCustomizationState.Leading.WideImage -> { - val wideImageSizeWidthPx = with(LocalDensity.current) { dimensionResource(id = R.dimen.list_wide_image_width).toPx() } - val wideImageSizeHeightPx = with(LocalDensity.current) { dimensionResource(id = R.dimen.list_wide_image_height).toPx() } + val wideImageSizeWidthPx = with(LocalDensity.current) { dimensionResource(id = com.orange.ods.R.dimen.list_wide_image_width).toPx() } + val wideImageSizeHeightPx = with(LocalDensity.current) { dimensionResource(id = com.orange.ods.R.dimen.list_wide_image_height).toPx() } rememberAsyncImagePainter( model = ImageRequest.Builder(LocalContext.current) .data(recipe.imageUrl) diff --git a/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuDropdown.kt b/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuDropdown.kt index e813243c4..daea4424d 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuDropdown.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuDropdown.kt @@ -70,19 +70,22 @@ fun MenuDropdown() { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(top = dimensionResource(id = R.dimen.screen_vertical_margin), bottom = dimensionResource(id = R.dimen.spacing_s)) + .padding( + top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin), + bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_s) + ) ) { OdsTextBody1( modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), text = stringResource(id = R.string.component_menu_dropdown_description) ) val dividerIndex = 1 - Box(modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s))) { + Box(modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s))) { OdsListItem( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), text = recipe.title, secondaryText = recipe.subtitle, trailing = OdsIconTrailing( @@ -110,7 +113,7 @@ fun MenuDropdown() { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { FunctionCallCode( name = OdsComposable.OdsDropdownMenu.name, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuExposedDropdown.kt b/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuExposedDropdown.kt index 0692d4e33..cc3446bf8 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuExposedDropdown.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/menus/MenuExposedDropdown.kt @@ -77,14 +77,17 @@ fun MenuExposedDropdown() { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(top = dimensionResource(id = R.dimen.screen_vertical_margin), bottom = dimensionResource(id = R.dimen.spacing_s)) - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + .padding( + top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin), + bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_s) + ) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), ) { val label = stringResource(id = R.string.data_recipe) OdsExposedDropdownMenu( modifier = Modifier .fillMaxWidth() - .padding(top = dimensionResource(id = R.dimen.spacing_s)), + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), label = label, items = items, selectedItem = selectedItem, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/navigationdrawers/ComponentModalDrawers.kt b/app/src/main/java/com/orange/ods/app/ui/components/navigationdrawers/ComponentModalDrawers.kt index 1dc95e09d..806105800 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/navigationdrawers/ComponentModalDrawers.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/navigationdrawers/ComponentModalDrawers.kt @@ -118,7 +118,7 @@ fun ComponentModalDrawers() { OdsChoiceChipsFlowRow( selectedChip = header, outlinedChips = true, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), ) { Subtitle(textRes = R.string.component_modal_drawer_header_image) OdsChoiceChip(textRes = R.string.component_element_avatar, value = ComponentNavigationDrawersContentState.HeaderImage.Avatar) @@ -145,7 +145,7 @@ fun ComponentModalDrawers() { OdsChoiceChipsFlowRow( selectedChip = content, outlinedChips = true, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), ) { Subtitle(textRes = R.string.component_modal_drawer_list_example) OdsChoiceChip( @@ -172,7 +172,7 @@ fun ComponentModalDrawers() { onButtonClick = { scope.launch { drawerState.open() } } ) - CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin))) { + CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin))) { FunctionCallCode( name = OdsComposable.OdsModalDrawer.name, exhaustiveParameters = false, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressCircular.kt b/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressCircular.kt index bbb0055e0..d8d641484 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressCircular.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressCircular.kt @@ -61,7 +61,7 @@ fun ProgressCircular() { bottomSheetContent = { OdsChoiceChipsFlowRow( selectedChip = type, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { Subtitle(textRes = R.string.component_element_type) @@ -83,7 +83,7 @@ fun ProgressCircular() { progress = if (type.value == ProgressCustomizationState.Type.Determinate) determinateProgressAnimation else null, label = if (hasLabel) text else null, modifier = Modifier - .padding(top = dimensionResource(id = R.dimen.spacing_m)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) .align(alignment = Alignment.CenterHorizontally) ) if (type.value == ProgressCustomizationState.Type.Determinate) { diff --git a/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressLinear.kt b/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressLinear.kt index e01ce17f1..bf989a486 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressLinear.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/progress/ProgressLinear.kt @@ -63,7 +63,7 @@ fun ProgressLinear() { bottomSheetContent = { OdsChoiceChipsFlowRow( selectedChip = type, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { Subtitle(textRes = R.string.component_element_type) @@ -98,7 +98,7 @@ fun ProgressLinear() { showCurrentValue = hasCurrentValue, icon = if (hasIcon) painterResource(id = R.drawable.ic_arrow_down) else null, modifier = Modifier - .padding(top = dimensionResource(id = R.dimen.spacing_m)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) .fillMaxWidth() ) if (type.value == ProgressCustomizationState.Type.Determinate) { @@ -107,7 +107,7 @@ fun ProgressLinear() { } } - CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin))) { + CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin))) { FunctionCallCode( name = OdsComposable.OdsLinearProgressIndicator.name, exhaustiveParameters = false, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/radiobuttons/ComponentRadioButtons.kt b/app/src/main/java/com/orange/ods/app/ui/components/radiobuttons/ComponentRadioButtons.kt index 14e064704..467c88bb9 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/radiobuttons/ComponentRadioButtons.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/radiobuttons/ComponentRadioButtons.kt @@ -49,7 +49,7 @@ fun ComponentRadioButtons() { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.spacing_s)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) ) { val recipes = LocalRecipes.current.take(3) val selectedRadio = rememberSaveable { mutableStateOf(recipes.firstOrNull()?.title) } @@ -66,7 +66,7 @@ fun ComponentRadioButtons() { } } - CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin))) { + CodeImplementationColumn(modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin))) { FunctionCallCode( name = OdsComposable.OdsRadioButton.name, exhaustiveParameters = false, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/sheets/ComponentSheetsBottom.kt b/app/src/main/java/com/orange/ods/app/ui/components/sheets/ComponentSheetsBottom.kt index f2774b4d0..81670c8e0 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/sheets/ComponentSheetsBottom.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/sheets/ComponentSheetsBottom.kt @@ -67,19 +67,19 @@ fun ComponentSheetsBottom() { Column(modifier = Modifier.verticalScroll(rememberScrollState())) { Column( modifier = Modifier - .padding(top = dimensionResource(id = R.dimen.screen_vertical_margin)) - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { OdsTextBody1(text = stringResource(id = R.string.component_sheet_bottom_customize)) OdsTextSubtitle1( text = stringResource(id = R.string.component_element_content), - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) ) OdsChoiceChipsFlowRow( selectedChip = content, outlinedChips = true, - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)) ) { OdsChoiceChip(textRes = R.string.component_element_empty, value = SheetsBottomCustomizationState.Content.Empty) OdsChoiceChip(textRes = R.string.component_element_example, value = SheetsBottomCustomizationState.Content.Example) diff --git a/app/src/main/java/com/orange/ods/app/ui/components/sliders/ComponentSliders.kt b/app/src/main/java/com/orange/ods/app/ui/components/sliders/ComponentSliders.kt index cea94f53b..9fc2f5d6f 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/sliders/ComponentSliders.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/sliders/ComponentSliders.kt @@ -64,7 +64,7 @@ fun ComponentSliders() { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(horizontal = dimensionResource(id = R.dimen.spacing_m)) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { val technicalText = if (shouldDisplayValue) OdsComposable.OdsSliderLockups.name else OdsComposable.OdsSlider.name val steps = if (isStepped) 9 else 0 @@ -79,7 +79,7 @@ fun ComponentSliders() { Title(textRes = getTitleRes(isStepped, hasSideIcons, shouldDisplayValue)) TechnicalText(text = technicalText) - Spacer(modifier = Modifier.padding(top = dimensionResource(R.dimen.spacing_m))) + Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_m))) val componentName: String if (shouldDisplayValue) { diff --git a/app/src/main/java/com/orange/ods/app/ui/components/snackbars/ComponentSnackbars.kt b/app/src/main/java/com/orange/ods/app/ui/components/snackbars/ComponentSnackbars.kt index d996a9640..338e0411a 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/snackbars/ComponentSnackbars.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/snackbars/ComponentSnackbars.kt @@ -91,11 +91,11 @@ fun ComponentSnackbars() { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), contentBackground = false ) { OdsTextBody2( - modifier = Modifier.padding(bottom = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding(bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)), text = stringResource(id = R.string.component_snackbar_code_first_step) ) CodeBackgroundColumn { @@ -115,7 +115,10 @@ fun ComponentSnackbars() { } OdsTextBody2( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s), bottom = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding( + top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s), + bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs) + ), text = stringResource(id = R.string.component_snackbar_code_second_step) ) CodeBackgroundColumn { diff --git a/app/src/main/java/com/orange/ods/app/ui/components/switches/ComponentSwitches.kt b/app/src/main/java/com/orange/ods/app/ui/components/switches/ComponentSwitches.kt index deb86203e..992a3c53d 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/switches/ComponentSwitches.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/switches/ComponentSwitches.kt @@ -49,7 +49,7 @@ fun ComponentSwitches() { Column( modifier = Modifier .verticalScroll(rememberScrollState()) - .padding(vertical = dimensionResource(id = R.dimen.spacing_s)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) ) { val recipes = LocalRecipes.current.take(3) recipes.forEach { recipe -> @@ -64,7 +64,7 @@ fun ComponentSwitches() { } CodeImplementationColumn( - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) { FunctionCallCode( name = OdsComposable.OdsSwitch.name, diff --git a/app/src/main/java/com/orange/ods/app/ui/components/tabs/ComponentTabs.kt b/app/src/main/java/com/orange/ods/app/ui/components/tabs/ComponentTabs.kt index 15655447a..e1bc85c04 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/tabs/ComponentTabs.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/tabs/ComponentTabs.kt @@ -80,7 +80,7 @@ fun ComponentTabs(variant: Variant, upPress: () -> Unit) { Subtitle(textRes = R.string.component_element_icon, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = tabsCustomizationState.tabIconType, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), outlinedChips = true ) { OdsChoiceChip( @@ -106,7 +106,7 @@ fun ComponentTabs(variant: Variant, upPress: () -> Unit) { ) ComponentCountRow( - modifier = Modifier.padding(start = dimensionResource(id = R.dimen.screen_horizontal_margin)), + modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), title = stringResource(id = R.string.component_tabs_count), count = tabsCustomizationState.tabsCount, minusIconContentDescription = stringResource(id = R.string.component_tabs_remove_tab), diff --git a/app/src/main/java/com/orange/ods/app/ui/components/textfields/ComponentTextField.kt b/app/src/main/java/com/orange/ods/app/ui/components/textfields/ComponentTextField.kt index e5cceb2e0..e193cfca7 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/textfields/ComponentTextField.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/textfields/ComponentTextField.kt @@ -63,8 +63,8 @@ fun ComponentTextField(variant: Variant) { modifier = Modifier .verticalScroll(rememberScrollState()) .padding( - horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin), - vertical = dimensionResource(id = R.dimen.screen_vertical_margin) + horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin) ) ) { when (variant) { @@ -132,7 +132,7 @@ private fun ComponentCustomizationContent(textFieldCustomizationState: TextField Subtitle(textRes = R.string.component_text_field_input_type, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = textFieldCustomizationState.inputType, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_text_field_input_type_single_line, value = TextFieldCustomizationState.InputType.SingleLine) @@ -151,7 +151,7 @@ private fun ComponentCustomizationContent(textFieldCustomizationState: TextField Subtitle(textRes = R.string.component_element_trailing, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = textFieldCustomizationState.trailingElement, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { OdsChoiceChip(textRes = R.string.component_element_none, value = TextFieldCustomizationState.TrailingElement.None) @@ -171,7 +171,7 @@ private fun KeyboardCustomizationContent(textFieldCustomizationState: TextFieldC OdsChoiceChipsFlowRow( selectedChip = textFieldCustomizationState.softKeyboardType, modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { TextFieldCustomizationState.SoftKeyboardType.values().forEach { softKeyboardType -> @@ -187,7 +187,7 @@ private fun KeyboardCustomizationContent(textFieldCustomizationState: TextFieldC Subtitle(textRes = R.string.component_text_field_keyboard_action, horizontalPadding = true) OdsChoiceChipsFlowRow( selectedChip = textFieldCustomizationState.softKeyboardAction, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)), + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), outlinedChips = true ) { TextFieldCustomizationState.SoftKeyboardAction.values().forEach { softKeyboardAction -> @@ -202,7 +202,7 @@ private fun DisplayTypeCustomization(displayType: MutableState Unit) { - Column(modifier = Modifier.padding(top = dimensionResource(id = R.dimen.screen_vertical_margin), bottom = dimensionResource(id = R.dimen.spacing_s))) { + Column( + modifier = Modifier.padding( + top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin), + bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_s) + ) + ) { OdsTextBody1( modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)), + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)), text = stringResource(id = textRes) ) OdsButton( modifier = Modifier .fillMaxWidth() - .padding(horizontal = dimensionResource(R.dimen.screen_horizontal_margin)) - .padding(top = dimensionResource(R.dimen.spacing_m)), + .padding(horizontal = dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin)) + .padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_m)), text = stringResource(id = buttonLabelRes), style = OdsButtonStyle.Primary, onClick = onButtonClick diff --git a/app/src/main/java/com/orange/ods/app/ui/guidelines/GuidelinesScreen.kt b/app/src/main/java/com/orange/ods/app/ui/guidelines/GuidelinesScreen.kt index fc8d3894d..66b9096e9 100644 --- a/app/src/main/java/com/orange/ods/app/ui/guidelines/GuidelinesScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/guidelines/GuidelinesScreen.kt @@ -35,8 +35,8 @@ fun GuidelinesScreen(onGuidelineClick: (String) -> Unit) { modifier = Modifier .fillMaxSize() .verticalScroll(scrollState) - .padding(dimensionResource(id = R.dimen.spacing_m)), - verticalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)) + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), + verticalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { Guideline.values().forEach { guideline -> OdsVerticalImageFirstCard( diff --git a/app/src/main/java/com/orange/ods/app/ui/guidelines/color/GuidelineColorScreen.kt b/app/src/main/java/com/orange/ods/app/ui/guidelines/color/GuidelineColorScreen.kt index a7485caf5..507171b53 100644 --- a/app/src/main/java/com/orange/ods/app/ui/guidelines/color/GuidelineColorScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/guidelines/color/GuidelineColorScreen.kt @@ -80,20 +80,20 @@ fun GuidelineColorScreen() { if (guidelineColors.isEmpty()) { OdsTextBody1( modifier = Modifier.padding( - horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin), - vertical = dimensionResource(id = R.dimen.screen_vertical_margin) + horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin) ), text = stringResource(id = R.string.guideline_colour_no_colours_defined) ) } else { LazyColumn( contentPadding = PaddingValues( - start = dimensionResource(id = R.dimen.spacing_m), - end = dimensionResource(id = R.dimen.spacing_m), - top = dimensionResource(id = R.dimen.screen_vertical_margin), - bottom = dimensionResource(id = R.dimen.screen_vertical_margin) + start = dimensionResource(id = com.orange.ods.R.dimen.spacing_m), + end = dimensionResource(id = com.orange.ods.R.dimen.spacing_m), + top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin), + bottom = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin) ), - verticalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)), + verticalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), ) { if (coreColors.isNotEmpty()) { item { @@ -101,7 +101,7 @@ fun GuidelineColorScreen() { } items(coreColors.chunked(2)) { rowColors -> Row( - horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)), + horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), ) { BigColorItem(color = rowColors[0]) BigColorItem(color = rowColors[1]) @@ -115,7 +115,7 @@ fun GuidelineColorScreen() { } items(functionalColors.chunked(2)) { rowColors -> Row( - horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)), + horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), ) { BigColorItem(color = rowColors[0]) BigColorItem(color = rowColors[1]) @@ -129,7 +129,7 @@ fun GuidelineColorScreen() { } items(supportingColors.chunked(3)) { rowColors -> Row( - horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)), + horizontalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), ) { SmallColorItem(color = rowColors[0]) SmallColorItem(color = rowColors[1]) @@ -164,7 +164,7 @@ private fun RowScope.SmallColorItem(color: GuidelineColor) { ) OdsTextH6( text = color.getName(), - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)) ) OdsTextCaption(text = colorValue.toHexString()) } @@ -201,11 +201,11 @@ private fun RowScope.BigColorItem(color: GuidelineColor) { ) OdsTextH6( text = color.getName(), - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)) + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)) ) OdsTextBody1(text = color.callable.name) OdsTextCaption( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)), text = colorValue.toHexString() ) OdsTextCaption( @@ -236,24 +236,27 @@ fun DialogColor(color: GuidelineColor, openDialog: MutableState) { modifier = Modifier .background(color = OdsTheme.colors.background) .fillMaxWidth() - .padding(horizontal = dimensionResource(id = R.dimen.spacing_m), vertical = dimensionResource(id = R.dimen.spacing_s)) + .padding( + horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m), + vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s) + ) ) { OdsTextH5(text = color.getName()) OdsTextBody1( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)), text = color.callable.name ) OdsTextBody1( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), text = colorValue.toHexString() ) OdsTextBody1( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), text = colorValue.toRgbString() ) color.xmlResource?.let { xmlResource -> OdsTextBody1( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), text = stringResource( id = R.string.guideline_colour_xml, context.getStringName(xmlResource) @@ -261,7 +264,7 @@ fun DialogColor(color: GuidelineColor, openDialog: MutableState) { ) } OdsButton( - modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_s)), + modifier = Modifier.padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)), text = stringResource(id = R.string.guideline_colour_copy_to_clipboard_button_title), onClick = { copyColorToClipboard(context, colorValue, clipboardManager) }) } diff --git a/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacing.kt b/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacing.kt index b2d9b5c29..a2967989a 100644 --- a/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacing.kt +++ b/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacing.kt @@ -13,17 +13,16 @@ package com.orange.ods.app.ui.guidelines.spacing import androidx.annotation.DimenRes import androidx.compose.runtime.Composable import androidx.compose.ui.res.dimensionResource -import com.orange.ods.app.R enum class Spacing(val tokenName: String, @DimenRes val dimenRes: Int) { - None("spacing - none", R.dimen.spacing_none), - ExtraSmall("spacing - xs", R.dimen.spacing_xs), - Small("spacing - s", R.dimen.spacing_s), - Medium("spacing - m", R.dimen.spacing_m), - Large("spacing - l", R.dimen.spacing_l), - ExtraLarge("spacing - xl", R.dimen.spacing_xl), - ExtraExtraLarge("spacing - 2xl", R.dimen.spacing_2xl); + None("spacing - none", com.orange.ods.R.dimen.spacing_none), + ExtraSmall("spacing - xs", com.orange.ods.R.dimen.spacing_xs), + Small("spacing - s", com.orange.ods.R.dimen.spacing_s), + Medium("spacing - m", com.orange.ods.R.dimen.spacing_m), + Large("spacing - l", com.orange.ods.R.dimen.spacing_l), + ExtraLarge("spacing - xl", com.orange.ods.R.dimen.spacing_xl), + ExtraExtraLarge("spacing - 2xl", com.orange.ods.R.dimen.spacing_2xl); @Composable fun getDp() = dimensionResource(id = dimenRes) diff --git a/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacingScreen.kt b/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacingScreen.kt index 466088373..87dfc3000 100644 --- a/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacingScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/guidelines/spacing/GuidelineSpacingScreen.kt @@ -46,7 +46,7 @@ private val ratioFormatter = DecimalFormat("0.#", DecimalFormatSymbols(Locale.EN fun GuidelineSpacingScreen() { LocalMainTopAppBarManager.current.updateTopAppBarTitle(R.string.guideline_spacing) - LazyColumn(contentPadding = PaddingValues(bottom = dimensionResource(id = R.dimen.spacing_m))) { + LazyColumn(contentPadding = PaddingValues(bottom = dimensionResource(id = com.orange.ods.R.dimen.spacing_m))) { item { DetailScreenHeader( imageRes = DrawableManager.getDrawableResIdForCurrentTheme(resId = R.drawable.il_spacing), @@ -57,13 +57,14 @@ fun GuidelineSpacingScreen() { item { OdsTextSubtitle1( modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) - .padding(vertical = dimensionResource(id = R.dimen.spacing_m)), + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) + .padding(vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)), text = stringResource(id = R.string.guideline_spacing_subtitle) ) } items(Spacing.values()) { spacing -> - val dividerStartIndent = dimensionResource(id = R.dimen.guideline_spacing_image_width) + dimensionResource(id = R.dimen.spacing_m).times(2) + val dividerStartIndent = + dimensionResource(id = R.dimen.guideline_spacing_image_width) + dimensionResource(id = com.orange.ods.R.dimen.spacing_m).times(2) val dp = spacing.getDp() val ratio = spacing.getRatio() OdsListItem( diff --git a/app/src/main/java/com/orange/ods/app/ui/guidelines/typography/GuidelineTypographyScreen.kt b/app/src/main/java/com/orange/ods/app/ui/guidelines/typography/GuidelineTypographyScreen.kt index c34db7d8a..7e2666144 100644 --- a/app/src/main/java/com/orange/ods/app/ui/guidelines/typography/GuidelineTypographyScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/guidelines/typography/GuidelineTypographyScreen.kt @@ -46,8 +46,8 @@ fun GuidelineTypographyScreen() { val guidelineTypography = LocalOdsGuideline.current.guidelineTypography LazyColumn( - contentPadding = PaddingValues(bottom = dimensionResource(id = R.dimen.screen_vertical_margin)), - verticalArrangement = Arrangement.spacedBy(dimensionResource(id = R.dimen.spacing_m)) + contentPadding = PaddingValues(bottom = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)), + verticalArrangement = Arrangement.spacedBy(dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { item { DetailScreenHeader( @@ -59,8 +59,8 @@ fun GuidelineTypographyScreen() { item { OdsTextBody1( modifier = Modifier.padding( - horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin), - vertical = dimensionResource(id = R.dimen.screen_vertical_margin) + horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin), + vertical = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin) ), text = stringResource(id = R.string.guideline_typography_no_typography_defined) ) @@ -71,8 +71,8 @@ fun GuidelineTypographyScreen() { if (index < guidelineTypography.lastIndex) { OdsDivider( modifier = Modifier - .padding(top = dimensionResource(id = R.dimen.spacing_m)) - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) ) } } @@ -85,7 +85,7 @@ private fun TextStyleRow(guidelineTextStyle: GuidelineTextStyle) { val context = LocalContext.current val textColor = OdsTheme.colors.onBackground Column(modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) .semantics(mergeDescendants = true) {}) { Text( text = guidelineTextStyle.name, diff --git a/app/src/main/java/com/orange/ods/app/ui/utilities/composable/CodeImplementation.kt b/app/src/main/java/com/orange/ods/app/ui/utilities/composable/CodeImplementation.kt index 27f314dbc..62be7bb0a 100644 --- a/app/src/main/java/com/orange/ods/app/ui/utilities/composable/CodeImplementation.kt +++ b/app/src/main/java/com/orange/ods/app/ui/utilities/composable/CodeImplementation.kt @@ -137,7 +137,7 @@ fun CodeImplementationColumn( Column( modifier = modifier.padding( - vertical = dimensionResource(id = R.dimen.spacing_s) + vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s) ) ) { UiFrameworkChoice(xmlAvailable) @@ -152,7 +152,7 @@ fun CodeImplementationColumn( TechnicalText( modifier = Modifier .fillMaxWidth() - .padding(dimensionResource(id = R.dimen.spacing_xs)), + .padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_xs)), text = stringResource(id = R.string.soon_available) ) } @@ -189,7 +189,7 @@ fun CodeBackgroundColumn(content: @Composable () -> Unit) { Column( modifier = Modifier .background(OdsTheme.colors.onSurface.copy(alpha = 0.12f)) - .padding(horizontal = dimensionResource(id = R.dimen.spacing_s), vertical = dimensionResource(id = R.dimen.spacing_s)) + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_s), vertical = dimensionResource(id = com.orange.ods.R.dimen.spacing_s)) .semantics(mergeDescendants = true) {}) { content() } @@ -197,7 +197,7 @@ fun CodeBackgroundColumn(content: @Composable () -> Unit) { @Composable fun IndentCodeColumn(content: @Composable () -> Unit) { - Column(modifier = Modifier.padding(start = dimensionResource(id = R.dimen.spacing_s))) { + Column(modifier = Modifier.padding(start = dimensionResource(id = com.orange.ods.R.dimen.spacing_s))) { content() } } diff --git a/app/src/main/java/com/orange/ods/app/ui/utilities/composable/DetailScreenHeader.kt b/app/src/main/java/com/orange/ods/app/ui/utilities/composable/DetailScreenHeader.kt index 45e18ac2e..1ff36e321 100644 --- a/app/src/main/java/com/orange/ods/app/ui/utilities/composable/DetailScreenHeader.kt +++ b/app/src/main/java/com/orange/ods/app/ui/utilities/composable/DetailScreenHeader.kt @@ -26,9 +26,8 @@ import androidx.compose.ui.res.dimensionResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.orange.ods.compose.text.OdsTextBody1 -import com.orange.ods.app.R import com.orange.ods.app.ui.components.Component +import com.orange.ods.compose.text.OdsTextBody1 @Composable fun DetailScreenHeader( @@ -48,7 +47,7 @@ fun DetailScreenHeader( ) DetailScreenDescription( modifier = Modifier.padding( - horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin) + horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin) ), descriptionRes = descriptionRes ) @@ -62,7 +61,7 @@ private fun DetailScreenDescription( OdsTextBody1( text = stringResource(descriptionRes), modifier = modifier.padding( - top = dimensionResource(id = R.dimen.spacing_m) + top = dimensionResource(id = com.orange.ods.R.dimen.spacing_m) ) ) } \ No newline at end of file diff --git a/app/src/main/java/com/orange/ods/app/ui/utilities/composable/Texts.kt b/app/src/main/java/com/orange/ods/app/ui/utilities/composable/Texts.kt index ff82b2b95..9f3b66658 100644 --- a/app/src/main/java/com/orange/ods/app/ui/utilities/composable/Texts.kt +++ b/app/src/main/java/com/orange/ods/app/ui/utilities/composable/Texts.kt @@ -37,8 +37,8 @@ fun Title(@StringRes textRes: Int, modifier: Modifier = Modifier, horizontalPadd text = stringResource(textRes), modifier = modifier .fillMaxWidth() - .padding(top = if (topPadding) dimensionResource(R.dimen.spacing_xl) else 0.dp) - .padding(horizontal = if (horizontalPadding) dimensionResource(R.dimen.screen_horizontal_margin) else 0.dp) + .padding(top = if (topPadding) dimensionResource(com.orange.ods.R.dimen.spacing_xl) else 0.dp) + .padding(horizontal = if (horizontalPadding) dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin) else 0.dp) ) } @@ -54,8 +54,8 @@ fun Subtitle(@StringRes textRes: Int, displaySurface: OdsDisplaySurface = OdsDis modifier = Modifier .fillMaxWidth() .background(backgroundColor) - .padding(top = dimensionResource(id = R.dimen.spacing_m)) - .padding(horizontal = if (horizontalPadding) dimensionResource(R.dimen.screen_horizontal_margin) else 0.dp), + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) + .padding(horizontal = if (horizontalPadding) dimensionResource(com.orange.ods.R.dimen.screen_horizontal_margin) else 0.dp), displaySurface = displaySurface ) } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index fe2adbb3c..ebb1c4248 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -19,14 +19,16 @@ repositories { } java { - // Use Java 8 instead of Java 11 - // See https://github.com/gradle/gradle/issues/18935 - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +kotlin { + jvmToolchain(11) } dependencies { - implementation("com.android.tools.build:gradle:7.3.1") + implementation("com.android.tools.build:gradle:8.1.0") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0") // https://issuetracker.google.com/issues/176079157#comment14 implementation("com.squareup:javapoet:1.13.0") // https://github.com/google/dagger/issues/3282 } diff --git a/buildSrc/src/main/kotlin/com/orange/ods/gradle/Versions.kt b/buildSrc/src/main/kotlin/com/orange/ods/gradle/Versions.kt index 80e9fdb57..ad21858f2 100644 --- a/buildSrc/src/main/kotlin/com/orange/ods/gradle/Versions.kt +++ b/buildSrc/src/main/kotlin/com/orange/ods/gradle/Versions.kt @@ -18,7 +18,7 @@ object Versions { const val accompanist = "0.28.0" const val activity = "1.6.1" - const val androidGradlePlugin = "7.3.1" + const val androidGradlePlugin = "8.1.0" const val appCompat = "1.5.1" const val browser = "1.4.0" const val composeBom = "2023.06.01" diff --git a/buildSrc/src/main/kotlin/library.gradle.kts b/buildSrc/src/main/kotlin/library.gradle.kts index 44e62dc7d..460844f93 100644 --- a/buildSrc/src/main/kotlin/library.gradle.kts +++ b/buildSrc/src/main/kotlin/library.gradle.kts @@ -10,7 +10,6 @@ import com.orange.ods.gradle.MavenCentralPublishPluginExtension import com.orange.ods.gradle.Versions -import gradle.kotlin.dsl.accessors._ecf15b363eddec123ebdbce713433fa8.android plugins { id("com.android.library") diff --git a/changelog.md b/changelog.md index 5822cd7dc..5a7348b36 100644 --- a/changelog.md +++ b/changelog.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- [\All\] Use Compose BOM and update Kotlin version to 1.9.0 ([#578](https://github.com/Orange-OpenSource/ods-android/issues/578)) +- [\All\] Use Compose BOM and update Kotlin and Gradle versions ([#578](https://github.com/Orange-OpenSource/ods-android/issues/578)) - \[Lib\] Replace composable parameter of `OdsDropdownMenu` with a list of `OdsDropdownMenuItem` ([#572](https://github.com/Orange-OpenSource/ods-android/issues/572)) - \[Lib\] Update `OdsTopAppBar` and `OdsLargeTopAppBar` APIs ([#572](https://github.com/Orange-OpenSource/ods-android/issues/572)) diff --git a/docs/components/Chips.md b/docs/components/Chips.md index ecf617a9c..1200e4ed2 100644 --- a/docs/components/Chips.md +++ b/docs/components/Chips.md @@ -245,7 +245,7 @@ Use `OdsChoiceChipsFlowRow` composable: ```kotlin OdsChoiceChipsFlowRow( selectedChip = iconTypeState, - modifier = Modifier.padding(horizontal = dimensionResource(id = R.dimen.spacing_m)) + modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)) ) { SelectableChip(textRes = R.string.component_icon_leading, value = IconType.Leading) SelectableChip(textRes = R.string.component_icon_top, value = IconType.Top) diff --git a/docs/components/Snackbars.md b/docs/components/Snackbars.md index 559d01606..3cc7679e4 100644 --- a/docs/components/Snackbars.md +++ b/docs/components/Snackbars.md @@ -69,8 +69,8 @@ Scaffold( }) { OdsButton( modifier = Modifier - .padding(horizontal = dimensionResource(id = R.dimen.screen_horizontal_margin)) - .padding(top = dimensionResource(id = R.dimen.screen_vertical_margin)), + .padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.screen_horizontal_margin)) + .padding(top = dimensionResource(id = com.orange.ods.R.dimen.screen_vertical_margin)), text = "Show snackbar", onClick = { coroutineScope.launch { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0a829c871..20f5a5e48 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -7,7 +7,7 @@ # #Fri May 13 10:10:34 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 2ee629f6f..1dcd2e0f1 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -33,6 +33,7 @@ android { } buildFeatures { + buildConfig = true compose = true } diff --git a/theme-contract/src/main/java/com/orange/ods/theme/guideline/OdsGuideline.kt b/theme-contract/src/main/java/com/orange/ods/theme/guideline/OdsGuideline.kt index 7b9b6d4b1..587be3be8 100644 --- a/theme-contract/src/main/java/com/orange/ods/theme/guideline/OdsGuideline.kt +++ b/theme-contract/src/main/java/com/orange/ods/theme/guideline/OdsGuideline.kt @@ -11,7 +11,6 @@ package com.orange.ods.theme.guideline import androidx.compose.material.Typography -import com.orange.ods.theme.R /** * This class defines what will be displayed in the ODS application guideline part. @@ -36,19 +35,19 @@ open class OdsGuideline(private val typography: Typography) { return properties.mapNotNull { property -> val (name, xmlResource) = when (property) { - ::h1 -> "Headline 1" to R.attr.textAppearanceHeadline1 - ::h2 -> "Headline 2" to R.attr.textAppearanceHeadline2 - ::h3 -> "Headline 3" to R.attr.textAppearanceHeadline3 - ::h4 -> "Headline 4" to R.attr.textAppearanceHeadline4 - ::h5 -> "Headline 5" to R.attr.textAppearanceHeadline5 - ::h6 -> "Headline 6" to R.attr.textAppearanceHeadline6 - ::subtitle1 -> "Subtitle1" to R.attr.textAppearanceSubtitle1 - ::subtitle2 -> "Subtitle2" to R.attr.textAppearanceSubtitle2 - ::body1 -> "Body1" to R.attr.textAppearanceBody1 - ::body2 -> "Body2" to R.attr.textAppearanceBody2 - ::button -> "BUTTON" to R.attr.textAppearanceButton - ::caption -> "Caption" to R.attr.textAppearanceCaption - ::overline -> "Overline" to R.attr.textAppearanceOverline + ::h1 -> "Headline 1" to com.google.android.material.R.attr.textAppearanceHeadline1 + ::h2 -> "Headline 2" to com.google.android.material.R.attr.textAppearanceHeadline2 + ::h3 -> "Headline 3" to com.google.android.material.R.attr.textAppearanceHeadline3 + ::h4 -> "Headline 4" to com.google.android.material.R.attr.textAppearanceHeadline4 + ::h5 -> "Headline 5" to com.google.android.material.R.attr.textAppearanceHeadline5 + ::h6 -> "Headline 6" to com.google.android.material.R.attr.textAppearanceHeadline6 + ::subtitle1 -> "Subtitle1" to com.google.android.material.R.attr.textAppearanceSubtitle1 + ::subtitle2 -> "Subtitle2" to com.google.android.material.R.attr.textAppearanceSubtitle2 + ::body1 -> "Body1" to com.google.android.material.R.attr.textAppearanceBody1 + ::body2 -> "Body2" to com.google.android.material.R.attr.textAppearanceBody2 + ::button -> "BUTTON" to com.google.android.material.R.attr.textAppearanceButton + ::caption -> "Caption" to com.google.android.material.R.attr.textAppearanceCaption + ::overline -> "Overline" to com.google.android.material.R.attr.textAppearanceOverline else -> null to null } if (name != null && xmlResource != null) { diff --git a/theme-orange/build.gradle.kts b/theme-orange/build.gradle.kts index 77cdda941..c2463232c 100644 --- a/theme-orange/build.gradle.kts +++ b/theme-orange/build.gradle.kts @@ -28,4 +28,5 @@ dependencies { implementation(Dependencies.composeMaterial) implementation(Dependencies.hiltAndroid) kapt(Dependencies.hiltCompiler) + implementation(Dependencies.material) } diff --git a/theme-orange/src/main/java/com/orange/ods/theme/orange/guideline/OrangeGuidelineColors.kt b/theme-orange/src/main/java/com/orange/ods/theme/orange/guideline/OrangeGuidelineColors.kt index bfaae7115..6b1cbec7e 100644 --- a/theme-orange/src/main/java/com/orange/ods/theme/orange/guideline/OrangeGuidelineColors.kt +++ b/theme-orange/src/main/java/com/orange/ods/theme/orange/guideline/OrangeGuidelineColors.kt @@ -33,13 +33,13 @@ import com.orange.ods.theme.orange.Yellow200 import com.orange.ods.theme.orange.Yellow300 val OrangeGuidelineColors = listOf( - GuidelineColor(OdsColors::primary, GuidelineColorType.Core, "Orange 100", "Orange 200", R.attr.colorPrimary), - GuidelineColor(OdsColors::background, GuidelineColorType.Core, "White 100", "Black 900", R.attr.backgroundColor), - GuidelineColor(OdsColors::surface, GuidelineColorType.Core, "White 100", "Secondary Background", R.attr.colorSurface), + GuidelineColor(OdsColors::primary, GuidelineColorType.Core, "Orange 100", "Orange 200", com.google.android.material.R.attr.colorPrimary), + GuidelineColor(OdsColors::background, GuidelineColorType.Core, "White 100", "Black 900", com.google.android.material.R.attr.backgroundColor), + GuidelineColor(OdsColors::surface, GuidelineColorType.Core, "White 100", "Secondary Background", com.google.android.material.R.attr.colorSurface), GuidelineColor(::ObsGrey700, GuidelineColorType.Core, "OBS Grey 700", xmlResource = R.color.core_obsgrey_700), GuidelineColor(OdsFunctionalColors::positive, GuidelineColorType.Functional, "Positive 200", "Positive 100", R.attr.functionalPositive), - GuidelineColor(OdsColors::error, GuidelineColorType.Functional, "Negative 200", "Negative 100", R.attr.colorError), + GuidelineColor(OdsColors::error, GuidelineColorType.Functional, "Negative 200", "Negative 100", com.google.android.material.R.attr.colorError), GuidelineColor(OdsFunctionalColors::info, GuidelineColorType.Functional, "Info 200", "Info 100", R.attr.functionalInfo), GuidelineColor(OdsFunctionalColors::alert, GuidelineColorType.Functional, "Alert 200", "Alert 100", R.attr.functionalAlert),