-
Notifications
You must be signed in to change notification settings - Fork 220
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
base: master
Are you sure you want to change the base?
Conversation
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.
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 { |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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.