Artur Schwarz

    Artur Schwarz

    1 year ago
    Hi everyone! Can anyone explain why this is happening? This doesn’t happen when using views only. Could this be a bug in compose? Code in 🧵
    @Composable
    fun MainScreenContent(previewView: PreviewView? = null) {
        val context = LocalContext.current
    
        Row(modifier = Modifier.fillMaxSize()) {
            AndroidView(modifier = Modifier.fillMaxHeight().weight(2f), factory = { ctx ->
                previewView ?: View(context)
            })
            Column(
                modifier = Modifier
                    .fillMaxSize()
                    .weight(0.7f)
                    .padding(32.dp),
                verticalArrangement = Arrangement.SpaceBetween,
                horizontalAlignment = Alignment.CenterHorizontally
            ) {
                Text(style = MaterialTheme.typography.h2, text = "Fotos")
                LazyColumn() {
    
                }
                Button(modifier = Modifier.fillMaxWidth(), onClick = { /*TODO*/ }) {
                    Text(text = "Aufnehmen")
                }
            }
        }
    }
    pawegio

    pawegio

    1 year ago
    @Artur Schwarz I had a similar issue with CameraX in compose few months ago, the workaround was to use TextureView:
    previewView.implementationMode = PreviewView.ImplementationMode.COMPATIBLE
    Artur Schwarz

    Artur Schwarz

    1 year ago
    @pawegio Thank you!
    Neal Sanche

    Neal Sanche

    1 year ago
    There's already a bug report in for this, and recently I heard it was assigned. So hopefully it'll get fixed soon.