I am changing a PNG image with a transparent background to HEIC format. I want to display the modified image using Android Studio's ImageView. To use the HEIC file I used an asset folder and an ImageDecoder.
However, the transparent background of the HEIC turned black. I converted png to heic on various sites and exported it using mac preview app, but I couldn't stop the background from turning black. I would appreciate it if you solved.
here's my code:
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="287dp"
android:layout_height="557.5dp"
android:layout_marginStart="1.8dp"
android:background="@android:color/transparent"
android:id="@+id/main_character"
android:layout_alignParentBottom="true"/>
val drawable1 = ImageDecoder.decodeDrawable(ImageDecoder.createSource(contextRepo.getValue("main").assets,"anna_character.heic"))
main_character.background = drawable1