buszi0809
11/21/2024, 9:21 AMPhuc
11/21/2024, 9:43 AMPhuc
11/21/2024, 9:45 AMbuszi0809
11/21/2024, 9:47 AMRes.readBytes
and then decode those bytes into anything Android related (Bitmap, VectorDrawable etc.) and it doesn't work
tried using the method to find identifier and it also doesn't find it
resources.getIdentifier(
"compose_multiplatform",
"drawable",
packageName,
)
I try to post a Notification on the Android side, and I need to pass either Android resource ID or some wrapped bitmap, and I just can't find a way to access the multiplatform resource in "Android way"buszi0809
11/21/2024, 9:49 AMRes.getUri
and then decode it somehow into a Bitmap, but it just seems to not be compatible with Android drawablesbuszi0809
11/21/2024, 9:54 AMRes.readBytes
actually returns some bytes, but I can't find a way to make it work with Android-specific stuffbuszi0809
11/21/2024, 10:43 AMval parser = assets.openXmlResourceParser(
"assets/composeResources/*app name*.composeapp.generated.resources/drawable/compose-multiplatform.xml"
)
val drawable = VectorDrawableCompat.createFromXml(resources, parser)
val bitmap = drawable.toBitmap()
val icon = IconCompat.createWithBitmap(bitmap)
but I'm getting java.io.FileNotFoundException: Corrupt XML binary file
, so yeah, still no idea what to do sad panda