blob: 410ef021ddf214cebe0ba8491677abae47af983d [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<!--
Web notification custom layout, big state.
_______________________________________________________
| | |
| Icon | Title text 1:23 pm |
| | |
| | Body text which may run to multiple lines |
|________| if there is a lot of it. |
| __________________________________________|
| |
| Button Button |
| __________________________________________|
| |
| ⛭ www.example.com |
|_____________________________________________________|
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/web_notification_icon_frame"
android:id="@+id/icon_frame"/>
<!--
This LinearLayout handles dynamically changing the visibility of the buttons related views.
The apparent alternative of setting layout params from Java on a RelativeLayout does not work
with RemoteViews. The alternative of using a separate template when there are buttons was
rejected to avoid code duplication.
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/icon_frame"
android:layout_alignParentEnd="true"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_toStartOf="@id/time"
android:layout_alignParentTop="true"
android:singleLine="true"
android:ellipsize="end"
style="@style/WebNotificationTitle"/>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/title"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:singleLine="true"
style="@style/WebNotificationTime"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/body_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-4dp"
android:layout_marginBottom="5dp">
<TextView
android:id="@+id/body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_alignWithParentIfMissing="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/work_profile_badge"
android:ellipsize="end"
style="@style/WebNotificationBodyBig"/>
<ImageView
android:id="@id/work_profile_badge"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="8dp"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginTop="1dp"
android:scaleType="centerInside"
android:contentDescription="@string/notification_work_profile_badge_content_description"
android:visibility="gone"/>
</RelativeLayout>
<ImageView
android:id="@+id/button_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="2dp"
tools:ignore="ContentDescription"
android:visibility="gone"
style="@style/WebNotificationDivider"/>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone"
style="@style/WebNotificationButtons"/>
<ImageView
android:id="@+id/footer_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
tools:ignore="ContentDescription"
style="@style/WebNotificationDivider"/>
<RelativeLayout
tools:ignore="RelativeOverlap"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/origin_settings_icon"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
tools:ignore="ContentDescription"
android:src="@drawable/settings_cog"
android:scaleType="centerInside"
style="@style/WebNotificationSettingsIcon"/>
<Button
android:id="@+id/origin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:minHeight="40dp"
android:gravity="start|center_vertical"
android:paddingEnd="8dp"
android:singleLine="true"
android:ellipsize="start"
style="@style/WebNotificationSettingsButton"/>
<ViewStub
android:id="@id/small_icon_footer"
android:inflatedId="@id/small_icon_footer"
android:layout="@layout/web_notification_small_icon"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginEnd="8dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>