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

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

Merge "Partially revert ag/31525412" into main

parents 079754df cd38fe7c
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -19,10 +19,12 @@ package com.android.systemui.common.ui.compose
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.res.painterResource
import com.android.compose.ui.graphics.painter.rememberDrawablePainter
import androidx.core.graphics.drawable.toBitmap
import com.android.systemui.common.shared.model.Icon

/**
@@ -35,7 +37,12 @@ fun Icon(icon: Icon, modifier: Modifier = Modifier, tint: Color = LocalContentCo
    val contentDescription = icon.contentDescription?.load()
    when (icon) {
        is Icon.Loaded -> {
            Icon(rememberDrawablePainter(icon.drawable), contentDescription, modifier, tint)
            Icon(
                remember(icon.drawable) { icon.drawable.toBitmap().asImageBitmap() },
                contentDescription,
                modifier,
                tint,
            )
        }
        is Icon.Resource -> Icon(painterResource(icon.res), contentDescription, modifier, tint)
    }