You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a drawable value in ImageView will always be written as:
Image(imageResource(R.id.the_drawable), ...)
This works for drawable resources that are PNGs. But it fails if the drawable is a vector image. In that case it needs to be:
Image(vectorResource(R.id.the_drawable), ...)
From the XML alone we cannot know if the drawable is a vector resource or not. We could try finding the drawable (assuming default folders are used), but this fails if the resource is not in the app itself (e.g. provided by a library or a different module).
Alternatively the plugin in the IDE could try to figure out what kind of drawable is used - but this will only work in the plugin and not in the CI.
In general I am surprised to see Jetpack Compose force making this distinction unto the consumer. Wouldn't it be more convenient to provide a drawable resource to Compose and it can figure out itself what it is?
The text was updated successfully, but these errors were encountered:
Currently a
drawable
value inImageView
will always be written as:This works for drawable resources that are PNGs. But it fails if the drawable is a vector image. In that case it needs to be:
From the XML alone we cannot know if the drawable is a vector resource or not. We could try finding the drawable (assuming default folders are used), but this fails if the resource is not in the app itself (e.g. provided by a library or a different module).
Alternatively the plugin in the IDE could try to figure out what kind of drawable is used - but this will only work in the plugin and not in the CI.
In general I am surprised to see Jetpack Compose force making this distinction unto the consumer. Wouldn't it be more convenient to provide a drawable resource to Compose and it can figure out itself what it is?
The text was updated successfully, but these errors were encountered: