Skip to content

Commit

Permalink
[#579] Review: Use a common image background color for all images
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea committed Sep 28, 2023
1 parent 716bcff commit 4c92955
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
)
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/orange/ods/app/ui/modules/Module.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4c92955

Please sign in to comment.