-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
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
Capture scrollable content #59
Labels
enhancement
New feature or request
Comments
@jsericksk Thanks for the solutions. Will see how these can fit in this library |
Thanks @jsericksk . you solution worked like charm. |
It seems to be possible to use AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data("https://raw.githubusercontent.com/PatilShreyas/Capturable/master/art/header.png")
.allowHardware(false)
.crossfade(true)
.build(),
contentDescription = null,
modifier = Modifier
.size(200.dp)
.clip(RoundedCornerShape(12.dp)),
contentScale = ContentScale.Crop
) |
Merged
This issue has been fixed and released in version 2.0.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those who are looking for a solution to capture scrollable content, I've created a small solution that I believe with some modifications and improvements, could be a functionality of the library.
The solution is based on AndroidView with a ScrollView with Composable content. The difference is that the captured content is that of the ScrollView, with
scrollView.getChildAt(0).height
. Since ScrollableCapturable is scrollable by default, it is important not to use other scrollable layouts such as LazyColumn or scrollable Column.Unfortunately, in my tests,
drawToBitmapPostLaidOut()
did not work as expected to resolve the problems with network image loading. Despite solving problems with "Software rendering doesn't support hardware bitmaps", the Bitmap image is distorted and the Composable content is not completely captured.The solution I found for this, which is not really a solution, is to use a different library and test if the problem disappears. In my case, I used the landscapist library (with the glide version) instead of the coil and it worked fine.
ScrollableCapturable:
Example of use:
Screenshots:
The text was updated successfully, but these errors were encountered: