Skip to content

Commit

Permalink
Merge drawables fetch
Browse files Browse the repository at this point in the history
The illustration drawable we pulled 2 times instead of one
  • Loading branch information
soulcramer committed Oct 16, 2024
1 parent 88b3752 commit 6b382a5
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ private fun ColumnScope.ImageSample() {
var height by remember { mutableStateOf<Int?>(1) }
var aspectRatio by remember { mutableStateOf(ImageAspectRatio.Custom) }
var imageShape by remember { mutableStateOf(ImageShape.Wavy) }
val painter =
rememberDrawablePainter(getDrawable(LocalContext.current, R.drawable.notifications))
val drawable = getDrawable(LocalContext.current, R.drawable.notifications)!!
val imageRequest =
ImageRequest.Builder(LocalContext.current).crossfade(true).data(state.ordinal).build()
val painter = rememberDrawablePainter(drawable)
val imageRequest = ImageRequest.Builder(LocalContext.current)
.crossfade(true)
.data(state.ordinal)
.build()

val transform by rememberUpdatedState { _: AsyncImagePainter.State ->
state.transformation(
Expand Down

0 comments on commit 6b382a5

Please sign in to comment.