feat: configurable crossfade for RemoteImage
This commit is contained in:
parent
4a5365c3c1
commit
c7e5795ca9
|
|
@ -22,12 +22,13 @@ fun RemoteImage(
|
||||||
contentScale: ContentScale = ContentScale.Crop,
|
contentScale: ContentScale = ContentScale.Crop,
|
||||||
width: Int = 0,
|
width: Int = 0,
|
||||||
height: Int = 0,
|
height: Int = 0,
|
||||||
|
crossfade: Boolean = true,
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
fun imageRequest() = run {
|
fun imageRequest() = run {
|
||||||
val builder = ImageRequest.Builder(context)
|
val builder = ImageRequest.Builder(context)
|
||||||
.crossfade(true)
|
.crossfade(crossfade)
|
||||||
.data(url)
|
.data(url)
|
||||||
|
|
||||||
if (width != 0 && height != 0) {
|
if (width != 0 && height != 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue