1<!--
2  ~ Copyright (C) 2023 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
17<androidx.constraintlayout.widget.ConstraintLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
21    android:layout_width="wrap_content"
22    android:layout_height="@dimen/chooser_preview_image_height_tall">
23
24    <com.android.intentresolver.widget.RoundedRectImageView
25            android:id="@+id/image"
26            android:layout_width="0dp"
27            android:layout_height="match_parent"
28            app:layout_constraintDimensionRatio="W,1:1"
29            android:layout_alignParentTop="true"
30            android:adjustViewBounds="false"
31            android:scaleType="centerCrop"
32            app:radius="@dimen/chooser_corner_radius_small"
33            android:importantForAccessibility="no" />
34
35    <FrameLayout
36        android:id="@+id/badge_frame"
37        android:layout_width="0dp"
38        android:layout_height="0dp"
39        app:layout_constraintStart_toStartOf="@+id/image"
40        app:layout_constraintEnd_toEndOf="@+id/image"
41        app:layout_constraintTop_toTopOf="@+id/image"
42        app:layout_constraintBottom_toBottomOf="@+id/image"
43        android:background="@drawable/content_preview_badge_bg"
44        android:importantForAccessibility="noHideDescendants">
45
46        <ImageView
47            android:id="@+id/badge"
48            android:layout_width="wrap_content"
49            android:layout_height="wrap_content"
50            android:scaleType="center"
51            android:layout_marginEnd="6dp"
52            android:layout_marginTop="6dp"
53            android:tint="@android:color/white"
54            android:layout_gravity="top|end" />
55    </FrameLayout>
56
57    <FrameLayout
58        android:id="@+id/edit"
59        android:layout_width="48dp"
60        android:layout_height="48dp"
61        app:layout_constraintEnd_toEndOf="parent"
62        app:layout_constraintBottom_toBottomOf="parent"
63        android:background="@drawable/edit_action_background"
64        android:drawableTint="?androidprv:attr/materialColorSecondaryFixed"
65        android:contentDescription="@string/screenshot_edit"
66        android:visibility="gone"
67        >
68        <ImageView
69            android:layout_width="wrap_content"
70            android:layout_height="wrap_content"
71            android:layout_gravity="center"
72            android:padding="4dp"
73            android:tint="?androidprv:attr/materialColorOnSecondaryFixed"
74            android:src="@androidprv:drawable/ic_screenshot_edit"
75            />
76    </FrameLayout>
77</androidx.constraintlayout.widget.ConstraintLayout>
78