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

Commit b7f56315 authored by Olivier St-Onge's avatar Olivier St-Onge
Browse files

Force reset of AnimatedVectorPainter by wrapping in a key

Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Fixes: 335458915
Test: manually
Change-Id: If29151f0bd4cf85a3bd9a7d1f58f99ab5aa13c25
parent 50e83ba8
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
@@ -174,6 +175,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 {
@@ -184,6 +186,7 @@ fun SmallTileContent(
                    }
                    rememberAnimatedVectorPainter(animatedImageVector = image, atEnd = atEnd)
                }
            }
        Image(
            painter = painter,
            contentDescription = icon.contentDescription?.load(),