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

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

Merge "[SB][Notif] Add a bit of extra side padding to the chips." into main

parents 42fe5597 7e667e21
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1806,7 +1806,8 @@
    <!-- The activity chip side padding, used with the default phone icon. -->
    <dimen name="ongoing_activity_chip_side_padding">12dp</dimen>
    <!-- The activity chip side padding, used with an icon that has embedded padding (e.g. if the icon comes from the notification's smallIcon field). If the icon has padding, the chip itself can have less padding. -->
    <dimen name="ongoing_activity_chip_side_padding_for_embedded_padding_icon">6dp</dimen>
    <dimen name="ongoing_activity_chip_side_padding_for_embedded_padding_icon">2dp</dimen>
    <dimen name="ongoing_activity_chip_side_padding_for_embedded_padding_icon_legacy">6dp</dimen>
    <!-- The icon size, used with the default phone icon. -->
    <dimen name="ongoing_activity_chip_icon_size">16dp</dimen>
    <!-- The icon size, used with an icon that has embedded padding. (If the icon has embedded padding, we need to make the whole icon larger so the icon itself doesn't look small.) -->
+4 −2
Original line number Diff line number Diff line
@@ -408,11 +408,13 @@ object OngoingActivityChipBinder {
    private fun View.setBackgroundPaddingForEmbeddedPaddingIcon() {
        val sidePadding =
            if (StatusBarNotifChips.isEnabled) {
                0
            } else {
                context.resources.getDimensionPixelSize(
                    R.dimen.ongoing_activity_chip_side_padding_for_embedded_padding_icon
                )
            } else {
                context.resources.getDimensionPixelSize(
                    R.dimen.ongoing_activity_chip_side_padding_for_embedded_padding_icon_legacy
                )
            }
        setPaddingRelative(sidePadding, paddingTop, sidePadding, paddingBottom)
    }
+4 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import com.android.compose.animation.Expandable
import com.android.compose.modifiers.thenIf
@@ -160,7 +159,10 @@ private fun ChipBody(
                    .padding(
                        horizontal =
                            if (hasEmbeddedIcon) {
                                0.dp
                                dimensionResource(
                                    R.dimen
                                        .ongoing_activity_chip_side_padding_for_embedded_padding_icon
                                )
                            } else {
                                dimensionResource(id = R.dimen.ongoing_activity_chip_side_padding)
                            }
+8 −4
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.key
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.res.dimensionResource
import com.android.systemui.res.R
import com.android.systemui.statusbar.chips.ui.model.MultipleOngoingActivityChipsModel
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder

@@ -35,10 +36,13 @@ fun OngoingActivityChips(
    modifier: Modifier = Modifier,
) {
    Row(
        // TODO(b/372657935): Remove magic numbers for padding and spacing.
        modifier = modifier.fillMaxHeight().padding(horizontal = 6.dp),
        modifier =
            modifier
                .fillMaxHeight()
                .padding(start = dimensionResource(R.dimen.ongoing_activity_chip_margin_start)),
        verticalAlignment = Alignment.CenterVertically,
        horizontalArrangement = Arrangement.spacedBy(8.dp),
        horizontalArrangement =
            Arrangement.spacedBy(dimensionResource(R.dimen.ongoing_activity_chip_margin_start)),
    ) {
        chips.active
            .filter { !it.isHidden }