[Q] Weird transition behavior & AndroidView no...
# compose
j
[Q] Weird transition behavior & AndroidView not clipping bounds
So, I am building an app that opens a CameraPreview (using this library for now https://github.com/ujizin/Camposer) . However, it seems like the CameraPreview, for the time of transition, is not staying within it’s bounds. To illustrate the behavior I am wrapping the Preview in a BoxWithConstraints and settings the requiredSize to height/width - 100.dp (that explains the gap on the side and bottom. So like this:
Copy code
BoxWithConstraints(modifier.background(Color.Red)) {

    CameraPreview(
        cameraState = cameraState,
        imageAnalyzer = imageAnalyzer,
        enableTorch = isTorchOn,
        isFocusOnTapEnabled = false,
        modifier = Modifier.requiredSize(this.maxWidth - 100.dp, this.maxHeight - 100.dp)
    ) { .... }
}
The translation used is:
Copy code
val slideInHorizontallyAndFadeIn = slideInHorizontally(
    initialOffsetX = { 300 },
    animationSpec = tween(
        durationMillis = 400,
        easing = FastOutSlowInEasing
    )
) + fadeIn(animationSpec = tween(400))
Any idea what cold cause this?
n
j
Thanks 🙏
@natario1, I am still struggling with this. Do you know of any workaround?
n
No 😞
j
Nasty 😞