Skip to content

Commit

Permalink
[#712] Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmaitre committed Dec 7, 2023
1 parent f4b0b9d commit d8bfd21
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 54 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/orange/ods/app/ui/AppBarState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AppBarState(
return if (isCustom) {
val context = LocalContext.current
val customActionCount = max(0, customAppBarConfiguration.value.actionCount - AppBarAction.defaultActions.size)
val customActions = NavigationItem.values()
val customActions = NavigationItem.entries
.take(customActionCount)
.map {
val contentDescription = stringResource(id = it.textResId)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/orange/ods/app/ui/AppNavigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fun NavController.navigateToBottomBarRoute(route: String) {
* This is used to de-duplicate navigation events.
*/
private fun NavBackStackEntry.lifecycleIsResumed() =
this.getLifecycle().currentState == Lifecycle.State.RESUMED
lifecycle.currentState == Lifecycle.State.RESUMED

private val NavGraph.startDestination: NavDestination?
get() = findNode(startDestinationId)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/orange/ods/app/ui/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fun MainScreen(themeConfigurations: Set<OdsThemeConfigurationContract>, mainView
exit = fadeOut()
) {
BottomBar(
items = BottomBarItem.values(),
items = BottomBarItem.entries.toTypedArray(),
currentRoute = mainState.navigationState.currentRoute.orEmpty(),
navigateToRoute = { route ->
if (route == BottomBarItem.About.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private object ComponentBottomNavigation {
@Composable
fun ComponentBottomNavigation() {
val context = LocalContext.current
val navigationItems = NavigationItem.values()
val navigationItems = NavigationItem.entries
val selectedNavigationItemCount = rememberSaveable { mutableStateOf(MinNavigationItemCount) }
val selectedNavigationItem = remember { mutableStateOf(navigationItems[0]) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fun ComponentTabs(variant: Variant) {
)
}) {

HorizontalPager(state = pagerState, pageCount = tabs.size) { page ->
HorizontalPager(state = pagerState) { page ->
val textResId = tabs[page].textResId
TabsPagerContentScreen(stringResource(id = textResId))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import com.orange.ods.compose.component.tab.OdsTabRow
fun rememberMainTabsCustomizationState(
bottomSheetScaffoldState: BottomSheetScaffoldState = rememberBottomSheetScaffoldState(),
tabsCount: MutableState<Int>,
pagerState: PagerState = rememberPagerState(),
pagerState: PagerState = rememberPagerState { tabsCount.value.coerceAtLeast(0) },
selectedTabsIconPosition: MutableState<OdsTabRow.Tab.Icon.Position> = rememberSaveable { mutableStateOf(OdsTabRow.Tab.Icon.Position.Top) },
tabIconEnabled: MutableState<Boolean> = rememberSaveable { mutableStateOf(true) },
tabTextEnabled: MutableState<Boolean> = rememberSaveable { mutableStateOf(true) }
Expand All @@ -47,8 +47,6 @@ class MainTabsCustomizationState(
val tabIconEnabled: MutableState<Boolean>,
val tabTextEnabled: MutableState<Boolean>
) {
private val availableTabs = NavigationItem.values().toList()

val isTabTextCustomizationEnabled: Boolean
get() = tabIconEnabled.value

Expand All @@ -59,5 +57,5 @@ class MainTabsCustomizationState(
get() = isTabIconCustomizationEnabled && isTabTextCustomizationEnabled

val tabs: List<NavigationItem>
get() = availableTabs.take(tabsCount.value.coerceAtLeast(0))
get() = NavigationItem.entries.take(tabsCount.value.coerceAtLeast(0))
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ fun ComponentTextField(variant: Variant) {
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun TextFieldTextCustomization(textFieldCustomizationState: TextFieldCustomizationState) {
val pagerState = rememberPagerState()
val tabs = CustomizationTab.entries
val pagerState = rememberPagerState { tabs.size }
val scope = rememberCoroutineScope()
val tabs = CustomizationTab.values()
val keyboardState by keyboardAsState()

// Clear text field focus each time the keyboard customization is opened and the soft keyboard is closed
Expand All @@ -100,7 +100,7 @@ private fun TextFieldTextCustomization(textFieldCustomizationState: TextFieldCus
}
)

HorizontalPager(state = pagerState, pageCount = tabs.size) { page ->
HorizontalPager(state = pagerState) { page ->
Column {
tabs[page].Content(textFieldCustomizationState)
}
Expand Down Expand Up @@ -182,7 +182,7 @@ private fun KeyboardCustomizationContent(textFieldCustomizationState: TextFieldC
value = softKeyboardType.value,
onValueChange = { value -> softKeyboardType.value = value },
modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)),
chips = TextFieldCustomizationState.SoftKeyboardType.values().map { softKeyboardType ->
chips = TextFieldCustomizationState.SoftKeyboardType.entries.map { softKeyboardType ->
OdsChoiceChip(text = stringResource(id = softKeyboardType.labelRes), value = softKeyboardType)
}
)
Expand All @@ -197,7 +197,7 @@ private fun KeyboardCustomizationContent(textFieldCustomizationState: TextFieldC
value = softKeyboardAction.value,
onValueChange = { value -> softKeyboardAction.value = value },
modifier = Modifier.padding(horizontal = dimensionResource(id = com.orange.ods.R.dimen.spacing_m)),
chips = TextFieldCustomizationState.SoftKeyboardAction.values().map { softKeyboardAction ->
chips = TextFieldCustomizationState.SoftKeyboardAction.entries.map { softKeyboardAction ->
OdsChoiceChip(text = stringResource(id = softKeyboardAction.labelRes), value = softKeyboardAction)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun GuidelinesScreen(onGuidelineClick: (String) -> Unit) {
.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 ->
Guideline.entries.forEach { guideline ->
OdsVerticalImageFirstCard(
title = stringResource(id = guideline.titleRes),
image = OdsCard.Image(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fun GuidelineSpacingScreen() {
text = stringResource(id = R.string.guideline_spacing_subtitle)
)
}
items(Spacing.values()) { spacing ->
items(Spacing.entries) { spacing ->
val dp = spacing.getDp()
val ratio = spacing.getRatio()
OdsListItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fun AboutCustomizationScreen(navigateToAboutModule: () -> Unit, viewModel: About

Subtitle(textRes = R.string.module_about_customization_app_sections)
CustomizationChipsFlowRow {
AboutCustomizationAppSection.values().forEach { appSection: AboutCustomizationAppSection ->
AboutCustomizationAppSection.entries.forEach { appSection: AboutCustomizationAppSection ->
OdsFilterChip(
text = stringResource(id = appSection.labelResId),
onClick = {
Expand All @@ -69,7 +69,7 @@ fun AboutCustomizationScreen(navigateToAboutModule: () -> Unit, viewModel: About

Subtitle(textRes = R.string.module_about_customization_optional_items)
CustomizationChipsFlowRow {
AboutCustomizationOptionalItem.values().forEach { item: AboutCustomizationOptionalItem ->
AboutCustomizationOptionalItem.entries.forEach { item: AboutCustomizationOptionalItem ->
OdsFilterChip(
text = stringResource(id = item.labelResId),
onClick = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fun SearchScreen(onResultItemClick: (String, Long?) -> Unit) {
.contains(searchedText.text.lowercase())
}.asSequence()

val filteredSpacings = Spacing.values().filter { spacing ->
val filteredSpacings = Spacing.entries.filter { spacing ->
searchedText.text.isEmpty() || spacing.tokenName.lowercase()
.contains(searchedText.text.lowercase())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ fun CodeImplementationColumn(
private fun UiFrameworkChoice(xmlAvailable: Boolean) {
val context = LocalContext.current
val currentUiFramework = LocalUiFramework.current
val uiFrameworkItems = UiFramework.values().map { uiFramework ->
val uiFrameworkItems = UiFramework.entries.map { uiFramework ->
OdsExposedDropdownMenu.Item(label = stringResource(id = uiFramework.labelResId), iconResId = uiFramework.iconResId)
}
val selectedUiFramework = rememberSaveable(currentUiFramework.value) {
val selectedUiFramework = if (xmlAvailable) currentUiFramework.value else UiFramework.Compose
val selectedUiFrameworkIndex = UiFramework.values().indexOf(selectedUiFramework)
val selectedUiFrameworkIndex = UiFramework.entries.indexOf(selectedUiFramework)
mutableStateOf(uiFrameworkItems[selectedUiFrameworkIndex])
}

Expand All @@ -98,7 +98,7 @@ private fun UiFrameworkChoice(xmlAvailable: Boolean) {
items = uiFrameworkItems,
selectedItem = selectedUiFramework,
onItemSelectionChange = { selectedItem ->
currentUiFramework.value = UiFramework.values().first { context.getString(it.labelResId) == selectedItem.label }
currentUiFramework.value = UiFramework.entries.first { context.getString(it.labelResId) == selectedItem.label }
},
enabled = xmlAvailable
)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ allprojects {

tasks.register<Delete>("clean") {
group = "cleanup"
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kotlin {
}

dependencies {
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.android.tools.build:gradle:8.2.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21") // https://issuetracker.google.com/issues/176079157#comment14
implementation("com.squareup:javapoet:1.13.0") // https://github.com/google/dagger/issues/3282
}
44 changes: 22 additions & 22 deletions buildSrc/src/main/kotlin/com/orange/ods/gradle/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@ package com.orange.ods.gradle

object Versions {

const val compileSdk = 33
const val compileSdk = 34
const val minSdk = 21
const val targetSdk = compileSdk

const val accompanist = "0.28.0"
const val activity = "1.6.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"
const val composeCompiler = "1.5.1"
const val coil = "2.2.2"
const val accompanist = "0.32.0"
const val activity = "1.8.1"
const val androidGradlePlugin = "8.2.0"
const val appCompat = "1.6.1"
const val browser = "1.7.0"
const val composeBom = "2023.10.01"
const val composeCompiler = "1.5.6"
const val coil = "2.5.0"
const val constraintLayoutCompose = "1.0.1"
const val core = "1.9.0"
const val core = "1.12.0"
const val customViewPoolingContainer = "1.0.0"
const val dataStorePreferences = "1.0.0"
const val firebaseAppDistributionGradlePlugin = "3.1.1"
const val firebaseBom = "31.1.1"
const val firebaseCrashlyticsGradlePlugin = "2.9.2"
const val googleServicesGradlePlugin = "4.3.14"
const val hilt = "2.48"
const val firebaseBom = "32.6.0"
const val firebaseCrashlyticsGradlePlugin = "2.9.9"
const val googleServicesGradlePlugin = "4.4.0"
const val hilt = "2.49"
const val jUnit = "4.13.2"
const val kotlin = "1.9.0"
const val kotlinPoet = "1.12.0"
const val ksp = "$kotlin-1.0.13"
const val lifecycle = "2.5.1"
const val material = "1.7.0"
const val navigation = "2.5.3"
const val testExtJUnit = "1.1.4"
const val kotlin = "1.9.21"
const val kotlinPoet = "1.15.3"
const val ksp = "$kotlin-1.0.15"
const val lifecycle = "2.6.2"
const val material = "1.10.0"
const val navigation = "2.7.5"
const val testExtJUnit = "1.1.5"
const val timber = "5.0.1"
const val webkit = "1.5.0"
const val webkit = "1.9.0"
}
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- \[All\] Upgrade dependencies ([#712](https://github.com/Orange-OpenSource/ods-android/issues/712))
- \[App\] Change tabs customization to be closer to the API ([#699](https://github.com/Orange-OpenSource/ods-android/issues/699))
- \[Lib\] Rename `OdsImageTile` to `OdsImageItem` ([#683](https://github.com/Orange-OpenSource/ods-android/issues/683))
- \[Lib\] Update `OdsTab`, `OdsLeadingIconTab`, `OdsTabRow` and `OdsScrollableTabRow` APIs ([#675](https://github.com/Orange-OpenSource/ods-android/issues/675))
Expand Down
2 changes: 1 addition & 1 deletion composable-processor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.orange.ods.gradle.Dependencies

plugins {
kotlin("jvm")
id("com.google.devtools.ksp") version "1.9.0-1.0.13"
id("com.google.devtools.ksp") version "1.9.21-1.0.15"
}

sourceSets.main {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
#Fri May 13 10:10:34 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import com.orange.ods.compose.component.button.OdsButton
* @return [OdsButton.Style] associated to the provided [xmlId]
* BE CAREFUL: If the enum values change you have to update associated XML attributes in the lib-xml
*/
fun OdsButton.Style.Companion.fromXmlAttrValue(xmlId: Int): OdsButton.Style = OdsButton.Style.values()[xmlId]
fun OdsButton.Style.Companion.fromXmlAttrValue(xmlId: Int): OdsButton.Style = OdsButton.Style.entries[xmlId]
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import com.orange.ods.compose.theme.OdsDisplaySurface
* @return [OdsDisplaySurface] associated to the provided [xmlId]
* BE CAREFUL: If the enum values change you have to update associated XML attributes in the lib-xml
*/
fun OdsDisplaySurface.Companion.fromXmlAttrValue(xmlId: Int): OdsDisplaySurface = OdsDisplaySurface.values()[xmlId]
fun OdsDisplaySurface.Companion.fromXmlAttrValue(xmlId: Int): OdsDisplaySurface = OdsDisplaySurface.entries[xmlId]
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ import com.orange.ods.compose.component.button.OdsTextButton
* @return [OdsTextButton.Style] associated to the provided [xmlId]
* BE CAREFUL: If the enum values change you have to update associated XML attributes in the lib-xml
*/
fun OdsTextButton.Style.Companion.fromXmlAttrValue(xmlId: Int): OdsTextButton.Style = OdsTextButton.Style.values()[xmlId]
fun OdsTextButton.Style.Companion.fromXmlAttrValue(xmlId: Int): OdsTextButton.Style = OdsTextButton.Style.entries[xmlId]
4 changes: 2 additions & 2 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.orange.ods.gradle.Dependencies
import com.orange.ods.gradle.Versions

plugins {
id("com.google.devtools.ksp") version "1.9.0-1.0.13"
id("com.google.devtools.ksp") version "1.9.21-1.0.15"
id("library")
id("github")
id("kotlin-parcelize")
Expand Down Expand Up @@ -42,7 +42,7 @@ android {
}

sourceSets.configureEach {
java.srcDir("$buildDir/generated/ksp/$name/kotlin/")
java.srcDir("${layout.buildDirectory}/generated/ksp/$name/kotlin/")
}
}

Expand Down

0 comments on commit d8bfd21

Please sign in to comment.