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

Commit 04d7a0fc authored by Mady Mellor's avatar Mady Mellor
Browse files

Add snooze to notification menu row

Moves the snooze plugin code into system UI.
Does not include assistant suggestions.

Test: manual
Change-Id: Ie2c51d65381530c9a72cd8a871efdbf0d63da490
parent 3e655203
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"
        android:fillColor="#757575"/>
    <path
        android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"
        android:fillColor="#757575"/>
</vector>
+65 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2017, The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<com.android.systemui.statusbar.NotificationSnooze
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="@dimen/snooze_snackbar_min_height"
    android:id="@+id/notification_snooze"
    android:clickable="true"
    android:gravity="center_vertical"
    android:orientation="horizontal"
    android:paddingStart="24dp"
    android:paddingEnd="24dp"
    android:background="@color/snooze_snackbar_bg">
    
    <TextView
        android:id="@+id/snooze_option_default"
        style="@style/TextAppearance.SnoozeSnackBar"
        android:layout_width="wrap_content"
       	android:layout_height="match_parent"
       	android:gravity="center_vertical"
      	android:drawableTint="@android:color/white"
       	android:drawableEnd="@drawable/notification_expand_more"/>
    
    <android.widget.Space
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_weight="1"
        />
    
    <TextView
        android:id="@+id/undo"
        style="@style/TextAppearance.SnoozeSnackBar.Button"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:background="@drawable/btn_borderless_rect"
        android:layout_gravity="end"
        android:text="@string/snooze_undo" />
    
    <LinearLayout
        android:id="@+id/snooze_options"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        android:orientation="vertical"/>
    
</com.android.systemui.statusbar.NotificationSnooze>
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@
    <color name="notification_guts_icon_tint">#8a000000</color>
    <color name="notification_guts_disabled_icon_tint">#4d000000</color>

    <!-- Colors of the snooze menu reached via snooze icon behind a notification -->
    <color name="snooze_snackbar_bg">#FF4A4A4A</color>
	<color name="snooze_snackbar_text">#FFA6BAFF</color>

    <color name="assist_orb_color">#ffffff</color>

    <color name="keyguard_user_switcher_background_gradient_color">#77000000</color>
+9 −0
Original line number Diff line number Diff line
@@ -112,6 +112,15 @@
    <!-- The space around a notification menu item  -->
    <dimen name="notification_menu_icon_padding">20dp</dimen>

    <!-- The minimum height for the snackbar shown after the snooze option has been chosen. -->
    <dimen name="snooze_snackbar_min_height">48dp</dimen>

    <!-- The text size of options in the snooze menu. -->
    <dimen name="snooze_option_text_size">14sp</dimen>

    <!-- The padding around options int the snooze menu. -->
    <dimen name="snooze_option_padding">8dp</dimen>

    <!-- size at which Notification icons will be drawn in the status bar -->
    <dimen name="status_bar_icon_drawing_size">17dp</dimen>

+15 −0
Original line number Diff line number Diff line
@@ -1381,6 +1381,21 @@
    <!-- Notification: Menu row: Content description for the gear menu item. [CHAR LIMIT=NONE] -->
    <string name="notification_menu_gear_description">notification controls</string>

    <!-- Notification: Menu row: Content description for the snooze icon. [CHAR LIMIT=NONE] -->
    <string name="notification_menu_snooze_description">notification snooze options</string>

    <!-- Notification: Menu row: Snooze options: 15 minute option. [CHAR LIMIT=50]-->
    <string name="snooze_option_15_min">15 minutes</string>
    <!-- Notification: Menu row: Snooze options: 30 minute option. [CHAR LIMIT=50]-->
    <string name="snooze_option_30_min">30 minutes</string>
    <!-- Notification: Menu row: Snooze options: 1 hour option. [CHAR LIMIT=50]-->
    <string name="snooze_option_1_hour">1 hour</string>
    <!-- Notification: Menu row: Snooze undo button label. [CHAR LIMIT=50]-->
    <string name="snooze_undo">UNDO</string>

    <!-- Notification: Menu row: Snooze: message indicating how long the notification was snoozed for. [CHAR LIMIT=100]-->
    <string name="snoozed_for_time">Snoozed for <xliff:g id="time_amount" example="15 minutes">%1$s</xliff:g></string>

    <!-- Title of the battery settings detail panel [CHAR LIMIT=20] -->
    <string name="battery_panel_title">Battery usage</string>

Loading