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

Commit 8205e5bd authored by Mady Mellor's avatar Mady Mellor Committed by android-build-merger
Browse files

Merge "Improve touch target for the gear beneath a notification" into nyc-dev

am: ed8f6cff

* commit 'ed8f6cff':
  Improve touch target for the gear beneath a notification
parents 7e17f73b ed8f6cff
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -17,20 +17,21 @@
<com.android.systemui.statusbar.NotificationSettingsIconRow
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    >

    <com.android.systemui.statusbar.AlphaOptimizedImageView
        android:id="@+id/gear_icon"
        android:layout_width="@dimen/notification_gear_size"
        android:layout_height="@dimen/notification_gear_size"
        android:layout_marginTop="@dimen/notification_gear_top_margin"
        android:layout_marginStart="@dimen/notification_gear_side_margin"
        android:layout_marginEnd="@dimen/notification_gear_side_margin"
        android:layout_width="@dimen/notification_gear_width"
        android:layout_height="@dimen/notification_gear_height"
        android:paddingTop="@dimen/notification_gear_top_padding"
        android:paddingStart="@dimen/notification_gear_padding"
        android:paddingEnd="@dimen/notification_gear_padding"
        android:paddingBottom="@dimen/notification_gear_padding"
        android:src="@drawable/ic_settings"
        android:tint="@color/notification_gear_color"
        android:visibility="gone"
        android:visibility="invisible"
        android:alpha="0"
        android:background="?android:attr/selectableItemBackgroundBorderless"
        />
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
        android:layout="@layout/notification_settings_icon_row"
        android:id="@+id/settings_icon_row_stub"
        android:inflatedId="@+id/notification_settings_icon_row"
        android:layout_width="match_parent"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        />

+8 −5
Original line number Diff line number Diff line
@@ -78,14 +78,17 @@
    <!-- Minimum layouted height of a notification in the statusbar-->
    <dimen name="min_notification_layout_height">48dp</dimen>

    <!-- Size of gear icon displayed behind a notification -->
    <dimen name="notification_gear_size">24dp</dimen>
    <!-- Width of the space containing the gear icon behind a notification -->
    <dimen name="notification_gear_width">64dp</dimen>

    <!-- Height of the space containing the gear icon behind a notification -->
    <dimen name="notification_gear_height">74dp</dimen>

    <!-- The space above the gear icon displayed behind a notification -->
    <dimen name="notification_gear_top_margin">30dp</dimen>
    <dimen name="notification_gear_top_padding">30dp</dimen>

    <!-- The space on either side of the gear icon displayed behind a notification  -->
    <dimen name="notification_gear_side_margin">20dp</dimen>
    <!-- The space on either side and below the gear icon displayed behind a notification  -->
    <dimen name="notification_gear_padding">20dp</dimen>

    <!-- size at which Notification icons will be drawn in the status bar -->
    <dimen name="status_bar_icon_drawing_size">17dip</dimen>
+7 −0
Original line number Diff line number Diff line
@@ -208,6 +208,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        return false;
    }

    protected boolean handleSlideBack() {
        return false;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        boolean result;
@@ -260,6 +264,9 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
                break;
            case MotionEvent.ACTION_UP:
                if (isWithinTouchSlop(event)) {
                    if (handleSlideBack()) {
                        return true;
                    }
                    if (!mActivated) {
                        makeActive();
                        postDelayed(mTapTimeoutRunnable, DOUBLETAP_TIMEOUT_MS);
+6 −0
Original line number Diff line number Diff line
@@ -1657,6 +1657,12 @@ public abstract class BaseStatusBar extends SystemUI implements
                return;
            }

            // Check if the notification is displaying the gear, if so slide notification back
            if (row.getSettingsRow() != null && row.getSettingsRow().isVisible()) {
                row.animateTranslateNotification(0);
                return;
            }

            Notification notification = sbn.getNotification();
            final PendingIntent intent = notification.contentIntent != null
                    ? notification.contentIntent
Loading