Skip to content

Commit

Permalink
[#578] Update Gradle to version 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmaitre authored and paulinea committed Aug 7, 2023
1 parent 03dec7d commit 623c5dc
Show file tree
Hide file tree
Showing 63 changed files with 282 additions and 234 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ android {
}

buildFeatures {
buildConfig = true
compose = true
viewBinding = true
dataBinding = true
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/orange/ods/app/ui/MainTopAppBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/orange/ods/app/ui/about/AboutScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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),
imageAlignment = component.imageAlignment,
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ 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) {
OdsTextBody2(text = stringResource(id = R.string.component_app_bars_top_large_scrolling_upward))
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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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))
}
}
Expand All @@ -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)
Expand All @@ -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),
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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
)
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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 {
Expand All @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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<OdsButtonBinding>(
compose = {
OdsButton(
Expand Down
Loading

0 comments on commit 623c5dc

Please sign in to comment.