Is there any plan to allow `@Preview` and `Preview...
# compose
s
Is there any plan to allow
@Preview
and
PreviewParameterProvider
classes to be private? Right now I have for example a class which has one public composable meant to be used by other files and a bunch of private ones, but then what I really expose to the other files is this [picture attached]. Now this is polluting the auto-completion menu in a way that is very bad, as I absolutely never want to call those from other files, or call them in general to be exact.
c
I might misread this entirely, but I keep my previews in the same file as the composable function declaration, no problems keeping them private. Having them private in separate files is not related to compose but more a kotlin compiler problem? I suppose a some kind of compiler plugin or annotation that would exclude certain code from being auto-completed, just a toy idea
✔️ 1
j
In my experience
@Preview
can be private, but not
PreviewParameterProvider
. And there are no helpful errors about that either, the previews just disappear
s
Ok this is embarrassing then, I am now figuring out that previews are totally fine to be private, only PreviewParameterProvider classes need to be public. I had encountered this problem once and ever since I’ve always thought that both of them need to be public 🤦‍♂️
f
You can always have them internal the class param preview and the preview function private
s
Internal is an improvement yeah, nice catch! It’s still somewhat annoying but it is what it is