Is your composable attempting to use your
EmojiDrawable
directly?
If so, could you change it such that it receives the drawable (or supplier of drawables) as a parameter? Then, if you set up a default value of the parameter that does not use
EmojiDrawable
itself, the preview should be isolated from
EmojiDrawable
and should not need
EmojiCompat
.
Or, as Adam suggests, perhaps your supplier of drawables could be provided by a
CompositionLocal
, with a default implementation that does not depend upon
EmojiCompat
. The preview would use that default implementation, and higher-level composables would provide the
EmojiDrawable
-based implementation.
On the whole, the advice seems to be: if you are encountering preview problems because of platform considerations, your composable is insufficiently isolated from the platform.