darkmoon_uk01/28/2021, 4:18 AM
-ing views that are dependent on bundled resources at runtime; so these fail during preview. Is there a way I can check whether I'm running in
mode in the composition, so that I can just put colored block instead of the asset?
flag for this.
darkmoon_uk01/28/2021, 12:15 PM
Mark Murphy01/28/2021, 1:54 PM
would use the default value. IOW, the rule of what to show is a function of the inputs, not a function of some "are we in preview" quasi-state.
jim01/28/2021, 5:39 PM
Reason for asking is that the IDE doesn't appear to be able to use raw Android file resources during Compose previews.I'm actually ok with Chris' answer: "resource issues". The current resource API leaves a lot to be desired, especially in terms of MPP (eg. Compose for Desktop), and I think it's reasonable for widgets to be able to have resources associated with the widget, and to the extent that is not supported, it should be treated as a bug and Chris is working around that bug. This won't make the 1.0 cut, but after 1.0, I think our team will need to do some serious thinking about how resources should be managed in Compose applications. Thanks for the feedback!