Skip to content

Commit

Permalink
feat(ui): enhance ReaderImageViewer Interactive gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashinch committed Jul 12, 2024
1 parent 1578ba6 commit 5cb2029
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ fun ReaderImageViewer(
).data(data = imageData.imageUrl).build()
)

var expanded by remember { mutableStateOf(false) }

LaunchedEffect(painter.intrinsicSize) {
zoomableState.setContentLocation(
ZoomableContentLocation.scaledInsideAndCenterAligned(painter.intrinsicSize)
Expand All @@ -89,7 +91,13 @@ fun ReaderImageViewer(
painter = painter,
contentDescription = imageData.altText,
modifier = Modifier
.zoomable(state = zoomableState, clipToBounds = true)
.zoomable(state = zoomableState, clipToBounds = true,
onClick = {
onDismissRequest()
},
onLongClick = {
expanded = true
})
.fillMaxSize(),
alignment = Alignment.Center,
contentScale = ContentScale.Inside
Expand All @@ -110,7 +118,7 @@ fun ReaderImageViewer(
contentDescription = stringResource(id = R.string.close),
)
}
var expanded by remember { mutableStateOf(false) }

IconButton(
onClick = { expanded = true }, colors = IconButtonDefaults.iconButtonColors(
containerColor = Color.Black.copy(alpha = 0.5f), contentColor = Color.White
Expand Down

0 comments on commit 5cb2029

Please sign in to comment.