Capturable icon indicating copy to clipboard operation
Capturable copied to clipboard

New Modifier API: Capture from canvas directly without `AndroidView`

Open PatilShreyas opened this issue 1 year ago • 4 comments

Discussed in https://github.com/PatilShreyas/Capturable/discussions/98

Originally posted by yschimke June 8, 2023 Could Capturable use this alpha API to capture the image instead of an AndroidView?

https://cs.android.com/androidx/platform/frameworks/support/+/f60a1149f00d6cc5972e9bd4057eb4a15505b468:compose/ui/ui-graphics/samples/src/main/java/androidx/compose/ui/graphics/samples/DrawScopeSample.kt;l=131

PatilShreyas avatar Jun 09 '23 07:06 PatilShreyas

https://twitter.com/riggaroo/status/1693961082761625825?t=kfgghffcZXsuhus0txy90w&s=19

Think you saw this already

yschimke avatar Aug 22 '23 21:08 yschimke

I tested the code you put in the #103 and the problem with capturing scrollable content continues, even though you mentioned that the new API solved this problem. Is it really working for you? Is there anything else that needs to be done to make Column(Modifier.verticalScroll()) work? It also doesn't work with documentation snippet.

jsericksk avatar Oct 28 '23 22:10 jsericksk

@jsericksk Yes, when I tested, it worked nicely. Can you share me a snippet or a sample?

PatilShreyas avatar Oct 29 '23 08:10 PatilShreyas

Sorry, @PatilShreyas. I realized that when I was testing, I was applying Modifier.capturable() to the parent component and not to the capturable component directly, so I was only capturing the currently visible part. It's working normally now. Looking forward to the next release!

jsericksk avatar Oct 29 '23 15:10 jsericksk

This issue has been fixed and released in version 2.0.0.

PatilShreyas avatar Jan 25 '24 15:01 PatilShreyas