Closed marosseleng closed 1 year ago
Can you verify that AS preview is generated properly for this compostable? It might be not supported properly by layoutlib.
Sure, at least on Flamingo it seems to behave correctly. But I'm not sure whether preview in AS knows about the desired device's size.
@marosseleng Can you try/confirm on Electric Eel? That's the version of layoutlib backing version 1.2.0.
@jrodbx It, indeed, seems that the problem is with layoutlib, as the same problem happens on Electric Eel (2022.1.1 #AI-221.6008.13.2211.9477386).
Confirmed as fixed in Flamingo
@jrodbx It was either never fixed or it's a regression: I can still observe this issue on Paparazzi 1.3.1 and also in Android Studio Giraffe (2023.3.1, #AI-223.8836.35.2231.10406996)
Still an issue with latest Paparazzi 1.3.4 (Iguana layout lib).
I'm using Jellybug (canary) and I am seeing that normal preview does NOT have this problematic behavior. Maybe its actually fixed now.
@efemoney Jellyfish/Ladybug?
Haha, Ladybug. Sorry, slow day 😅
Update here, this issue is unfortunately still present with AS Koala (LayoutLib 14.0.11) and AS Ladybug (LayoutLib 15.0.4)
Ladybug Feature Drop [Left] Ladybug Patch 1 [Right]
Description Rendering a
@Composable
containingAlertDialog
withDialogProperties.usePlatformDefaultWidth = false
results in dialog to be cropped if it is wider than the platform default width. I found that property to be a culprit, while adding screenshot tests for my library (draft PR). Screenshots ofTimePickerDialog
look fine, however inDatePickerDialog
screenshots, the dialog's width is always cropped. The only difference in dialog's configuration isDialogProperties.usePlatformDefaultWidth = false
for the date picker.Steps to Reproduce Use the following composable:
with Paparazzi config:
Snapshot of the above called in
paparazzi.snapshot {}
(dialog's width is cropped) - First screenshotWhen we change
usePlatformDefaultWidth
totrue
, thepaparazzi.snapshot{}
crops the content instead (consistent with the "real" behavior ofusePlatformDefaultWidth = true
, which is default) - Second screenshotExpected behavior I would expect the dialog would stretch. Screenshot of running
@Preview @Composable
of the above - third screenshotAdditional information:
Screenshots Paparazzi-usePlatformDefaultWidth=false Paparazzi-usePlatformDefaultWidth=true Emulator preview (Pixel 6 Pro)
Thanks for any inpu!