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

Commit 4e27917b authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Android (Google) Code Review
Browse files

Merge "[SB][Chips] Add a decorative icon for RON chips" into main

parents aab3e486 19164c08
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.util.Log
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
@@ -199,6 +200,17 @@ private fun ChipBody(
                modifier = Modifier.sysuiResTag(STATUS_BAR_CHIP_CONTENT_ID),
            )
        }

        model.decorativeIcon?.let {
            Icon(
                icon = it.icon,
                modifier =
                    modifier
                        .background(color = it.backgroundColor, shape = it.backgroundShape)
                        .padding(vertical = 2.dp, horizontal = 8.dp)
                        .size(12.dp),
            )
        }
    }
}

+11 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import android.annotation.StringRes
import android.os.SystemClock
import android.view.View
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import com.android.internal.logging.InstanceId
import com.android.systemui.animation.ComposableControllerFactory
import com.android.systemui.animation.Expandable
@@ -89,7 +91,8 @@ sealed class OngoingActivityChipModel {
        val isHidden: Boolean = false,
        /** Whether the transition from hidden to shown should be animated. */
        val shouldAnimate: Boolean = true,

        /** A decorative icon to show on the end side of the chip. */
        val decorativeIcon: DecorativeIcon? = null,
        /**
         * An optional per-chip ID used for logging. Should stay the same throughout the lifetime of
         * a single chip.
@@ -283,4 +286,11 @@ sealed class OngoingActivityChipModel {
         */
        val hideChipForTransition: Boolean = false,
    )

    /** Represents a decorative icon to show on the right side of the chip. */
    data class DecorativeIcon(
        val icon: Icon,
        val backgroundColor: Color,
        val backgroundShape: Shape,
    )
}