@@ -6,14 +6,18 @@ import androidx.activity.compose.rememberLauncherForActivityResult
66import androidx.activity.result.contract.ActivityResultContracts
77import androidx.compose.foundation.Image
88import androidx.compose.foundation.clickable
9+ import androidx.compose.foundation.layout.Arrangement
910import androidx.compose.foundation.layout.Column
11+ import androidx.compose.foundation.layout.Row
1012import androidx.compose.foundation.layout.fillMaxSize
1113import androidx.compose.foundation.layout.fillMaxWidth
1214import androidx.compose.foundation.layout.height
1315import androidx.compose.foundation.layout.padding
1416import androidx.compose.foundation.lazy.LazyColumn
1517import androidx.compose.foundation.lazy.items
18+ import androidx.compose.foundation.shape.CornerSize
1619import androidx.compose.foundation.shape.RoundedCornerShape
20+ import androidx.compose.material3.AssistChip
1721import androidx.compose.material3.Button
1822import androidx.compose.material3.Card
1923import androidx.compose.material3.Text
@@ -23,11 +27,13 @@ import androidx.compose.runtime.getValue
2327import androidx.compose.runtime.mutableStateOf
2428import androidx.compose.runtime.remember
2529import androidx.compose.runtime.setValue
30+ import androidx.compose.ui.Alignment
2631import androidx.compose.ui.Modifier
2732import androidx.compose.ui.layout.ContentScale
2833import androidx.compose.ui.text.font.FontWeight
2934import androidx.compose.ui.text.style.TextOverflow
3035import androidx.compose.ui.unit.dp
36+ import androidx.compose.ui.unit.sp
3137import androidx.lifecycle.viewmodel.compose.viewModel
3238import coil.compose.rememberAsyncImagePainter
3339import com.davedevab.composetutorial.domain.item.GameItem
@@ -57,7 +63,7 @@ fun GameCard(game: GameItem){
5763 Card (
5864 shape = RoundedCornerShape (16 .dp),
5965 modifier = Modifier
60- .padding(10 .dp)
66+ .padding(16 .dp)
6167 .fillMaxSize()
6268 ) {
6369 Column {
@@ -69,27 +75,50 @@ fun GameCard(game: GameItem){
6975 .fillMaxWidth()
7076 .height(250 .dp)
7177 )
72- Column (modifier = Modifier .padding(8 .dp)) {
73- Text (text = game.title, fontWeight = FontWeight .Bold )
78+ Column (modifier = Modifier .padding(8 .dp),
79+ horizontalAlignment = Alignment .CenterHorizontally ) {
80+ Text (text = game.title, fontWeight = FontWeight .Bold , fontSize = 22 .sp, modifier = Modifier .padding(bottom = 8 .dp))
7481 Text (
7582 text = game.short_description,
7683 maxLines = if (isExpanded) Int .MAX_VALUE else 2 ,
7784 overflow = TextOverflow .Ellipsis ,
85+ fontSize = 16 .sp,
7886 modifier = Modifier
7987 .clickable {
8088 isExpanded = ! isExpanded
8189 }
8290 )
91+ Row (
92+ modifier = Modifier
93+ .fillMaxWidth()
94+ .padding(4 .dp),
95+ horizontalArrangement = Arrangement .Center
96+ ) {
97+ AssistChip (
98+ modifier = Modifier .padding(end = 8 .dp),
99+ onClick = { /* Do something! */ },
100+ label = { Text (game.genre) },
101+ shape = RoundedCornerShape (12 .dp)
102+ )
103+ AssistChip (
104+ modifier = Modifier .padding(end = 8 .dp),
105+ onClick = { /* Do something! */ },
106+ label = { Text (game.platform) },
107+ shape = RoundedCornerShape (12 .dp)
108+
109+ )
110+ }
83111 Button (
84112 onClick = {
85113 // Acción para el primer botón
86114 val url = game.game_url // Supongamos que el modelo proporciona la URL
87115 val intent = Intent (Intent .ACTION_VIEW , Uri .parse(url))
88116 openUrl.launch(intent)
89117 },
90- modifier = Modifier .padding(6 .dp)
118+ modifier = Modifier
119+ .padding(6 .dp)
91120 ) {
92- Text (text = " View Site Game" )
121+ Text (text = " View Site Game" , fontSize = 14 .sp )
93122 }
94123 }
95124 }
0 commit comments