Skip to content

Commit 0075d37

Browse files
author
Section One
committed
Codi JC16 - Llistat d'elements en Jetpack Compose
1 parent f7b7d74 commit 0075d37

File tree

1 file changed

+37
-18
lines changed

1 file changed

+37
-18
lines changed

app/src/main/java/es/cibernarium/jetpackcomposeapp/MainActivity.kt

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,58 @@ class MainActivity : ComponentActivity() {
4848
) {
4949
//Tot el que posem aqui serà la part visible de la nostre Aplicació
5050
Column(
51-
modifier = Modifier.padding(15.dp).fillMaxWidth(),
52-
horizontalAlignment = Alignment.CenterHorizontally
51+
modifier = Modifier.padding(15.dp)
5352
) {
54-
55-
Avatar()
56-
SalutacioPersonal(nom = "Francesc")
57-
Description()
53+
Element()
54+
Element()
55+
Element()
56+
Element()
57+
Element()
58+
Element()
59+
Element()
60+
Element()
61+
Element()
62+
Element()
63+
Element()
64+
Element()
5865
}
5966
}
6067
}
6168
}
6269
}
6370

6471
@Composable
65-
private fun SalutacioPersonal(nom: String){
66-
MaterialTheme() {
67-
Text(
68-
text = "Hola $nom!",
69-
color = Color.Red,
70-
fontSize = 18.sp,
71-
fontStyle = FontStyle.Italic,
72-
fontWeight = FontWeight.Bold,
73-
fontFamily = Serif,
74-
style = MaterialTheme.typography.titleMedium
75-
)
72+
private fun Element(){
73+
Row {
74+
Avatar()
75+
Column(
76+
modifier = Modifier.padding(15.dp)
77+
) {
78+
SalutacioPersonal(nom = "Francesc")
79+
Description()
80+
}
7681
}
7782
}
7883
@Composable
84+
private fun SalutacioPersonal(nom: String){
85+
Text(
86+
text = "Hola $nom!",
87+
color = Color.Red,
88+
fontSize = 18.sp,
89+
fontStyle = FontStyle.Italic,
90+
fontWeight = FontWeight.Bold,
91+
fontFamily = FontFamily.Serif
92+
)
93+
}
94+
@Composable
7995
private fun Avatar(){
8096
Image(
8197
painter = painterResource(R.drawable.qx7jysym_400x400),
8298
contentDescription = "Logo Refus",
83-
modifier = Modifier.height(100.dp)
99+
modifier = Modifier
100+
.height(100.dp)
101+
.clip(CircleShape)
102+
.background(Color.Blue)
84103
)
85104
}
86105
@Composable

0 commit comments

Comments
 (0)