🌐https://www.rivu.dev/
youtube.com/@rivutalks
@rivuchakraborty
@
[email protected]
An Overloaded
Composable
Function
@Composable
fun ProfileScreenOverloaded(
profileData: ProfileData,
postsList: List,
modifier: Modifier = Modifier
) {
LazyVerticalGrid(
modifier = modifier,
columns = GridCells.Fixed(2)
) {
item(span = { GridItemSpan(2) }) {
Column {
AsyncImage(
model = profileData.profileImageUrl,
contentDescription = profileData.name,
modifier = Modifier
.size(128.dp)
.align(Alignment.CenterHorizontally)
.clickable {
//Handle Profile Photo Click
},
)
Text(
text = profileData.name,
style = MaterialTheme.typography.h2,
modifier = Modifier
.align(Alignment.CenterHorizontally),
)
Text(
text = profileData.location,
style = MaterialTheme.typography.body1,
modifier = Modifier
.align(Alignment.CenterHorizontally),
)
Button(
onClick = { /*Follow Button Action*/ },
modifier = Modifier
.align(Alignment.CenterHorizontally)
.background(Color.Black),
) {
Text(
text = "Follow ${profileData.name}",
style = MaterialTheme.typography.body2,
)
}
Button(
onClick = { /*Message Button Action*/ },
modifier = Modifier
.align(Alignment.CenterHorizontally)
.border(1.dp, color = Color.Black,
shape = RoundedCornerShape(5.dp)),
) {
Text(
text = "Message",
style = MaterialTheme.typography.body1,
)
}
}
}
items(postsList) {
AsyncImage(
model = profileData.profileImageUrl,
contentDescription = profileData.name,
modifier = Modifier
.width(167.dp).height(220.dp)
.clickable {
//Handle Post Photo Click
},
)
}
}
}