Pinch Zoom in Jetpack Compose
2 min readOct 31, 2023
Please grab a cup of coffee ☕ and let’s see how to implement the pinch zoom gesture in Jetpack Compose.
First of all, let’s start by creating scale
and offset
. These will keep track of the current scale and offset of the content.
var scale by remember {
mutableStateOf(1f)
}
var offset by remember {
mutableStateOf(Offset.Zero)
}