question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I took a stab at getting a ComposeView working with Paparazzi. It doesn’t work with 0.7.0, but I managed to get it working on the native layoutlib branch with a bit of hackery. I think most of this is solved by using native/newer layoutlib, but It’d be great if there was a built-in paparazzi.snapshot(content: @Composable () -> Unit) at some point

  • Compose calls ViewTreeLifecycleOwner/ViewTreeSavedStateRegistryOwner.get(rootView). A workaround for now is to wrap the ComposeView in a FrameLayout which sets these on the root view in onAttachedToWindow
  • I had to provide mocked versions of AutofillManager and ClipboardManager as the 4.1.0 layoutlib doesn’t provide them from BridgeContext, and Compose looks them both up when initialising. It looks like the latest prebuilt from mirror-goog-studio-master-dev does, but I can’t get past an unsatisfiedlinkerror when trying to use it. Pre-releases of studio aren’t tagged, so I have no idea whether the 4.2.0 version has support for these or not…

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:37
  • Comments:7

github_iconTop GitHub Comments

10reactions
ncipollocommented, Oct 29, 2021

For posterity, here are the hacks I used to get this to work with 0.8.0: https://gist.github.com/ncipollo/5d34ef0f533dbbad01fe6af932240bf6

1reaction
jrodbxcommented, Feb 15, 2022

@timrijckaert apologies, but WIP branches aren’t ready for support 😉

On the CashApp team, we’re using the commit you referenced internally and it seems to be working fine. If i had to guess, maybe your compileSdk is 31 which Paparazzi/Layoutlib doesn’t yet support as of https://github.com/cashapp/paparazzi/issues/264.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compose Help
Compose Database-as-a-Service Help and Documentation · Compose Hosted · Compose Enterprise · Accounts & Billing · Security and Compliance · Support · Essentials....
Read more >
Jetpack Compose UI App Development Toolkit
Powerful. Create beautiful apps with direct access to the Android platform APIs and built-in support for Material Design, Dark theme, animations, and more....
Read more >
Introducing Jetpack Compose Support - PSPDFKit
The Android PDF SDK you know and love now supports Jetpack Compose! ... Unveiling Jetpack Compose support as part of the 8.0 release...
Read more >
compose - platform/frameworks/support - Git at Google
Syntax. Jetpack Compose uses composable functions instead of XML layouts to define UI components. You can see this in action in the demos,...
Read more >
Docker Compose release notes
Added support for windows/arm64 and linux/riscv64. Updates . Updated Dockerfile syntax to latest stable and renamed docs Dockerfile. Dependencies update: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found