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

Commit 370a2ce7 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fix snooze/bubble button padding

* Reduce the conversation expander width to 48dp.
  This matches the expander width for normal notifications.
* Remove end padding for snooze or bubble buttons.
* Use layout to ensure 12dp end padding for actions iff
  neither of the buttons is present.

Bug: 163626038
Test: manual
Change-Id: Ic780f98ad74a2e148db2716aca52abe5137fa4a1
parent 4d19b03f
Loading
Loading
Loading
Loading
+28 −17
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
        android:layout_height="wrap_content"
        android:gravity="end"
        android:orientation="horizontal"
        android:paddingEnd="@dimen/bubble_gone_padding_end"
        android:background="@color/notification_action_list_background_color"
        >

@@ -45,6 +44,17 @@
            <!-- actions will be added here -->
        </com.android.internal.widget.NotificationActionListLayout>

        <!--
        This nested linear layout exists to ensure that if the neither of the contained
        actions is visible we have some minimum padding at the end of the actions is present,
        then there will be 12dp of padding at the end of the actions list.
        -->
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            android:minWidth="@dimen/snooze_and_bubble_gone_padding_end"
            >
            <ImageView
                android:id="@+id/snooze_button"
                android:layout_width="@dimen/notification_actions_icon_size"
@@ -63,4 +73,5 @@
                android:scaleType="centerInside"
                />
        </LinearLayout>
    </LinearLayout>
</FrameLayout>
+2 −2
Original line number Diff line number Diff line
@@ -327,10 +327,10 @@
            android:id="@+id/expand_button_touch_container"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/conversation_expand_button_size"
            android:paddingStart="16dp"
            android:paddingStart="@dimen/conversation_expand_button_side_margin"
            android:orientation="horizontal"
            android:layout_gravity="end|top"
            android:paddingEnd="@dimen/notification_content_margin_end"
            android:paddingEnd="@dimen/conversation_expand_button_side_margin"
            android:clipToPadding="false"
            android:clipChildren="false"
            >
+5 −5
Original line number Diff line number Diff line
@@ -340,11 +340,8 @@
    <!-- The margin of the content to an image-->
    <dimen name="notification_content_image_margin_end">8dp</dimen>

    <!-- The padding at the end of actions when the bubble button is visible-->
    <dimen name="bubble_visible_padding_end">3dp</dimen>

    <!-- The padding at the end of actions when the bubble button is gone-->
    <dimen name="bubble_gone_padding_end">12dp</dimen>
    <!-- The padding at the end of actions when the snooze and bubble buttons are gone-->
    <dimen name="snooze_and_bubble_gone_padding_end">12dp</dimen>

    <!-- The spacing between messages in Notification.MessagingStyle -->
    <dimen name="notification_messaging_spacing">6dp</dimen>
@@ -744,6 +741,9 @@
    <dimen name="conversation_expand_button_size">80dp</dimen>
    <!-- Top margin of the expand button for conversations when expanded -->
    <dimen name="conversation_expand_button_top_margin_expanded">18dp</dimen>
    <!-- Side margin of the expand button for conversations.
         width of expand asset (22) + 2 * this (13) == notification_header_expand_icon_size (48) -->
    <dimen name="conversation_expand_button_side_margin">13dp</dimen>
    <!-- Side margins of the conversation badge in relation to the conversation icon -->
    <dimen name="conversation_badge_side_margin">36dp</dimen>
    <!-- size of the notification badge when applied to the conversation icon -->
+0 −2
Original line number Diff line number Diff line
@@ -3560,8 +3560,6 @@
  <java-symbol type="id" name="clip_children_tag" />
  <java-symbol type="id" name="bubble_button" />
  <java-symbol type="id" name="snooze_button" />
  <java-symbol type="dimen" name="bubble_visible_padding_end" />
  <java-symbol type="dimen" name="bubble_gone_padding_end" />
  <java-symbol type="dimen" name="text_size_body_2_material" />
  <java-symbol type="dimen" name="messaging_avatar_size" />
  <java-symbol type="dimen" name="messaging_group_sending_progress_size" />
+0 −8
Original line number Diff line number Diff line
@@ -1369,16 +1369,8 @@ public class NotificationContentView extends FrameLayout {
            bubbleButton.setOnClickListener(mContainingNotification.getBubbleClickListener());
            bubbleButton.setVisibility(VISIBLE);
            actionContainer.setVisibility(VISIBLE);

            int paddingEnd = getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.bubble_visible_padding_end);
            actionContainerLayout.setPaddingRelative(0, 0, paddingEnd, 0);
        } else  {
            bubbleButton.setVisibility(GONE);

            int paddingEnd = getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.bubble_gone_padding_end);
            actionContainerLayout.setPaddingRelative(0, 0, paddingEnd, 0);
        }
    }