Код: Выделить всё
val painter1 = rememberAsyncImagePainter(
model = targetUrl,
onSuccess = {
Log.i("MYTAG", "BasicContentCard: Success!")
}
)
Log.i("MYTAG", "BasicContentCard: ${painter1.state}")
Image(
painter = painter1,
contentDescription = null,
modifier = Modifier.fillMaxSize()
)
Проблема возникает, когда я пытаюсь поместить тот же код в какое-то условие (чтобы я мог показывать заполнители, которые можно компоновать, пока изображение не будет полностью загружено):
Код: Выделить всё
if (painter1.state is AsyncImagePainter.State.Success){
Image(
painter = painter1,
contentDescription = null,
modifier = Modifier.fillMaxSize()
)
} else {
PlaceHolderComposable()
}
Код: Выделить всё
MYTAG com.rahul.samplelauncher BasicContentCard: Loading(painter=null)
Подробнее здесь: https://stackoverflow.com/questions/786 ... ck-compose
Мобильная версия