Guys need your help, I'm using an HorizontalPager,...
# compose-android
f
Guys need your help, I'm using an HorizontalPager, to create a pager which have for content a video (with
resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM
) My issue is that the next page's video is overlapping the content of my current page (see the white rectangle), I don't succeed to clip the video inside my card keeping the zoom resizeMode, any ideas ?
Copy code
HorizontalPager(
     modifier = Modifier.fillMaxWidth().fillMaxHeight().background(Color.Green),
     state = pagerState,
     pageSpacing = 10.dp,
     pageSize = PageSize.Fixed(maxWidth * 0.7f),
     contentPadding = PaddingValues(horizontal = (maxWidth * 0.3f) / 2),
) { page ->
        val pageOffset = ((pagerState.currentPage - page) + pagerState.currentPageOffsetFraction).absoluteValue
        PMExercicePage(
            offset = pageOffset,
            modifier = Modifier.fillMaxWidth().fillMaxHeight()
                         .graphicsLayer {
                            scaleX = lerp(
                                start = 0.85f,
                                stop = 1f,
                                fraction = 1f - pageOffset.coerceIn(0f, 1f)
                            )
                            scaleY = lerp(
                                start = 0.85f,
                                stop = 1f,
                                fraction = 1f - pageOffset.coerceIn(0f, 1f)
                            )
                        },
                    onClick = onClick,
                )
            }
PMExercicePage contains:
Copy code
AndroidView(
        factory = { context ->
            PlayerView(context).apply {
                player = exoPlayer
                player?.playWhenReady = true
                hideController()
                useController = false
                resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM
            }
        },
        modifier = modifier,
    )