diff --git a/app/src/main/java/com/orange/ods/app/ui/components/Component.kt b/app/src/main/java/com/orange/ods/app/ui/components/Component.kt index 807eb32ed..add085a1e 100644 --- a/app/src/main/java/com/orange/ods/app/ui/components/Component.kt +++ b/app/src/main/java/com/orange/ods/app/ui/components/Component.kt @@ -51,11 +51,6 @@ sealed class Component( val demoScreen: @Composable (variant: Variant?, upPress: () -> Unit) -> Unit, val imageAlignment: Alignment = Alignment.Center, ) { - - companion object { - const val ImageBackgroundColor = 0xff1b1b1b - } - val id: Long = Component::class.sealedSubclasses.indexOf(this::class).toLong() object AppBarsTop : Component( 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 8b2fcf4e1..9d41cca2d 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 @@ -73,7 +73,7 @@ private fun RowScope.ComponentCard(component: Component, onComponentClick: (Long "", component.imageAlignment, ContentScale.Fit, - Color(Component.ImageBackgroundColor) + Color(DrawableManager.ImageBackgroundColor) ), onClick = { onComponentClick(component.id) }, ) diff --git a/app/src/main/java/com/orange/ods/app/ui/modules/Module.kt b/app/src/main/java/com/orange/ods/app/ui/modules/Module.kt index 1abe4ba1a..fa4fbeabc 100644 --- a/app/src/main/java/com/orange/ods/app/ui/modules/Module.kt +++ b/app/src/main/java/com/orange/ods/app/ui/modules/Module.kt @@ -24,10 +24,6 @@ sealed class Module( val route: String, val imageAlignment: Alignment = Alignment.Center, ) { - companion object { - const val ImageBackgroundColor = 0xff1b1b1b - } - val id: Long = Module::class.sealedSubclasses.indexOf(this::class).toLong() object About : Module( diff --git a/app/src/main/java/com/orange/ods/app/ui/modules/ModulesScreen.kt b/app/src/main/java/com/orange/ods/app/ui/modules/ModulesScreen.kt index aee01b01c..1f02401af 100644 --- a/app/src/main/java/com/orange/ods/app/ui/modules/ModulesScreen.kt +++ b/app/src/main/java/com/orange/ods/app/ui/modules/ModulesScreen.kt @@ -60,7 +60,7 @@ private fun ColumnScope.ModuleCard(module: Module, onModuleClick: (String) -> Un "", module.imageAlignment, ContentScale.Fit, - Color(Module.ImageBackgroundColor) + Color(DrawableManager.ImageBackgroundColor) ), onClick = { onModuleClick(module.route) } ) diff --git a/app/src/main/java/com/orange/ods/app/ui/utilities/DrawableManager.kt b/app/src/main/java/com/orange/ods/app/ui/utilities/DrawableManager.kt index 65efd2f1a..ceef21cc9 100644 --- a/app/src/main/java/com/orange/ods/app/ui/utilities/DrawableManager.kt +++ b/app/src/main/java/com/orange/ods/app/ui/utilities/DrawableManager.kt @@ -19,6 +19,7 @@ import com.orange.ods.app.ui.utilities.extension.isOrange import com.orange.ods.extension.orElse object DrawableManager { + const val ImageBackgroundColor = 0xff1b1b1b private val orangeResIdByGenericResId = mapOf( // About 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 1ff36e321..a5d4c78af 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,7 +26,7 @@ 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.app.ui.components.Component +import com.orange.ods.app.ui.utilities.DrawableManager import com.orange.ods.compose.text.OdsTextBody1 @Composable @@ -40,7 +40,7 @@ fun DetailScreenHeader( modifier = Modifier .fillMaxWidth() .height(190.dp) - .background(Color(Component.ImageBackgroundColor)), + .background(Color(DrawableManager.ImageBackgroundColor)), contentScale = ContentScale.Fit, contentDescription = null, alignment = imageAlignment