Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58a8add6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Force reset of AnimatedVectorPainter by wrapping in a key" into main

parents 97dd4394 b7f56315
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
@@ -176,6 +177,7 @@ fun SmallTileContent(
    } else if (icon is Icon.Resource) {
        val image = AnimatedImageVector.animatedVectorResource(id = icon.res)
        val painter =
            key(icon) {
                if (animateToEnd) {
                    rememberAnimatedVectorPainter(animatedImageVector = image, atEnd = true)
                } else {
@@ -186,6 +188,7 @@ fun SmallTileContent(
                    }
                    rememberAnimatedVectorPainter(animatedImageVector = image, atEnd = atEnd)
                }
            }
        Image(
            painter = painter,
            contentDescription = icon.contentDescription?.load(),