mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
common: replace deprecated method
This commit is contained in:
parent
1363e73c34
commit
968759c7ea
1 changed files with 9 additions and 7 deletions
|
@ -3,8 +3,10 @@ package dev.msfjarvis.claw.common.ui
|
|||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import coil.annotation.ExperimentalCoilApi
|
||||
import coil.compose.rememberImagePainter
|
||||
import coil.compose.rememberAsyncImagePainter
|
||||
import coil.request.ImageRequest
|
||||
import coil.transform.CircleCropTransformation
|
||||
|
||||
@Composable
|
||||
|
@ -16,12 +18,12 @@ actual fun NetworkImage(
|
|||
) {
|
||||
Image(
|
||||
painter =
|
||||
rememberImagePainter(
|
||||
data = url,
|
||||
builder = {
|
||||
transformations(CircleCropTransformation())
|
||||
crossfade(true)
|
||||
},
|
||||
rememberAsyncImagePainter(
|
||||
ImageRequest.Builder(LocalContext.current)
|
||||
.data(data = url)
|
||||
.transformations(CircleCropTransformation())
|
||||
.crossfade(true)
|
||||
.build()
|
||||
),
|
||||
contentDescription = contentDescription,
|
||||
modifier = modifier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue