Blank image when music uri doesnt contain an image #1384
Unanswered
lukatsivilashvili
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Placeholder refers to what will show when the image is in the process of loading. If the image is not available, you would want to use |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I dont know what im doing wrong, so maybe you could help me. im building a simple music player in compose that reads music from mediastore and sets artwork from uri. Everything works fine except for placeholder in a specific scenario.
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(uri)
.placeholder(R.drawable.ic_default_artwork)
.crossfade(true)
.build(),
placeholder = painterResource(R.drawable.ic_default_artwork),
contentDescription = "Music Art",
contentScale = ContentScale.Fit,
)
So heres the problem: If the mediaItem has the artwork uri but doesnt contain an image e.g music doesnt have an album art, theres nothing displayed. its as if a transparent png was placed there.
Any ideas? it is my first time with coil let alone on compose, any help would be appreciated. as a side note, i have another similar app written with xmls and glide, and the placeholder works properly.
Beta Was this translation helpful? Give feedback.
All reactions