Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!--
      3     Copyright 2017, The Android Open Source Project
      4 
      5     Licensed under the Apache License, Version 2.0 (the "License");
      6     you may not use this file except in compliance with the License.
      7     You may obtain a copy of the License at
      8 
      9         http://www.apache.org/licenses/LICENSE-2.0
     10 
     11     Unless required by applicable law or agreed to in writing, software
     12     distributed under the License is distributed on an "AS IS" BASIS,
     13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14     See the License for the specific language governing permissions and
     15     limitations under the License.
     16 -->
     17 
     18 <com.android.systemui.statusbar.notification.row.NotificationInfo
     19     xmlns:android="http://schemas.android.com/apk/res/android"
     20     android:id="@+id/notification_guts"
     21     android:layout_width="match_parent"
     22     android:layout_height="wrap_content"
     23     android:clickable="true"
     24     android:clipChildren="false"
     25     android:clipToPadding="true"
     26     android:orientation="vertical"
     27     android:paddingStart="@*android:dimen/notification_content_margin_start"
     28     android:background="@color/notification_guts_bg_color">
     29 
     30     <!-- Package Info -->
     31     <RelativeLayout
     32         android:id="@+id/header"
     33         android:layout_width="match_parent"
     34         android:layout_height="wrap_content"
     35         android:clipChildren="false"
     36         android:clipToPadding="false">
     37         <ImageView
     38             android:id="@+id/pkgicon"
     39             android:layout_width="@dimen/notification_guts_header_height"
     40             android:layout_height="@dimen/notification_guts_header_height"
     41             android:layout_centerVertical="true"
     42             android:layout_alignParentStart="true"
     43             android:layout_marginEnd="3dp" />
     44         <TextView
     45             android:id="@+id/pkgname"
     46             android:layout_width="wrap_content"
     47             android:layout_height="wrap_content"
     48             android:layout_centerVertical="true"
     49             style="@style/TextAppearance.NotificationImportanceHeader"
     50             android:layout_marginStart="3dp"
     51             android:layout_marginEnd="2dp"
     52             android:layout_toEndOf="@id/pkgicon"
     53             android:singleLine="true" />
     54         <TextView
     55             android:id="@+id/pkg_divider"
     56             android:layout_width="wrap_content"
     57             android:layout_height="wrap_content"
     58             android:layout_centerVertical="true"
     59             style="@style/TextAppearance.NotificationImportanceHeader"
     60             android:layout_marginStart="2dp"
     61             android:layout_marginEnd="2dp"
     62             android:layout_toEndOf="@id/pkgname"
     63             android:text="@*android:string/notification_header_divider_symbol" />
     64         <TextView
     65             android:id="@+id/delegate_name"
     66             android:layout_width="wrap_content"
     67             android:layout_height="wrap_content"
     68             android:layout_centerVertical="true"
     69             style="@style/TextAppearance.NotificationImportanceHeader"
     70             android:layout_marginStart="2dp"
     71             android:layout_marginEnd="2dp"
     72             android:ellipsize="end"
     73             android:text="@string/notification_delegate_header"
     74             android:layout_toEndOf="@id/pkg_divider"
     75             android:maxLines="1" />
     76         <!-- Optional link to app. Only appears if the channel is not disabled and the app
     77 asked for it -->
     78         <ImageButton
     79             android:id="@+id/app_settings"
     80             android:layout_width="@dimen/notification_importance_toggle_size"
     81             android:layout_height="@dimen/notification_importance_toggle_size"
     82             android:layout_centerVertical="true"
     83             android:visibility="gone"
     84             android:background="@drawable/ripple_drawable"
     85             android:contentDescription="@string/notification_app_settings"
     86             android:src="@drawable/ic_info"
     87             android:layout_toStartOf="@id/info"
     88             android:tint="@color/notification_guts_link_icon_tint"/>
     89         <ImageButton
     90             android:id="@+id/info"
     91             android:layout_width="@dimen/notification_importance_toggle_size"
     92             android:layout_height="@dimen/notification_importance_toggle_size"
     93             android:layout_centerVertical="true"
     94             android:background="@drawable/ripple_drawable"
     95             android:contentDescription="@string/notification_more_settings"
     96             android:src="@drawable/ic_settings"
     97             android:layout_alignParentEnd="true"
     98             android:tint="@color/notification_guts_link_icon_tint"/>
     99     </RelativeLayout>
    100 
    101     <!-- Channel Info Block -->
    102     <LinearLayout
    103         android:id="@+id/channel_info"
    104         android:layout_width="match_parent"
    105         android:layout_height="wrap_content"
    106         android:paddingEnd="@*android:dimen/notification_content_margin_end"
    107         android:gravity="center"
    108         android:orientation="vertical">
    109         <!-- Channel Name -->
    110         <TextView
    111             android:id="@+id/channel_name"
    112             android:layout_width="wrap_content"
    113             android:layout_height="wrap_content"
    114             android:layout_weight="1"
    115             style="@style/TextAppearance.NotificationImportanceChannel"/>
    116         <TextView
    117             android:id="@+id/group_name"
    118             android:layout_width="wrap_content"
    119             android:layout_height="wrap_content"
    120             style="@style/TextAppearance.NotificationImportanceChannelGroup"
    121             android:ellipsize="end"
    122             android:maxLines="1"/>
    123     </LinearLayout>
    124 
    125     <LinearLayout
    126         android:id="@+id/blocking_helper"
    127         android:layout_width="match_parent"
    128         android:layout_height="wrap_content"
    129         android:layout_marginTop="@dimen/notification_guts_button_spacing"
    130         android:layout_marginBottom="@dimen/notification_guts_button_spacing"
    131         android:paddingEnd="@*android:dimen/notification_content_margin_end"
    132         android:clipChildren="false"
    133         android:clipToPadding="false"
    134         android:orientation="vertical">
    135         <!-- blocking helper text. no need for non-configurable check b/c controls won't be
    136         activated in that case -->
    137         <TextView
    138             android:id="@+id/blocking_helper_text"
    139             android:layout_width="wrap_content"
    140             android:layout_height="wrap_content"
    141             android:layout_marginTop="2dp"
    142             android:text="@string/inline_blocking_helper"
    143             style="@*android:style/TextAppearance.DeviceDefault.Notification" />
    144         <RelativeLayout
    145             android:id="@+id/block_buttons"
    146             android:layout_width="match_parent"
    147             android:layout_height="wrap_content"
    148             android:layout_marginTop="@dimen/notification_guts_button_spacing">
    149             <TextView
    150                 android:id="@+id/blocking_helper_turn_off_notifications"
    151                 android:text="@string/inline_turn_off_notifications"
    152                 android:layout_width="wrap_content"
    153                 android:layout_height="wrap_content"
    154                 android:layout_centerVertical="true"
    155                 android:layout_alignParentStart="true"
    156                 android:width="110dp"
    157                 android:paddingEnd="15dp"
    158                 android:breakStrategy="simple"
    159                 style="@style/TextAppearance.NotificationInfo.Button"/>
    160             <TextView
    161                 android:id="@+id/deliver_silently"
    162                 android:text="@string/inline_deliver_silently_button"
    163                 android:layout_width="wrap_content"
    164                 android:layout_height="wrap_content"
    165                 android:layout_centerVertical="true"
    166                 android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
    167                 android:paddingEnd="15dp"
    168                 android:width="110dp"
    169                 android:breakStrategy="simple"
    170                 android:layout_toStartOf="@+id/keep_showing"
    171                 style="@style/TextAppearance.NotificationInfo.Button"/>
    172             <TextView
    173                 android:id="@+id/keep_showing"
    174                 android:text="@string/inline_keep_button"
    175                 android:layout_width="wrap_content"
    176                 android:layout_height="wrap_content"
    177                 android:layout_centerVertical="true"
    178                 android:layout_marginStart="@dimen/notification_guts_button_horizontal_spacing"
    179                 android:width="110dp"
    180                 android:breakStrategy="simple"
    181                 android:layout_alignParentEnd="true"
    182                 style="@style/TextAppearance.NotificationInfo.Button"/>
    183         </RelativeLayout>
    184 
    185     </LinearLayout>
    186 
    187     <LinearLayout
    188         android:id="@+id/inline_controls"
    189         android:layout_width="match_parent"
    190         android:layout_height="wrap_content"
    191         android:paddingEnd="@*android:dimen/notification_content_margin_end"
    192         android:layout_marginTop="@dimen/notification_guts_option_vertical_padding"
    193         android:clipChildren="false"
    194         android:clipToPadding="false"
    195         android:orientation="vertical">
    196 
    197         <!-- Non configurable app/channel text. appears instead of @+id/interruptiveness_settings-->
    198         <TextView
    199             android:id="@+id/non_configurable_text"
    200             android:text="@string/notification_unblockable_desc"
    201             android:visibility="gone"
    202             android:layout_width="match_parent"
    203             android:layout_height="wrap_content"
    204             style="@*android:style/TextAppearance.DeviceDefault.Notification" />
    205 
    206         <!-- Non configurable multichannel text. appears instead of @+id/interruptiveness_settings-->
    207         <TextView
    208             android:id="@+id/non_configurable_multichannel_text"
    209             android:text="@string/notification_multichannel_desc"
    210             android:visibility="gone"
    211             android:layout_width="match_parent"
    212             android:layout_height="wrap_content"
    213             style="@*android:style/TextAppearance.DeviceDefault.Notification" />
    214 
    215         <LinearLayout
    216             android:id="@+id/interruptiveness_settings"
    217             android:layout_width="match_parent"
    218             android:layout_height="wrap_content"
    219             android:gravity="center"
    220             android:orientation="vertical">
    221 
    222             <com.android.systemui.statusbar.notification.row.ButtonLinearLayout
    223                 android:id="@+id/alert"
    224                 android:layout_width="match_parent"
    225                 android:layout_height="wrap_content"
    226                 android:padding="@dimen/notification_importance_button_padding"
    227                 android:clickable="true"
    228                 android:focusable="true"
    229                 android:background="@drawable/notification_guts_priority_button_bg"
    230                 android:orientation="vertical">
    231                 <LinearLayout
    232                     android:layout_width="match_parent"
    233                     android:layout_height="wrap_content"
    234                     android:orientation="horizontal"
    235                     android:gravity="center"
    236                     >
    237                     <ImageView
    238                         android:id="@+id/alert_icon"
    239                         android:layout_width="wrap_content"
    240                         android:layout_height="wrap_content"
    241                         android:src="@drawable/ic_notifications_alert"
    242                         android:background="@android:color/transparent"
    243                         android:tint="@color/notification_guts_priority_contents"
    244                         android:clickable="false"
    245                         android:focusable="false"/>
    246                     <TextView
    247                         android:id="@+id/alert_label"
    248                         android:layout_width="0dp"
    249                         android:layout_height="wrap_content"
    250                         android:layout_marginStart="@dimen/notification_importance_drawable_padding"
    251                         android:layout_weight="1"
    252                         android:ellipsize="end"
    253                         android:maxLines="1"
    254                         android:clickable="false"
    255                         android:focusable="false"
    256                         android:textAppearance="@style/TextAppearance.NotificationImportanceButton"
    257                         android:text="@string/notification_alert_title"/>
    258                 </LinearLayout>
    259                 <TextView
    260                     android:id="@+id/alert_summary"
    261                     android:layout_width="match_parent"
    262                     android:layout_height="wrap_content"
    263                     android:layout_marginTop="@dimen/notification_importance_button_description_top_margin"
    264                     android:visibility="gone"
    265                     android:text="@string/notification_channel_summary_default"
    266                     android:clickable="false"
    267                     android:focusable="false"
    268                     android:ellipsize="end"
    269                     android:maxLines="2"
    270                     android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"/>
    271             </com.android.systemui.statusbar.notification.row.ButtonLinearLayout>
    272 
    273             <com.android.systemui.statusbar.notification.row.ButtonLinearLayout
    274                 android:id="@+id/silence"
    275                 android:layout_width="match_parent"
    276                 android:layout_height="wrap_content"
    277                 android:layout_marginTop="@dimen/notification_importance_button_separation"
    278                 android:padding="@dimen/notification_importance_button_padding"
    279                 android:clickable="true"
    280                 android:focusable="true"
    281                 android:background="@drawable/notification_guts_priority_button_bg"
    282                 android:orientation="vertical">
    283                 <LinearLayout
    284                     android:layout_width="match_parent"
    285                     android:layout_height="wrap_content"
    286                     android:orientation="horizontal"
    287                     android:gravity="center"
    288                     >
    289                     <ImageView
    290                         android:id="@+id/silence_icon"
    291                         android:src="@drawable/ic_notifications_silence"
    292                         android:background="@android:color/transparent"
    293                         android:tint="@color/notification_guts_priority_contents"
    294                         android:layout_gravity="center"
    295                         android:layout_width="wrap_content"
    296                         android:layout_height="wrap_content"
    297                         android:clickable="false"
    298                         android:focusable="false"/>
    299                     <TextView
    300                         android:id="@+id/silence_label"
    301                         android:layout_width="match_parent"
    302                         android:layout_height="wrap_content"
    303                         android:ellipsize="end"
    304                         android:maxLines="1"
    305                         android:clickable="false"
    306                         android:focusable="false"
    307                         android:layout_toEndOf="@id/silence_icon"
    308                         android:layout_marginStart="@dimen/notification_importance_drawable_padding"
    309                         android:textAppearance="@style/TextAppearance.NotificationImportanceButton"
    310                         android:text="@string/notification_silence_title"/>
    311                 </LinearLayout>
    312                 <TextView
    313                     android:id="@+id/silence_summary"
    314                     android:layout_width="match_parent"
    315                     android:layout_height="wrap_content"
    316                     android:layout_marginTop="@dimen/notification_importance_button_description_top_margin"
    317                     android:visibility="gone"
    318                     android:text="@string/notification_channel_summary_low"
    319                     android:clickable="false"
    320                     android:focusable="false"
    321                     android:ellipsize="end"
    322                     android:maxLines="2"
    323                     android:textAppearance="@style/TextAppearance.NotificationImportanceDetail"/>
    324             </com.android.systemui.statusbar.notification.row.ButtonLinearLayout>
    325 
    326         </LinearLayout>
    327 
    328         <RelativeLayout
    329             android:id="@+id/bottom_buttons"
    330             android:layout_width="match_parent"
    331             android:layout_height="60dp"
    332             android:gravity="center_vertical"
    333             android:paddingStart="4dp"
    334             android:paddingEnd="4dp"
    335             >
    336             <TextView
    337                 android:id="@+id/turn_off_notifications"
    338                 android:text="@string/inline_turn_off_notifications"
    339                 android:layout_width="wrap_content"
    340                 android:layout_height="wrap_content"
    341                 android:layout_alignParentStart="true"
    342                 android:gravity="start|center_vertical"
    343                 android:minWidth="@dimen/notification_importance_toggle_size"
    344                 android:minHeight="@dimen/notification_importance_toggle_size"
    345                 android:maxWidth="200dp"
    346                 style="@style/TextAppearance.NotificationInfo.Button"/>
    347             <TextView
    348                 android:id="@+id/done"
    349                 android:text="@string/inline_ok_button"
    350                 android:layout_width="wrap_content"
    351                 android:layout_height="wrap_content"
    352                 android:layout_alignParentEnd="true"
    353                 android:gravity="end|center_vertical"
    354                 android:minWidth="@dimen/notification_importance_toggle_size"
    355                 android:minHeight="@dimen/notification_importance_toggle_size"
    356                 android:maxWidth="125dp"
    357                 style="@style/TextAppearance.NotificationInfo.Button"/>
    358         </RelativeLayout>
    359 
    360     </LinearLayout>
    361 
    362     <com.android.systemui.statusbar.notification.row.NotificationUndoLayout
    363         android:id="@+id/confirmation"
    364         android:layout_width="match_parent"
    365         android:layout_height="wrap_content"
    366         android:visibility="gone"
    367         android:orientation="horizontal" >
    368         <TextView
    369             android:id="@+id/confirmation_text"
    370             android:layout_width="wrap_content"
    371             android:layout_height="wrap_content"
    372             android:layout_gravity="start|center_vertical"
    373             android:layout_marginStart="@*android:dimen/notification_content_margin_start"
    374             android:layout_marginEnd="@*android:dimen/notification_content_margin_start"
    375             android:text="@string/notification_channel_disabled"
    376             style="@style/TextAppearance.NotificationInfo.Confirmation"/>
    377         <TextView
    378             android:id="@+id/undo"
    379             android:layout_width="wrap_content"
    380             android:layout_height="wrap_content"
    381             android:minWidth="@dimen/notification_importance_toggle_size"
    382             android:minHeight="@dimen/notification_importance_toggle_size"
    383             android:layout_marginTop="@dimen/notification_guts_button_spacing"
    384             android:layout_marginBottom="@dimen/notification_guts_button_spacing"
    385             android:layout_marginStart="@dimen/notification_guts_button_side_margin"
    386             android:layout_marginEnd="@dimen/notification_guts_button_side_margin"
    387             android:layout_gravity="end|center_vertical"
    388             android:text="@string/inline_undo"
    389             style="@style/TextAppearance.NotificationInfo.Button"/>
    390     </com.android.systemui.statusbar.notification.row.NotificationUndoLayout>
    391 </com.android.systemui.statusbar.notification.row.NotificationInfo>
    392