We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! Thank you for library. I`m now crearting an ar app with compose and need to add node with custom compose view.
I tried with ViewNode2:
private fun **createViewNode**(context: Context, engine: Engine): ViewNode2 { val composeView = ComposeView(context).apply { setContent { RenderableLayout() }} return ViewNode2( engine = engine, windowManager = ViewNode2.WindowManager(context), materialLoader = MaterialLoader(engine, context), view = composeView ) }
my composable:
@Composable fun RenderableLayout(text: String) { MaterialTheme { Card( modifier = Modifier.size(100.dp), shape = MaterialTheme.shapes.medium, colors = CardColors( containerColor = Color.White, contentColor = Color.White, disabledContainerColor = Color.Yellow, disabledContentColor = Color.Green ) ) { Text( modifier = Modifier .padding(2.dp) .align(Alignment.CenterHorizontally), text = text, style = MaterialTheme.typography.bodyLarge.copy(color = Color.Black), ) } } }
used:
... onGestureListener = rememberOnGestureListener(onSingleTapConfirmed = { motionEvent, node -> if (node == null) { frame?.hitTest(motionEvent)?.firstOrNull { hitResult -> AnchorNode( engine = engine, anchor = hitResult.createAnchor() ).also { anchorNode -> childNodes += anchorNode **createViewNode**(context, engine).apply { parent = anchorNode } } true } } else { node.parent = null } })
The best I could achieve:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! Thank you for library.
I`m now crearting an ar app with compose and need to add node with custom compose view.
I tried with ViewNode2:
my composable:
used:
The best I could achieve:
But the view is plain black (I suppose it is not rendered).
Can you help me to understand, where is problem and how to fix it?
The text was updated successfully, but these errors were encountered: