- Separate out the blocking helper layout/logic a bit more from the standard guts - Colors! Larger text! big buttons! Persistent descriptions of the behavior you're choosing - No more special 'min' logic - no more inline blocking - placeholder text for what's shown when multiple channels are involved - both 'turn off notifications' and the settings gear currently go to the same place Test: atest Bug: 127992400 Change-Id: I080335fab728c4ac269e093d09c2f6b5ffdaea5e
388 lines
19 KiB
XML
388 lines
19 KiB
XML
<?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.notification.row.NotificationInfo
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:id="@+id/notification_guts"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:orientation="vertical"
|
|
android:paddingStart="@*android:dimen/notification_content_margin_start"
|
|
android:background="@color/notification_guts_bg_color">
|
|
|
|
<!-- Package Info -->
|
|
<RelativeLayout
|
|
android:id="@+id/header"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false">
|
|
<ImageView
|
|
android:id="@+id/pkgicon"
|
|
android:layout_width="@dimen/notification_guts_header_height"
|
|
android:layout_height="@dimen/notification_guts_header_height"
|
|
android:layout_centerVertical="true"
|
|
android:layout_marginEnd="3dp" />
|
|
<TextView
|
|
android:id="@+id/pkgname"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
android:layout_marginStart="3dp"
|
|
android:layout_marginEnd="2dp"
|
|
android:singleLine="true"
|
|
android:layout_centerVertical="true"
|
|
android:layout_toEndOf="@id/pkgicon" />
|
|
<TextView
|
|
android:id="@+id/pkg_divider"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
android:layout_marginStart="2dp"
|
|
android:layout_marginEnd="2dp"
|
|
android:text="@*android:string/notification_header_divider_symbol"
|
|
android:layout_centerVertical="true"
|
|
android:layout_toEndOf="@id/pkgname" />
|
|
<TextView
|
|
android:id="@+id/delegate_name"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
android:layout_marginStart="2dp"
|
|
android:layout_marginEnd="2dp"
|
|
android:ellipsize="end"
|
|
android:maxLines="1"
|
|
android:layout_centerVertical="true"
|
|
android:layout_toEndOf="@id/pkg_divider" />
|
|
<LinearLayout
|
|
android:id="@+id/info_and_settings"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:layout_alignParentEnd="true"
|
|
|
|
android:orientation="horizontal">
|
|
<!-- Optional link to app. Only appears if the channel is not disabled and the app
|
|
asked for it -->
|
|
<ImageButton
|
|
android:id="@+id/app_settings"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp"
|
|
android:layout_centerVertical="true"
|
|
android:visibility="gone"
|
|
android:background="@drawable/ripple_drawable"
|
|
android:contentDescription="@string/notification_app_settings"
|
|
android:src="@drawable/ic_info"
|
|
android:tint="@color/notification_guts_link_icon_tint" />
|
|
<!-- 24 dp icon with 16 dp padding all around to mirror notification content margins -->
|
|
<ImageButton
|
|
android:id="@+id/info"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp"
|
|
android:layout_centerVertical="true"
|
|
android:background="@drawable/ripple_drawable"
|
|
android:contentDescription="@string/notification_more_settings"
|
|
android:src="@drawable/ic_settings"
|
|
android:tint="@color/notification_guts_link_icon_tint" />
|
|
</LinearLayout>
|
|
</RelativeLayout>
|
|
|
|
<!-- Channel Info Block -->
|
|
<LinearLayout
|
|
android:id="@+id/channel_info"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
|
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
|
android:orientation="vertical">
|
|
<RelativeLayout
|
|
android:id="@+id/names"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
<TextView
|
|
android:id="@+id/group_name"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
android:layout_marginStart="2dp"
|
|
android:layout_marginEnd="2dp"
|
|
android:ellipsize="end"
|
|
android:maxLines="1"
|
|
android:layout_centerVertical="true" />
|
|
<TextView
|
|
android:id="@+id/pkg_group_divider"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
android:layout_marginStart="2dp"
|
|
android:layout_marginEnd="2dp"
|
|
android:text="@*android:string/notification_header_divider_symbol"
|
|
android:layout_centerVertical="true"
|
|
android:layout_toEndOf="@id/group_name" />
|
|
<!-- Channel Name -->
|
|
<TextView
|
|
android:id="@+id/channel_name"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
android:layout_toEndOf="@id/pkg_group_divider"/>
|
|
</RelativeLayout>
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/blocking_helper"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
|
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:orientation="vertical">
|
|
<!-- blocking helper text. no need for non-configurable check b/c controls won't be
|
|
activated in that case -->
|
|
<TextView
|
|
android:id="@+id/blocking_helper_text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="2dp"
|
|
android:text="@string/inline_blocking_helper"
|
|
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
|
<RelativeLayout
|
|
android:id="@+id/block_buttons"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="@dimen/notification_guts_button_spacing">
|
|
<TextView
|
|
android:id="@+id/blocking_helper_turn_off_notifications"
|
|
android:text="@string/inline_turn_off_notifications"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:layout_alignParentStart="true"
|
|
android:width="110dp"
|
|
android:paddingEnd="15dp"
|
|
android:breakStrategy="simple"
|
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
|
<TextView
|
|
android:id="@+id/deliver_silently"
|
|
android:text="@string/inline_deliver_silently_button"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
|
|
android:paddingEnd="15dp"
|
|
android:width="110dp"
|
|
android:breakStrategy="simple"
|
|
android:layout_toStartOf="@+id/keep_showing"
|
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
|
<TextView
|
|
android:id="@+id/keep_showing"
|
|
android:text="@string/inline_keep_button"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
|
|
android:width="110dp"
|
|
android:breakStrategy="simple"
|
|
android:layout_alignParentEnd="true"
|
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
|
</RelativeLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/inline_controls"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
|
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
|
android:clipChildren="false"
|
|
android:clipToPadding="false"
|
|
android:orientation="vertical">
|
|
|
|
<!-- Non configurable app/channel text. appears instead of @+id/interruptiveness_settings-->
|
|
<TextView
|
|
android:id="@+id/non_configurable_text"
|
|
android:text="@string/notification_unblockable_desc"
|
|
android:visibility="gone"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
|
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
|
|
|
<!-- Non configurable multichannel text. appears instead of @+id/interruptiveness_settings-->
|
|
<TextView
|
|
android:id="@+id/non_configurable_multichannel_text"
|
|
android:text="@string/notification_multichannel_desc"
|
|
android:visibility="gone"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
|
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
|
|
|
<LinearLayout
|
|
android:id="@+id/interruptiveness_settings"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical">
|
|
<!-- Interruptive row -->
|
|
<LinearLayout
|
|
android:id="@+id/alert_row"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
|
android:paddingBottom="@dimen/notification_guts_option_vertical_padding"
|
|
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
|
android:orientation="horizontal">
|
|
|
|
<ImageView
|
|
android:id="@+id/int_alert"
|
|
android:src="@drawable/ic_notification_interruptive"
|
|
android:background="@android:color/transparent"
|
|
android:layout_gravity="center"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:contentDescription="@string/inline_silent_button_alert"/>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
|
android:paddingEnd="@dimen/notification_guts_option_horizontal_padding"
|
|
android:orientation="vertical">
|
|
<TextView
|
|
android:id="@+id/int_alert_label"
|
|
android:text="@string/inline_silent_button_alert"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:ellipsize="end"
|
|
android:maxLines="1"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"/>
|
|
<TextView
|
|
android:id="@+id/int_alert_summary"
|
|
android:text="@string/hint_text_alert"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:ellipsize="end"
|
|
style="@style/TextAppearance.NotificationInfo.Secondary"/>
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
|
|
<!-- Gentle row -->
|
|
<LinearLayout
|
|
android:id="@+id/silent_row"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
|
android:paddingBottom="@dimen/notification_guts_option_vertical_padding"
|
|
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
|
android:layout_marginTop="@dimen/notification_guts_option_vertical_margin"
|
|
android:orientation="horizontal">
|
|
<ImageView
|
|
android:id="@+id/int_silent"
|
|
android:src="@drawable/ic_notification_gentle"
|
|
android:layout_gravity="center"
|
|
android:layout_width="36dp"
|
|
android:layout_height="36dp"
|
|
android:background="@android:color/transparent"
|
|
android:contentDescription="@string/inline_silent_button_silent"/>
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
|
android:paddingEnd="@dimen/notification_guts_option_horizontal_padding">
|
|
<TextView
|
|
android:id="@+id/int_silent_label"
|
|
android:text="@string/inline_silent_button_silent"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:ellipsize="end"
|
|
android:maxLines="1"
|
|
style="@style/TextAppearance.NotificationInfo.Primary"/>
|
|
<TextView
|
|
android:id="@+id/int_silent_summary"
|
|
android:text="@string/hint_text_silent"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:ellipsize="end"
|
|
style="@style/TextAppearance.NotificationInfo.Secondary"/>
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
|
|
<RelativeLayout
|
|
android:id="@+id/bottom_buttons"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:paddingTop="@dimen/notification_guts_button_spacing"
|
|
android:paddingBottom="@dimen/notification_guts_button_spacing">
|
|
<TextView
|
|
android:id="@+id/turn_off_notifications"
|
|
android:text="@string/inline_turn_off_notifications"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:layout_alignParentStart="true"
|
|
android:maxWidth="200dp"
|
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
|
<TextView
|
|
android:id="@+id/done"
|
|
android:text="@string/inline_ok_button"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_centerVertical="true"
|
|
android:maxWidth="125dp"
|
|
android:layout_alignParentEnd="true"
|
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
|
</RelativeLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
<com.android.systemui.statusbar.notification.row.NotificationUndoLayout
|
|
android:id="@+id/confirmation"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:visibility="gone"
|
|
android:orientation="horizontal" >
|
|
<TextView
|
|
android:id="@+id/confirmation_text"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="start|center_vertical"
|
|
android:layout_marginStart="@*android:dimen/notification_content_margin_start"
|
|
android:layout_marginEnd="@*android:dimen/notification_content_margin_start"
|
|
android:text="@string/notification_channel_disabled"
|
|
style="@style/TextAppearance.NotificationInfo.Confirmation"/>
|
|
<TextView
|
|
android:id="@+id/undo"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="@dimen/notification_guts_button_spacing"
|
|
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
|
android:layout_marginStart="@dimen/notification_guts_button_side_margin"
|
|
android:layout_marginEnd="@dimen/notification_guts_button_side_margin"
|
|
android:layout_gravity="end|center_vertical"
|
|
android:text="@string/inline_undo"
|
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
|
</com.android.systemui.statusbar.notification.row.NotificationUndoLayout>
|
|
</com.android.systemui.statusbar.notification.row.NotificationInfo>
|