Assigned
Status Update
Comments
ja...@google.com <ja...@google.com>
ad...@google.com <ad...@google.com>
pa...@google.com <pa...@google.com>
mo...@joyn.de <mo...@joyn.de> #2
Any updates on this issue?
am...@google.com <am...@google.com>
gr...@apps.disney.com <gr...@apps.disney.com> #3
Any updates on this feature request?
ub...@gmail.com <ub...@gmail.com> #4
For starters, it would already help a lot to maybe use the toString()
function of the parameter type. It is usually a data class/sealed class/sealed interface, so that might help a lot already.
y-...@unext.jp <y-...@unext.jp> #5
With the growing demand for screenshot testing, the importance of the Compose Preview feature has increased significantly.
In particular, the ability to name a Preview when using PreviewParameter is extremely useful, so I would greatly appreciate support for this feature.
I apologize if this request seems presumptuous, but thank you in advance for your consideration.
it...@gmail.com <it...@gmail.com> #6
Any updates???
Description
Description:
When using PreviewParameterProviders the names of the generated previews is
[PreviewName] ([ParameterName] [Index])
it would be useful if the PreviewParamters could define names for the previews generated from itUse Case:
A UI can have different states depending on the data given. With Preview Parameters it's very easy to give or even generate the data to show all of the possible UI states (e.g. empty, one entry, multiple entries, error in a List). Giving descriptive names to the previews would make it obvious if something is wrong with the UI. (e.g a preview called "favourite-list Error" State would obviously be wrong if no error is shown in the preview)
Workaround:
It is possible to give the preview parameter a separate property with a name and then render that text into the preview. But that changes the preview itself and is not possible if the preview is screen level and is required to fill the entire screen
Implementation Ideas:
Two ideas on how this could be implemented: