-
Notifications
You must be signed in to change notification settings - Fork 221
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
New feature, viewOnly, to ignore the device frame #591
Conversation
This works in two ways: - Just viewOnly omits the system bars - viewOnly with RenderingMode.EXPAND also changes the output size to match the view
If ever we do a 2.x, it’d be nice to remove |
Some interesting outputs!This button renders just the pixels we need. It’s still scaled up to be 1000px wide, and that’s bad! I’m hoping to address that in the interceptors follow-up. (#589) This button word-wraps at the width of the target device. This is using This ultrawide button doesn’t word wrap at all. It’s using This button renders in a canvas as if there’s a device frame, cause we’re using |
@@ -89,7 +93,8 @@ class Paparazzi @JvmOverloads constructor( | |||
private val maxPercentDifference: Double = 0.1, | |||
private val snapshotHandler: SnapshotHandler = determineHandler(maxPercentDifference), | |||
private val renderExtensions: Set<RenderExtension> = setOf(), | |||
private val supportsRtl: Boolean = false | |||
private val supportsRtl: Boolean = false, | |||
private val viewOnly: Boolean = false |
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.
viewOnly
is reminding me of file attributes such as read only
.
Considering that our usages of the term View
is going to only go down as we slowly write everything as composables, can I propose using something agnostic instead? maybe hideDeviceFrame
?
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.
Good call. Let’s workshop a new name.
Two consequences:
- no frame
- no device dimensions
Any other suggestions?
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.
Another suggestion is to match what Android Studio uses for emulators -- enableDeviceFrame
Hey, I also tried to solve this problem in my PR: #550
|
This is also fixed by #497 and here are some of my thoughts:
|
I’m using As I see them these are the interesting constraints.
|
This works in two ways:
Closes: #37