1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2024 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<com.android.systemui.screenshot.ui.ScreenshotShelfView 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" 20 xmlns:app="http://schemas.android.com/apk/res-auto" 21 android:theme="@style/FloatingOverlay" 22 android:layout_width="match_parent" 23 android:layout_height="match_parent" 24 android:clipChildren="false" 25 android:clipToPadding="false"> 26 <androidx.constraintlayout.widget.ConstraintLayout 27 android:id="@+id/screenshot_static" 28 android:layout_width="match_parent" 29 android:layout_height="match_parent" 30 android:clipChildren="false" 31 android:clipToPadding="false"> 32 <View 33 android:id="@+id/screenshot_preview_border" 34 android:layout_width="0dp" 35 android:layout_height="0dp" 36 android:layout_marginStart="@dimen/overlay_action_container_minimum_edge_spacing" 37 android:layout_marginTop="@dimen/overlay_border_width_neg" 38 android:layout_marginEnd="@dimen/overlay_border_width_neg" 39 android:layout_marginBottom="@dimen/screenshot_shelf_vertical_margin" 40 android:elevation="4dp" 41 android:background="@drawable/overlay_border" 42 app:layout_constraintStart_toStartOf="parent" 43 app:layout_constraintTop_toTopOf="@id/screenshot_preview" 44 app:layout_constraintEnd_toEndOf="@id/screenshot_preview" 45 app:layout_constraintBottom_toTopOf="@id/actions_container_background"/> 46 <ImageView 47 android:id="@+id/screenshot_preview" 48 android:layout_width="@dimen/overlay_x_scale" 49 android:layout_height="wrap_content" 50 android:layout_marginStart="@dimen/overlay_border_width" 51 android:layout_marginBottom="@dimen/overlay_border_width" 52 android:layout_gravity="center" 53 android:elevation="4dp" 54 android:scaleType="fitEnd" 55 android:background="@drawable/overlay_preview_background" 56 android:adjustViewBounds="true" 57 android:clickable="true" 58 app:layout_constraintStart_toStartOf="@id/screenshot_preview_border" 59 app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"/> 60 <!-- Keep the same dimension with screenshot_preview. --> 61 <ImageView 62 android:id="@+id/screenshot_preview_blur" 63 android:layout_width="@dimen/overlay_x_scale" 64 android:layout_height="wrap_content" 65 android:layout_marginStart="@dimen/overlay_border_width" 66 android:layout_marginBottom="@dimen/overlay_border_width" 67 android:layout_gravity="center" 68 android:elevation="4dp" 69 android:scaleType="fitEnd" 70 android:background="@drawable/overlay_preview_background" 71 android:adjustViewBounds="true" 72 android:visibility="invisible" 73 app:layout_constraintStart_toStartOf="@id/screenshot_preview_border" 74 app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"/> 75 <!-- Action bar should be drawn on top of the thumbnail --> 76 <FrameLayout 77 android:id="@+id/actions_container_background" 78 android:visibility="gone" 79 android:layout_height="wrap_content" 80 android:layout_width="wrap_content" 81 android:elevation="4dp" 82 android:background="@drawable/shelf_action_chip_container_background" 83 app:layout_constraintStart_toStartOf="parent" 84 app:layout_constraintBottom_toTopOf="@id/guideline" 85 > 86 <HorizontalScrollView 87 android:id="@+id/actions_container" 88 android:layout_width="wrap_content" 89 android:layout_height="wrap_content" 90 android:layout_marginVertical="@dimen/overlay_action_container_padding_vertical" 91 android:layout_marginHorizontal="@dimen/overlay_action_chip_margin_start" 92 android:background="@drawable/shelf_action_container_clipping_shape" 93 android:clipToOutline="true" 94 android:scrollbars="none"> 95 <LinearLayout 96 android:id="@+id/screenshot_actions" 97 android:layout_width="wrap_content" 98 android:layout_height="wrap_content" 99 android:showDividers="middle" 100 android:divider="@drawable/shelf_action_chip_divider" 101 android:animateLayoutChanges="true" 102 android:orientation="horizontal" /> 103 </HorizontalScrollView> 104 </FrameLayout> 105 <ImageView 106 android:id="@+id/screenshot_badge" 107 android:layout_width="56dp" 108 android:layout_height="56dp" 109 android:visibility="gone" 110 android:elevation="5dp" 111 app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border" 112 app:layout_constraintEnd_toEndOf="@id/screenshot_preview_border"/> 113 <FrameLayout 114 android:id="@+id/screenshot_dismiss_button" 115 android:layout_width="@dimen/overlay_dismiss_button_tappable_size" 116 android:layout_height="@dimen/overlay_dismiss_button_tappable_size" 117 android:elevation="7dp" 118 android:visibility="gone" 119 app:layout_constraintStart_toEndOf="@id/screenshot_preview" 120 app:layout_constraintEnd_toEndOf="@id/screenshot_preview" 121 app:layout_constraintTop_toTopOf="@id/screenshot_preview" 122 app:layout_constraintBottom_toTopOf="@id/screenshot_preview" 123 android:contentDescription="@string/screenshot_dismiss_description"> 124 <ImageView 125 android:id="@+id/screenshot_dismiss_image" 126 android:layout_width="match_parent" 127 android:layout_height="match_parent" 128 android:layout_margin="@dimen/overlay_dismiss_button_margin" 129 android:background="@drawable/circular_background" 130 android:backgroundTint="?androidprv:attr/materialColorPrimary" 131 android:tint="?androidprv:attr/materialColorOnPrimary" 132 android:padding="4dp" 133 android:src="@drawable/ic_close"/> 134 </FrameLayout> 135 <ImageView 136 android:id="@+id/screenshot_scrollable_preview" 137 android:layout_width="wrap_content" 138 android:layout_height="wrap_content" 139 android:clipToOutline="true" 140 android:scaleType="matrix" 141 android:visibility="gone" 142 app:layout_constraintStart_toStartOf="@id/screenshot_preview" 143 app:layout_constraintTop_toTopOf="@id/screenshot_preview" 144 android:elevation="3dp"/> 145 146 <androidx.constraintlayout.widget.Guideline 147 android:id="@+id/guideline" 148 android:layout_width="wrap_content" 149 android:layout_height="wrap_content" 150 android:orientation="horizontal" 151 app:layout_constraintGuide_end="0dp" /> 152 153 <FrameLayout 154 android:id="@+id/screenshot_message_container" 155 android:layout_width="0dp" 156 android:layout_height="wrap_content" 157 android:layout_marginHorizontal="@dimen/overlay_action_container_minimum_edge_spacing" 158 android:layout_marginTop="4dp" 159 android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom" 160 android:paddingHorizontal="@dimen/overlay_action_container_padding_end" 161 android:paddingVertical="@dimen/overlay_action_container_padding_vertical" 162 android:elevation="4dp" 163 android:background="@drawable/action_chip_container_background" 164 android:visibility="gone" 165 app:layout_constraintTop_toBottomOf="@id/guideline" 166 app:layout_constraintStart_toStartOf="parent" 167 app:layout_constraintEnd_toEndOf="parent" 168 app:layout_constraintWidth_max="450dp" 169 app:layout_constraintHorizontal_bias="0"> 170 <include layout="@layout/screenshot_work_profile_first_run" /> 171 <include layout="@layout/screenshot_detection_notice" /> 172 </FrameLayout> 173 </androidx.constraintlayout.widget.ConstraintLayout> 174 <ImageView 175 android:id="@+id/screenshot_scrolling_scrim" 176 android:layout_width="match_parent" 177 android:layout_height="match_parent" 178 android:visibility="gone" 179 android:clickable="true" 180 android:importantForAccessibility="no"/> 181 <ImageView 182 android:id="@+id/screenshot_flash" 183 android:layout_width="match_parent" 184 android:layout_height="match_parent" 185 android:visibility="gone" 186 android:elevation="12dp" 187 android:src="@android:color/white"/> 188</com.android.systemui.screenshot.ui.ScreenshotShelfView> 189