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 <TextView 53 android:id="@+id/text" 54 android:layout_width="0dp" 55 android:layout_height="wrap_content" 56 android:layout_weight="1" 57 android:textSize="@dimen/chipbar_text_size" 58 android:textColor="@color/chipbar_text_and_icon_color" 59 android:alpha="0.0" 60 /> 61 62 <!-- At most one of [loading, failure_icon, undo] will be visible at a time. --> 63 <ImageView 64 android:id="@+id/loading" 65 android:layout_width="@dimen/chipbar_end_icon_size" 66 android:layout_height="@dimen/chipbar_end_icon_size" 67 android:layout_marginStart="@dimen/chipbar_end_item_start_margin" 68 android:src="@drawable/ic_progress_activity" 69 android:tint="@android:color/system_accent2_700" 70 android:alpha="0.0" 71 /> 72 73 <ImageView 74 android:id="@+id/error" 75 android:layout_width="@dimen/chipbar_end_icon_size" 76 android:layout_height="@dimen/chipbar_end_icon_size" 77 android:layout_marginStart="@dimen/chipbar_end_item_start_margin" 78 android:src="@drawable/ic_warning" 79 android:tint="@color/GM2_red_600" 80 android:alpha="0.0" 81 /> 82 83 <TextView 84 android:id="@+id/end_button" 85 android:layout_width="wrap_content" 86 android:layout_height="wrap_content" 87 android:textColor="?androidprv:attr/textColorOnAccent" 88 android:layout_marginStart="@dimen/chipbar_end_item_start_margin" 89 android:textSize="@dimen/chipbar_text_size" 90 android:paddingStart="@dimen/chipbar_outer_padding" 91 android:paddingEnd="@dimen/chipbar_outer_padding" 92 android:paddingTop="@dimen/chipbar_end_button_vertical_padding" 93 android:paddingBottom="@dimen/chipbar_end_button_vertical_padding" 94 android:layout_marginTop="@dimen/chipbar_end_button_vertical_negative_margin" 95 android:layout_marginBottom="@dimen/chipbar_end_button_vertical_negative_margin" 96 android:background="@drawable/chipbar_end_button_background" 97 android:alpha="0.0" 98 /> 99 100 </LinearLayout> 101</com.android.systemui.temporarydisplay.chipbar.ChipbarRootView> 102