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.NotificationInfo
     19         xmlns:android="http://schemas.android.com/apk/res/android"
     20         android:layout_width="match_parent"
     21         android:layout_height="wrap_content"
     22         android:id="@+id/notification_guts"
     23         android:clickable="true"
     24         android:orientation="vertical"
     25         android:paddingStart="@*android:dimen/notification_content_margin_start"
     26         android:background="@color/notification_guts_bg_color"
     27         android:theme="@*android:style/Theme.DeviceDefault.Light">
     28 
     29     <!-- Package Info -->
     30     <LinearLayout
     31         android:layout_width="match_parent"
     32         android:layout_height="@*android:dimen/notification_header_height"
     33         android:clipChildren="false"
     34         android:paddingTop="@*android:dimen/notification_header_padding_top"
     35         android:paddingBottom="@*android:dimen/notification_header_padding_bottom"
     36         android:gravity="center_vertical"
     37         android:orientation="horizontal" >
     38         <ImageView
     39             android:id="@+id/pkgicon"
     40             android:layout_width="@*android:dimen/notification_header_icon_size"
     41             android:layout_height="@*android:dimen/notification_header_icon_size"
     42             android:layout_marginEnd="3dp"/>
     43         <TextView
     44             android:id="@+id/pkgname"
     45             android:layout_width="wrap_content"
     46             android:layout_height="wrap_content"
     47             android:textAppearance="@*android:style/TextAppearance.Material.Notification.Info"
     48             android:layout_marginStart="3dp"
     49             android:layout_marginEnd="2dp"
     50             android:singleLine="true"/>
     51         <TextView
     52             android:id="@+id/pkg_group_divider"
     53             android:layout_width="wrap_content"
     54             android:layout_height="wrap_content"
     55             android:textAppearance="@*android:style/TextAppearance.Material.Notification.Info"
     56             android:layout_marginStart="2dp"
     57             android:layout_marginEnd="2dp"
     58             android:text="@*android:string/notification_header_divider_symbol"/>
     59         <TextView
     60             android:id="@+id/group_name"
     61             android:layout_width="wrap_content"
     62             android:layout_height="wrap_content"
     63             android:textAppearance="@*android:style/TextAppearance.Material.Notification.Info"
     64             android:layout_marginStart="2dp"
     65             android:layout_marginEnd="2dp"
     66             android:ellipsize="end"
     67             android:maxLines="1"/>
     68     </LinearLayout>
     69 
     70     <!-- Channel Info Block -->
     71     <LinearLayout
     72         android:layout_width="match_parent"
     73         android:layout_height="wrap_content"
     74         android:layout_marginBottom="20dp"
     75         android:layout_marginEnd="@*android:dimen/notification_content_margin_end"
     76         android:orientation="vertical">
     77         <!-- Channel Text -->
     78         <LinearLayout
     79             android:layout_width="match_parent"
     80             android:layout_height="wrap_content"
     81             android:orientation="horizontal">
     82             <!-- Channel Name -->
     83             <TextView
     84                 android:id="@+id/channel_name"
     85                 android:layout_width="0dp"
     86                 android:layout_height="wrap_content"
     87                 android:layout_weight="1"
     88                 android:layout_marginBottom="6dp"
     89                 style="@style/TextAppearance.NotificationInfo.Primary" />
     90             <!-- Ban Channel Switch -->
     91             <Switch
     92                 android:id="@+id/channel_enabled_switch"
     93                 android:layout_width="wrap_content"
     94                 android:layout_height="wrap_content"
     95                 android:layout_gravity="end|center_vertical"
     96                 android:contentDescription="@string/notification_channel_switch_accessibility"
     97                 android:background="@null" />
     98         </LinearLayout>
     99         <!-- Secondary Text - only one shows at a time -->
    100         <TextView
    101             android:id="@+id/channel_disabled"
    102             android:layout_width="wrap_content"
    103             android:layout_height="wrap_content"
    104             android:text="@string/notification_channel_disabled"
    105             style="@style/TextAppearance.NotificationInfo.Secondary.Warning" />
    106         <TextView
    107             android:id="@+id/num_channels_desc"
    108             android:layout_width="wrap_content"
    109             android:layout_height="wrap_content"
    110             android:text="@string/notification_channel_disabled"
    111             style="@style/TextAppearance.NotificationInfo.Secondary" />
    112         <!-- Optional link to app. Only appears if the channel is not disabled -->
    113         <TextView
    114             android:id="@+id/app_settings"
    115             android:layout_width="wrap_content"
    116             android:layout_height="wrap_content"
    117             android:visibility="gone"
    118             android:ellipsize="end"
    119             android:maxLines="1"
    120             style="@style/TextAppearance.NotificationInfo.Secondary.Link"/>
    121     </LinearLayout>
    122 
    123     <!-- Settings and Done buttons -->
    124     <LinearLayout
    125         android:layout_width="match_parent"
    126         android:layout_height="48dp"
    127         android:orientation="horizontal"
    128         android:gravity="end"
    129         android:layout_marginBottom="8dp" >
    130         <TextView
    131             android:id="@+id/more_settings"
    132             android:text="@string/notification_more_settings"
    133             android:layout_width="wrap_content"
    134             android:layout_height="match_parent"
    135             android:layout_marginEnd="8dp"
    136             style="@style/TextAppearance.NotificationInfo.Button"/>
    137         <TextView
    138             android:id="@+id/done"
    139             android:text="@string/notification_done"
    140             android:layout_width="wrap_content"
    141             android:layout_height="match_parent"
    142             android:layout_marginEnd="8dp"
    143             style="@style/TextAppearance.NotificationInfo.Button"/>
    144     </LinearLayout>
    145 </com.android.systemui.statusbar.NotificationInfo>
    146