I have a GlideImage that is inside a Box. Inside that Box, there is also a button with an icon. I want that, when I click on the button, the image is maximized and occupies the whole screen with a button in the lower right corner where it is possible to minimize it. I would also like to zoom in on it. Does anyone know how I can do this and if it's possible in the current state of Jetpack Compose?
I leave you the code I have to generate the Box, with the image and the icon.
Thanks in advance for any help.
@ExperimentalGlideComposeApi
@Composable
fun BuildImage(imageUrl: String) {
Box(
modifier = Modifier
.padding(vertical = 25.dp, horizontal = 25.dp)
.background(
brush = Brush.linearGradient(
listOf(
Color.Gray,
Color.White
)
),
shape = RoundedCornerShape(14.dp)
)
.clip(RoundedCornerShape(14.dp))
) {
GlideImage(
model = imageUrl,
contentDescription = null,
contentScale = ContentScale.FillBounds
)
Box(modifier = Modifier.matchParentSize(), contentAlignment = Alignment.BottomEnd) {
IconButton(
onClick = { /* TO IMPLEMENT */ },
modifier = Modifier
.padding(11.dp)
.background(Color.Blue, RoundedCornerShape(3.dp))
.clip(RoundedCornerShape(3.dp))
.size(52.dp)
) {
Icon(
painter = painterResource(id = R.drawable.maximize),
contentDescription = null,
tint = Color.Unspecified
)
}
}
}
}