@@ -2,6 +2,7 @@ package com.google.firebase.example.dataconnect.ui.components
22
33import androidx.compose.foundation.clickable
44import androidx.compose.foundation.layout.Column
5+ import androidx.compose.foundation.layout.Row
56import androidx.compose.foundation.layout.Spacer
67import androidx.compose.foundation.layout.fillMaxWidth
78import androidx.compose.foundation.layout.height
@@ -11,6 +12,7 @@ import androidx.compose.foundation.layout.sizeIn
1112import androidx.compose.foundation.lazy.LazyRow
1213import androidx.compose.foundation.lazy.items
1314import androidx.compose.foundation.shape.CircleShape
15+ import androidx.compose.material3.Card
1416import androidx.compose.material3.MaterialTheme
1517import androidx.compose.material3.Text
1618import androidx.compose.runtime.Composable
@@ -22,7 +24,7 @@ import androidx.compose.ui.text.style.TextOverflow
2224import androidx.compose.ui.unit.dp
2325import coil.compose.AsyncImage
2426
25- val ACTOR_CARD_SIZE = 80 .dp
27+ val ACTOR_CARD_SIZE = 64 .dp
2628
2729/* *
2830 * Used to represent an actor in a list UI
@@ -68,31 +70,38 @@ fun ActorTile(
6870 actor : Actor ,
6971 onActorClicked : (actorId: String ) -> Unit
7072) {
71- Column (
72- horizontalAlignment = Alignment .CenterHorizontally ,
73+ Card (
7374 modifier = Modifier
74- .sizeIn(
75- maxWidth = ACTOR_CARD_SIZE ,
76- maxHeight = ACTOR_CARD_SIZE + 32 .dp
77- )
78- .padding(4 .dp)
75+ .padding(end = 8 .dp)
7976 .clickable {
8077 onActorClicked(actor.id)
8178 }
8279 ) {
83- AsyncImage (
84- model = actor.imageUrl,
85- contentDescription = null ,
86- contentScale = ContentScale .Crop ,
80+ Row (
81+ verticalAlignment = Alignment .CenterVertically ,
8782 modifier = Modifier
88- .size(ACTOR_CARD_SIZE )
89- .clip(CircleShape )
90- )
91- Text (
92- text = actor.name,
93- style = MaterialTheme .typography.bodyLarge,
94- maxLines = 1 ,
95- overflow = TextOverflow .Ellipsis
96- )
83+ .sizeIn(
84+ maxWidth = 160 .dp,
85+ maxHeight = ACTOR_CARD_SIZE + 16 .dp
86+ )
87+ .padding(8 .dp)
88+ .fillMaxWidth()
89+ ) {
90+ AsyncImage (
91+ model = actor.imageUrl,
92+ contentDescription = null ,
93+ contentScale = ContentScale .Crop ,
94+ modifier = Modifier
95+ .padding(end = 8 .dp)
96+ .size(ACTOR_CARD_SIZE )
97+ .clip(CircleShape )
98+ )
99+ Text (
100+ text = actor.name,
101+ style = MaterialTheme .typography.bodyLarge,
102+ maxLines = 2 ,
103+ overflow = TextOverflow .Ellipsis ,
104+ )
105+ }
97106 }
98107}
0 commit comments