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

Commit fe17c165 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Make the bundle expander & the normal expander consistent

This means:
- Use the correct font for the the non-compose expander
- Adjust spacing when showing the number in the compose expander

Bug: 433292921
Test: manual, compare the two expanders side by side
Flag: android.app.notifications_redesign_templates
Flag: com.android.systemui.notification_bundle_ui

Change-Id: I8b47ec66c72b47eefc778a3a004e733759fdd79f
parent 0caaced7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@
            android:id="@+id/expand_button_number"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Info"
            android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Label"
            android:gravity="center_vertical"
            android:visibility="gone"
            />
+5 −0
Original line number Diff line number Diff line
@@ -305,6 +305,11 @@ easier.
        <item name="fontFamily" android:featureFlag="android.app.notifications_redesign_fonts">variable-body-small</item>
        <item name="fontFamily" android:featureFlag="!android.app.notifications_redesign_fonts">@string/config_bodyFontFamily</item>
    </style>
    <style name="TextAppearance.DeviceDefault.Notification.Label">
        <item name="fontFamily">variable-label-small-emphasized</item>
        <item name="textSize">11sp</item>
        <item name="lineHeight">16sp</item>
    </style>
    <style name="TextAppearance.DeviceDefault.Notification.Time" parent="TextAppearance.Material.Notification.Time">
        <item name="fontFamily" android:featureFlag="android.app.notifications_redesign_fonts">variable-body-small</item>
        <item name="fontFamily" android:featureFlag="!android.app.notifications_redesign_fonts">@string/config_bodyFontFamily</item>
+9 −3
Original line number Diff line number Diff line
@@ -88,22 +88,28 @@ fun ContentScope.ExpansionControl(
    modifier: Modifier = Modifier,
) {
    val textColor = MaterialTheme.colorScheme.onSurface
    val shouldShowNumber = numberToShow != null
    Box(modifier = modifier) {
        // The background is a shared Element and therefore can't be the parent of a different
        // shared Element (the chevron), otherwise the child can't be animated.
        PillBackground(modifier = Modifier.matchParentSize())
        Row(
            verticalAlignment = Alignment.CenterVertically,
            modifier = Modifier.padding(vertical = 2.dp, horizontal = 6.dp),
            modifier =
                Modifier.padding(
                    top = 2.dp,
                    bottom = 2.dp,
                    start = 6.dp,
                    end = if (shouldShowNumber) 4.dp else 6.dp,
                ),
        ) {
            val iconSizeDp = with(LocalDensity.current) { 16.sp.toDp() }

            if (numberToShow != null) {
            if (shouldShowNumber) {
                Text(
                    text = numberToShow.toString(),
                    style = MaterialTheme.typography.labelSmallEmphasized,
                    color = textColor,
                    modifier = Modifier.padding(end = 2.dp),
                )
            }
            Chevron(collapsed = collapsed, modifier = Modifier.size(iconSizeDp), color = textColor)