Is it possible that `imageFromResource` does not work in `repo`?
l
Is it possible that
imageFromResource
does not work in
repo
?
I added a drawable but that always return
null
a
is it a bitmap or a vector? at the moment it only does bitmaps
l
the old fashioned 5 .png files ๐Ÿ˜„
Oh, actually, it also has a
xml
for
anyDp
Can this be the problem?
a
Could be
l
It was
a
I'm agitating for something
Drawable
-like in compose but without `Drawable`'s regrets
not there yet though ๐Ÿ™‚
l
Removing the
xml
files now wonโ€™t crash the app ๐Ÿ˜„
a
the current situation with vectors being handled at composition time makes things awkward
r
@Adam Powell Drawables without all the things that make them more like widgets would be fine
a
Yeah exactly
Model observation should give us nearly everything we need in terms of smarts where it's needed
l
๐Ÿค”
a
Invalidation for changes stays implicit, if something in a drawable is backed by
@Model
then that value changing will trigger redraw
๐Ÿ‘ 1
l
how is this related to getting a
null
value when thereโ€™s also a
xml
for
anyDp
?
a
Same with any kind of preferred size being read by the composable that lays out and draws it
Just that we can unify vectors and bitmaps so you don't have to see this distinction
One resource load that just works
l
Oh, I see, it was an internal discussion ๐Ÿ˜„
a
Yeah, just giving a view inside ๐Ÿ™‚
l
๐Ÿ‘€
r
imageResource
blindly tries to decode a bitmap which is why you get null
An XML is not a bitmap
l
Yeah I know that
My question was more: why is it retrieving the
xml
file alongside all the ones available
a
It was the variant of that drawable selected for your current configuration
Android resources treat the two as equivalent in terms of identity
And compose isn't currently set up to play as nicely with that as it needs to be