Skip to content

Conversation

@swankjesse
Copy link
Collaborator

I think this is how we should implement features like device frames and image resizing. It also permits other integrated annotations, such as drawing layout bounds onto the output image.

I think this is how we should implement features like device frames
and image resizing. It also permits other integrated annotations,
such as drawing layout bounds onto the output image.
@swankjesse
Copy link
Collaborator Author

Before I land this I think I gotta support snapshots of views only without any device bounds.

*
* Implementations may operate on the input view, the returned bitmap, or both.
*/
interface Interceptor {
Copy link
Collaborator

@geoff-powell geoff-powell Oct 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this api as it works similar to retrofit interceptor. This also seems as a API replacement for RenderExtension which is used to render on top of the layout lib output.
(edit noticed RenderExtension.toInterceptor method so you had the same thought :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one issue I know I came across with RenderExtension returning BufferedImage is that there were issues finding java.awt classes for drawing when creating your own instance within your codebase.


interface Chain {
val deviceConfig: DeviceConfig
val view: View
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the timing of events with regard to creating the View? Can I set something like a Coil ImageLoader before the view gets rendered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants