splendo / kaluga

Collection of multiplatform kotlin components, mainly using coroutines and flow
Apache License 2.0
276 stars 6 forks source link

Being able to load resources from `Composable`s previews #763

Open corrado4eyes opened 5 months ago

corrado4eyes commented 5 months ago

Describe the bug Kaluga loads resources on android thanks to the getIdentifier helper method which instead of taking an Int, it takes a string which is the name of the resource. Probably this was done because iOS takes by default a string as well, so for the sake of consistency that android API was being used.

This seems to be an issue when using Composable previews that are not able to load the resources.

To Reproduce Steps to reproduce the behavior:

  1. Create a Composable preview
  2. Something calls getIdentifier
  3. Preview won't load