Skip to content

Commit

Permalink
dhonti/ANDROID-15405-postercard: Change colors to support dark mode t…
Browse files Browse the repository at this point in the history
…op actions
  • Loading branch information
dhonti-axpe committed Nov 29, 2024
1 parent bdea242 commit a3f85e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.telefonica.mistica.compose.card.postercard

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -37,7 +38,7 @@ internal fun PosterCardSolidColor() {
}
}

@Preview
@Preview(name = "Dark Mode", uiMode = Configuration.UI_MODE_NIGHT_YES, showBackground = true)
@Composable
internal fun PosterCardGradientColor() {
MisticaTheme(brand = TuBrand) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal fun PosterCardTopActions(
Row(
modifier = modifier
.fillMaxWidth()
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 8.dp),
.padding(8.dp),
horizontalArrangement = Arrangement.End,
verticalAlignment = Alignment.CenterVertically
) {
Expand All @@ -47,7 +47,7 @@ internal fun PosterCardTopActions(
}
secondTopAction?.let {
if (firstTopAction != null) {
Spacer(modifier = Modifier.width(16.dp))
Spacer(modifier = Modifier.width(4.dp))
}
TopAction(topActionData = it, modifier = Modifier.semantics {
traversalIndex = 9f
Expand All @@ -62,13 +62,14 @@ internal fun TopAction(modifier: Modifier, topActionData: TopActionData) {
Box(
modifier = modifier
.testTag(testTag.orEmpty())
.size(40.dp)
.size(48.dp)
.padding(4.dp)
.clip(CircleShape)
.clickable { onClick() }
.background(
color = when {
isInverse -> Color.Transparent
withBackground -> MisticaTheme.colors.inverse.copy(alpha = 0.8f)
withBackground -> MisticaTheme.colors.controlInverse.copy(alpha = 0.8f)
else -> Color.Transparent
}
)
Expand Down

0 comments on commit a3f85e6

Please sign in to comment.