Azam Khan
08/04/2021, 2:49 PMAzam Khan
08/04/2021, 2:51 PMColumn(modifier, horizontalAlignment = Alignment.CenterHorizontally) {
Spacer(modifier = Modifier.height(10.dp))
Text(profile.name, style = MaterialTheme.typography.h6)
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) {
Text(profile.bio, style = MaterialTheme.typography.body2)
}
Image(
painter = rememberImagePainter(
profile.avatarUrl,
builder = { crossfade(true); transformations(CircleCropTransformation()) }
),
contentDescription = ...,
modifier = Modifier
.offset(y = (50).dp)
.size(120.dp)
.zIndex(2f)
)
Surface(
color = Color.White,
shape = RoundedCornerShape(0),
modifier = Modifier
.fillMaxSize()
.zIndex(1f)
) {
}
}
Anthony
08/04/2021, 3:14 PMAnthony
08/04/2021, 3:15 PMAzam Khan
08/04/2021, 3:31 PMChris Sinco [G]
08/04/2021, 9:53 PMChris Sinco [G]
08/04/2021, 9:54 PMChris Sinco [G]
08/04/2021, 9:55 PMLuis
08/04/2021, 11:15 PMColumn(background = Black) {
Text()
Text()
Image(
Modifier.drawBehind {
drawIntoCanvas {
drawRect() //black
drawRect() //white
}
}
)
}
Azam Khan
08/05/2021, 4:25 PMColumn(
modifier = modifier,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(...)
Text(...)
Spacer(modifier = Modifier.height(10.dp + ProfileImageSize / 2))
ConstraintLayout(
modifier = Modifier
.fillMaxSize()
.background(Color.White)
) {
val (image, grid) = createRefs()
Image(
painter = rememberImagePainter(
profile.avatarUrl,
builder = { crossfade(true); transformations(CircleCropTransformation()) }
),
contentDescription = stringResource(R.string.profile_photography_avatar_desc),
modifier = Modifier
.constrainAs(image) {
top.linkTo(<http://parent.top|parent.top>)
centerHorizontallyTo(parent)
}
.offset(y = -ProfileImageSize / 2)
.size(ProfileImageSize)
)
PostsGrid(
posts = profile.posts,
modifier = Modifier
.constrainAs(grid) {
top.linkTo(image.bottom)
bottom.linkTo(parent.bottom)
centerHorizontallyTo(parent)
}
.fillMaxSize(),
onPostClick = {}
)
}
}