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

Commit 82ad059b authored by Gus Prevas's avatar Gus Prevas
Browse files

Updates NotificationInfo layout/buttons.

This change modifies the UI displayed when the new interruption model is
enabled after long pressing a notification or tapping the settings icon
in the notification side menu.  The text links for blocking the channel,
toggling its importance, or canceling out of the dialog are replaced
with buttons with icons and clearer text descriptions.

Test: atest NotificationInfoTest
Bug: 116622974
Change-Id: I06ead5c4da77319df3ebe4c48d863dede37bf2f4
parent 188e9140
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -20,6 +20,6 @@ Copyright (C) 2016 The Android Open Source Project
        android:viewportHeight="24.0">
        android:viewportHeight="24.0">


    <path
    <path
        android:fillColor="#FFFFFFFF"
        android:fillColor="#FF000000"
        android:pathData="M12.0,2.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zM4.0,12.0c0.0,-4.42 3.58,-8.0 8.0,-8.0 1.85,0.0 3.5,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4.0,13.85 4.0,12.0zm8.0,8.0c-1.85,0.0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20.0,10.15 20.0,12.0c0.0,4.42 -3.58,8.0 -8.0,8.0z"/>
        android:pathData="M12.0,2.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zM4.0,12.0c0.0,-4.42 3.58,-8.0 8.0,-8.0 1.85,0.0 3.5,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4.0,13.85 4.0,12.0zm8.0,8.0c-1.85,0.0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20.0,10.15 20.0,12.0c0.0,4.42 -3.58,8.0 -8.0,8.0z"/>
</vector>
</vector>
+39 −7
Original line number Original line Diff line number Diff line
@@ -144,6 +144,7 @@


        <!-- Settings and Done buttons -->
        <!-- Settings and Done buttons -->
        <LinearLayout
        <LinearLayout
            android:id="@+id/block_or_minimize"
            android:layout_width="match_parent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/notification_guts_button_spacing"
            android:layout_marginTop="@dimen/notification_guts_button_spacing"
@@ -178,19 +179,50 @@
                android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
                android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
                style="@style/TextAppearance.NotificationInfo.Button" />
                style="@style/TextAppearance.NotificationInfo.Button" />
            <TextView
            <TextView
                android:id="@+id/toggle_silent"
                android:id="@+id/keep"
                android:text="@string/inline_silent_button_silent"
                android:minWidth="48dp"
                android:text="@string/inline_keep_button"
                android:layout_width="wrap_content"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_height="match_parent"
                android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
                android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
                style="@style/TextAppearance.NotificationInfo.Button"/>
                style="@style/TextAppearance.NotificationInfo.Button"/>
        </LinearLayout>
        <LinearLayout
            android:id="@+id/interruptiveness_settings"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/notification_guts_button_spacing"
            android:layout_marginStart="@dimen/notification_guts_button_side_margin"
            android:layout_marginEnd="@dimen/notification_guts_button_side_margin"
            android:gravity="center"
            android:orientation="horizontal"
            android:visibility="gone">
            <TextView
            <TextView
                android:id="@+id/keep"
                android:id="@+id/int_block"
                android:minWidth="48dp"
                android:text="@string/inline_block_button"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:drawableTop="@drawable/ic_notification_block"
                android:drawableTint="?android:attr/colorAccent"
                android:layout_weight="1"
                style="@style/TextAppearance.NotificationInfo.Button"/>
            <TextView
                android:id="@+id/int_silent"
                android:text="@string/inline_minimize_button"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:drawableTop="@drawable/ic_notifications_silence"
                android:drawableTint="?android:attr/colorAccent"
                android:layout_weight="1"
                style="@style/TextAppearance.NotificationInfo.Button"/>
            <TextView
                android:id="@+id/int_alert"
                android:text="@string/inline_keep_button"
                android:text="@string/inline_keep_button"
                android:layout_width="wrap_content"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_height="match_parent"
                android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
                android:drawableTop="@drawable/ic_notifications_alert"
                android:drawableTint="?android:attr/colorAccent"
                android:layout_weight="1"
                style="@style/TextAppearance.NotificationInfo.Button"/>
                style="@style/TextAppearance.NotificationInfo.Button"/>
        </LinearLayout>
        </LinearLayout>
    </LinearLayout>
    </LinearLayout>
+12 −3
Original line number Original line Diff line number Diff line
@@ -1556,17 +1556,26 @@
    <!-- Notification inline controls: block notifications button -->
    <!-- Notification inline controls: block notifications button -->
    <string name="inline_stop_button">Stop notifications</string>
    <string name="inline_stop_button">Stop notifications</string>


    <!-- Notification inline controls: button to block notifications from this channel [CHAR_LIMIT=35] -->
    <string name="inline_block_button">Block</string>

    <!-- Notification inline controls: keep getting notifications button -->
    <!-- Notification inline controls: keep getting notifications button -->
    <string name="inline_keep_button">Keep showing</string>
    <string name="inline_keep_button">Keep showing</string>


    <!-- Notification inline controls: minimize notifications button -->
    <!-- Notification inline controls: minimize notifications button -->
    <string name="inline_minimize_button">Minimize</string>
    <string name="inline_minimize_button">Minimize</string>


    <!-- Notification inline controls: show notifications silently button [CHAR_LIMIT=25] -->
    <!-- Notification inline controls: button to show notifications silently, without alerting the user [CHAR_LIMIT=35] -->
    <string name="inline_silent_button_silent">Show silently</string>
    <string name="inline_silent_button_silent">Show silently</string>


    <!-- Notification inline controls: show and alert button [CHAR_LIMIT=25] -->
    <!-- Notification inline controls: button to continue showing notifications silently [CHAR_LIMIT=35] -->
    <string name="inline_silent_button_alert">Show and alert</string>
    <string name="inline_silent_button_stay_silent">Stay silent</string>

    <!-- Notification inline controls: button to make notifications alert the user [CHAR_LIMIT=35] -->
    <string name="inline_silent_button_alert">Alert me</string>

    <!-- Notification inline controls: button to continue alerting the user when notifications arrive [CHAR_LIMIT=35] -->
    <string name="inline_silent_button_keep_alerting">Keep alerting</string>


    <!-- Notification Inline controls: continue receiving notifications prompt, app level -->
    <!-- Notification Inline controls: continue receiving notifications prompt, app level -->
    <string name="inline_keep_showing_app">Keep showing notifications from this app?</string>
    <string name="inline_keep_showing_app">Keep showing notifications from this app?</string>
+0 −2
Original line number Original line Diff line number Diff line
@@ -66,7 +66,6 @@ import com.android.systemui.statusbar.StatusBarIconView;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.NotificationGuts;
import com.android.systemui.statusbar.notification.row.NotificationGuts;
import com.android.systemui.statusbar.notification.row.NotificationInflater.InflationFlag;
import com.android.systemui.statusbar.notification.row.NotificationInflater.InflationFlag;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.StatusBar;
@@ -174,7 +173,6 @@ public class NotificationData {
        public void populateFromRanking(@NonNull Ranking ranking) {
        public void populateFromRanking(@NonNull Ranking ranking) {
            channel = ranking.getChannel();
            channel = ranking.getChannel();
            audiblyAlerted = ranking.audiblyAlerted();
            audiblyAlerted = ranking.audiblyAlerted();
            noisy = ranking.isNoisy();
            importance = ranking.getImportance();
            importance = ranking.getImportance();
            snoozeCriteria = ranking.getSnoozeCriteria();
            snoozeCriteria = ranking.getSnoozeCriteria();
            userSentiment = ranking.getUserSentiment();
            userSentiment = ranking.getUserSentiment();
+0 −1
Original line number Original line Diff line number Diff line
@@ -290,7 +290,6 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
                row.getIsNonblockable(),
                row.getIsNonblockable(),
                isForBlockingHelper,
                isForBlockingHelper,
                row.getEntry().userSentiment == USER_SENTIMENT_NEGATIVE,
                row.getEntry().userSentiment == USER_SENTIMENT_NEGATIVE,
                row.getEntry().noisy,
                row.getEntry().importance);
                row.getEntry().importance);


    }
    }
Loading