1<!--
2  ~ Copyright (C) 2021 The Android Open Source Project
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License");
5  ~ you may not use this file except in compliance with the License.
6  ~ You may obtain a copy of the License at
7  ~
8  ~      http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
11  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ~ See the License for the specific language governing permissions and
14  ~ limitations under the License.
15  -->
16<!-- Wrap in a frame layout so that we can update the margins on the inner layout. (Since this view
17     is the root view of a window, we cannot change the root view's margins.) -->
18<!-- Alphas start as 0 because the view will be animated in. -->
19<com.android.systemui.temporarydisplay.chipbar.ChipbarRootView
20    xmlns:android="http://schemas.android.com/apk/res/android"
21    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
22    android:id="@+id/chipbar_root_view"
23    android:layout_width="wrap_content"
24    android:layout_height="wrap_content">
25
26    <!-- Extra marginBottom to give room for the drop shadow. -->
27    <LinearLayout
28        android:id="@+id/chipbar_inner"
29        android:orientation="horizontal"
30        android:layout_width="wrap_content"
31        android:layout_height="wrap_content"
32        android:padding="@dimen/chipbar_outer_padding"
33        android:background="@drawable/chipbar_background"
34        android:layout_marginTop="20dp"
35        android:layout_marginStart="@dimen/notification_side_paddings"
36        android:layout_marginEnd="@dimen/notification_side_paddings"
37        android:translationZ="4dp"
38        android:layout_marginBottom="8dp"
39        android:clipToPadding="false"
40        android:gravity="center_vertical"
41        android:alpha="0.0"
42        >
43
44        <com.android.internal.widget.CachingIconView
45            android:id="@+id/start_icon"
46            android:layout_width="@dimen/chipbar_start_icon_size"
47            android:layout_height="@dimen/chipbar_start_icon_size"
48            android:layout_marginEnd="12dp"
49            android:alpha="0.0"
50            />
51
52        <!-- LINT.IfChange textColor -->
53        <TextView
54            android:id="@+id/text"
55            android:layout_width="0dp"
56            android:layout_height="wrap_content"
57            android:layout_weight="1"
58            style="@style/Chipbar.Text"
59            android:textColor="?androidprv:attr/materialColorOnSecondaryFixed"
60            android:alpha="0.0"
61            />
62        <!-- LINT.ThenChange(systemui.temporarydisplay.chipbar.ChipbarInfo.kt) -->
63
64        <!-- At most one of [loading, failure_icon, undo] will be visible at a time. -->
65        <ImageView
66            android:id="@+id/loading"
67            android:layout_width="@dimen/chipbar_end_icon_size"
68            android:layout_height="@dimen/chipbar_end_icon_size"
69            android:layout_marginStart="@dimen/chipbar_end_item_start_margin"
70            android:src="@drawable/ic_progress_activity"
71            android:tint="?androidprv:attr/materialColorOnSecondaryFixedVariant"
72            android:alpha="0.0"
73            />
74
75        <ImageView
76            android:id="@+id/error"
77            android:layout_width="@dimen/chipbar_end_icon_size"
78            android:layout_height="@dimen/chipbar_end_icon_size"
79            android:layout_marginStart="@dimen/chipbar_end_item_start_margin"
80            android:src="@drawable/ic_warning"
81            android:tint="@color/GM2_red_600"
82            android:alpha="0.0"
83            />
84
85        <TextView
86            android:id="@+id/end_button"
87            android:layout_width="wrap_content"
88            android:layout_height="wrap_content"
89            android:layout_marginStart="@dimen/chipbar_end_item_start_margin"
90            style="@style/Chipbar.Text"
91            android:textColor="?androidprv:attr/materialColorOnPrimaryFixed"
92            android:paddingStart="@dimen/chipbar_outer_padding"
93            android:paddingEnd="@dimen/chipbar_outer_padding"
94            android:paddingTop="@dimen/chipbar_end_button_vertical_padding"
95            android:paddingBottom="@dimen/chipbar_end_button_vertical_padding"
96            android:layout_marginTop="@dimen/chipbar_end_button_vertical_negative_margin"
97            android:layout_marginBottom="@dimen/chipbar_end_button_vertical_negative_margin"
98            android:background="@drawable/chipbar_end_button_background"
99            android:alpha="0.0"
100            />
101
102    </LinearLayout>
103</com.android.systemui.temporarydisplay.chipbar.ChipbarRootView>
104