Skip to content

Commit

Permalink
#2 - Favorite collection card - Material Surface
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg3410 committed Jan 26, 2023
1 parent 176c584 commit b4aff3e
Showing 1 changed file with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,31 @@ fun AlignYourBodyElement(
// Step: Favorite collection card - Material Surface
@Composable
fun FavoriteCollectionCard(
@DrawableRes drawable: Int,
@StringRes text: Int,
modifier: Modifier = Modifier
) {
// Implement composable here
Surface(
shape = MaterialTheme.shapes.small,
modifier = modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.width(192.dp)
) {
Image(
painter = painterResource(id = drawable),
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier.size(56.dp)
)
Text(
text = stringResource(id = text),
style = MaterialTheme.typography.h3,
modifier = Modifier.padding(horizontal = 16.dp)
)
}
}
}

// Step: Align your body row - Arrangements
Expand Down Expand Up @@ -194,6 +216,8 @@ fun AlignYourBodyElementPreview() {
fun FavoriteCollectionCardPreview() {
MySootheTheme {
FavoriteCollectionCard(
drawable = R.drawable.fc2_nature_meditations,
text = R.string.fc2_nature_meditations,
modifier = Modifier.padding(8.dp)
)
}
Expand Down

0 comments on commit b4aff3e

Please sign in to comment.