Skip to content

Commit

Permalink
dhont/ANDROID-15405-postercard: Update correct reference to resource …
Browse files Browse the repository at this point in the history
…in PosterCard() main component
  • Loading branch information
dhonti-axpe committed Nov 28, 2024
1 parent 6b3637a commit 4c400f5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.telefonica.mistica.compose.card.postercard

import androidx.annotation.DrawableRes
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.BoxWithConstraints
Expand All @@ -13,6 +14,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.semantics.focused
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.telefonica.mistica.compose.tag.Tag
Expand Down Expand Up @@ -48,6 +51,9 @@ fun PosterCard(
min = maxWidth / aspectRatio.ratio,
max = Dp.Infinity
)
.semantics {
focused = true
}
) {
PosterCardBackground(backgroundType = backgroundType) {
Column(
Expand Down Expand Up @@ -88,7 +94,7 @@ enum class PosterCardAspectRatio(val ratio: Float) {
}

sealed class PosterCardBackgroundType(open var inverseDisplay: Boolean) {
data class Image(val imageResource: Int, val contentDescription: String = "") : PosterCardBackgroundType(inverseDisplay = true)
data class Image(@DrawableRes val imageResource: Int, val contentDescription: String = "") : PosterCardBackgroundType(inverseDisplay = true)
data class Color(val brush: Brush, override var inverseDisplay: Boolean = true) : PosterCardBackgroundType(inverseDisplay = inverseDisplay)
}

0 comments on commit 4c400f5

Please sign in to comment.