Skip to content
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

Initial code for Paparazzi interceptors #589

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

4 participants