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

Commit a9d1a4ce authored by andrewxu's avatar andrewxu
Browse files

Polish notification dismiss button

This CL polishes the notification dismiss button that shows behind
the flag. In detail:

1. The notification dismiss button is located on the top-end corner.
2. The button shows when the host notification is under hover;
  otherwise, the button is gone.
3. When the notification dismiss button shows, the notification
  background shows a cutout.

Bug:b/365585705
Flag:com.android.systemui.notification_add_x_on_hover_to_dismiss
Change-Id: I82e96c7e12d07929242e0c0033e8562cb58fbfd9
parent 4b817c8f
Loading
Loading
Loading
Loading
+11 −22
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->
<!-- extends FrameLayout -->
<!-- extends RelativeLayout -->
<NotificationHeaderView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/notification_header"
@@ -62,7 +62,7 @@
        android:layout_height="match_parent"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true"
        android:layout_toStartOf="@id/notification_buttons_column"
        android:layout_toStartOf="@id/expand_button"
        android:layout_alignWithParentIfMissing="true"
        android:clipChildren="false"
        android:gravity="center_vertical"
@@ -83,28 +83,17 @@
        android:focusable="false"
        />

    <LinearLayout
        android:id="@+id/notification_buttons_column"
    <include layout="@layout/notification_expand_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:orientation="vertical"
        >
        android:layout_centerVertical="true"
        android:layout_alignParentEnd="true" />

    <include layout="@layout/notification_close_button"
        android:id="@+id/close_button"
        android:layout_width="@dimen/notification_close_button_size"
        android:layout_height="@dimen/notification_close_button_size"
            android:layout_gravity="end"
            android:layout_marginEnd="20dp"
            />

        <include layout="@layout/notification_expand_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            />

    </LinearLayout>
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true" />

</NotificationHeaderView>
+14 −26
Original line number Diff line number Diff line
@@ -157,26 +157,10 @@
            android:maxDrawableHeight="@dimen/notification_right_icon_size"
            />

        <LinearLayout
            android:id="@+id/notification_buttons_column"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:orientation="vertical"
            >

            <include layout="@layout/notification_close_button"
                android:layout_width="@dimen/notification_close_button_size"
                android:layout_height="@dimen/notification_close_button_size"
                android:layout_gravity="end"
                android:layout_marginEnd="20dp"
                />

        <FrameLayout
            android:id="@+id/expand_button_touch_container"
            android:layout_width="wrap_content"
                android:layout_height="0dp"
                android:layout_weight="1"
            android:layout_height="match_parent"
            android:minWidth="@dimen/notification_content_margin_end"
            >

@@ -190,6 +174,10 @@

    </LinearLayout>

    </LinearLayout>
    <include layout="@layout/notification_close_button"
        android:id="@+id/close_button"
        android:layout_width="@dimen/notification_close_button_size"
        android:layout_height="@dimen/notification_close_button_size"
        android:layout_gravity="top|end" />

</FrameLayout>
+8 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
  ~ limitations under the License
  -->

<!-- extends FrameLayout -->
<com.android.internal.widget.MediaNotificationView
    android:id="@+id/status_bar_latest_event_content"
    xmlns:android="http://schemas.android.com/apk/res/android"
@@ -191,4 +192,11 @@
        </FrameLayout>

    </LinearLayout>

    <include layout="@layout/notification_close_button"
        android:id="@+id/close_button"
        android:layout_width="@dimen/notification_close_button_size"
        android:layout_height="@dimen/notification_close_button_size"
        android:layout_gravity="top|end" />

</com.android.internal.widget.MediaNotificationView>
+6 −0
Original line number Diff line number Diff line
@@ -195,6 +195,12 @@

            </LinearLayout>

            <include layout="@layout/notification_close_button"
                android:id="@+id/close_button"
                android:layout_width="@dimen/notification_close_button_size"
                android:layout_height="@dimen/notification_close_button_size"
                android:layout_gravity="top|end" />

        </com.android.internal.widget.NotificationMaxHeightFrameLayout>

    <LinearLayout
+0 −1
Original line number Diff line number Diff line
@@ -5102,7 +5102,6 @@
  <java-symbol type="layout" name="notification_expand_button"/>
  <java-symbol type="id" name="close_button" />
  <java-symbol type="layout" name="notification_close_button"/>
  <java-symbol type="id" name="notification_buttons_column" />

  <java-symbol type="bool" name="config_supportsMicToggle" />
  <java-symbol type="bool" name="config_supportsCamToggle" />
Loading