1<?xml version="1.0" encoding="utf-8"?>
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
17<FrameLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    android:layout_width="match_parent"
21    android:layout_height="wrap_content"
22    android:focusable="true">
23
24    <com.google.android.material.card.MaterialCardView
25        android:layout_width="match_parent"
26        android:layout_height="wrap_content"
27        android:elevation="0dp"
28        android:duplicateParentState="true"
29        app:cardElevation="0dp"
30        app:cardCornerRadius="0dp"
31        app:strokeWidth="0dp">
32
33        <FrameLayout
34            android:layout_width="match_parent"
35            android:layout_height="wrap_content">
36
37            <com.android.providers.media.photopicker.ui.SquareImageView
38                android:id="@+id/icon_thumbnail"
39                android:layout_width="match_parent"
40                android:layout_height="wrap_content"
41                android:scaleType="centerCrop"
42                android:contentDescription="@null"/>
43
44            <FrameLayout
45                android:id="@+id/overlay_gradient"
46                android:layout_width="match_parent"
47                android:layout_height="@dimen/picker_item_gradient_height"
48                android:background="@drawable/picker_item_gradient"/>
49
50            <ImageView
51                android:id="@+id/icon_gif"
52                android:layout_width="wrap_content"
53                android:layout_height="wrap_content"
54                android:layout_gravity="end|top"
55                android:scaleType="fitCenter"
56                android:src="@drawable/ic_gif"
57                android:contentDescription="@null"/>
58
59            <ImageView
60                android:id="@+id/icon_motion_photo"
61                android:layout_width="wrap_content"
62                android:layout_height="wrap_content"
63                android:layout_gravity="end|top"
64                android:layout_marginEnd="@dimen/picker_item_badge_margin"
65                android:layout_marginTop="@dimen/picker_item_badge_margin"
66                android:scaleType="fitCenter"
67                android:src="@drawable/ic_motion_photo"
68                android:contentDescription="@null"/>
69
70            <LinearLayout
71                android:id="@+id/video_container"
72                android:layout_width="wrap_content"
73                android:layout_height="wrap_content"
74                android:layout_gravity="end|top"
75                android:layout_marginEnd="@dimen/picker_item_badge_margin"
76                android:layout_marginTop="@dimen/picker_item_badge_margin"
77                android:orientation="horizontal"
78                android:contentDescription="@null">
79
80                <TextView
81                    android:id="@+id/video_duration"
82                    android:layout_width="wrap_content"
83                    android:layout_height="wrap_content"
84                    android:layout_marginEnd="@dimen/picker_item_badge_text_margin"
85                    android:layout_gravity="center_vertical"
86                    android:textColor="@android:color/white"
87                    android:textSize="@dimen/picker_item_badge_text_size"/>
88
89                <ImageView
90                    android:id="@+id/icon_video"
91                    android:layout_width="wrap_content"
92                    android:layout_height="wrap_content"
93                    android:scaleType="fitCenter"
94                    android:src="@drawable/ic_play_circle_filled"
95                    android:contentDescription="@null"/>
96            </LinearLayout>
97        </FrameLayout>
98
99    </com.google.android.material.card.MaterialCardView>
100
101    <ImageView
102        android:id="@+id/icon_check"
103        android:layout_height="@dimen/picker_item_check_size"
104        android:layout_width="@dimen/picker_item_check_size"
105        android:layout_marginStart="@dimen/picker_item_check_margin"
106        android:layout_marginTop="@dimen/picker_item_check_margin"
107        android:src="@drawable/picker_item_check"
108        android:layout_gravity="top|start"
109        android:scaleType="fitCenter"/>
110
111    <TextView
112        android:id="@+id/selected_order"
113        android:layout_height="@dimen/picker_item_check_size"
114        android:layout_width="@dimen/picker_item_check_size"
115        android:layout_marginStart="@dimen/picker_item_check_margin"
116        android:layout_marginTop="@dimen/picker_item_check_margin"
117        android:background="@drawable/picker_item_order"
118        android:layout_gravity="top|start"
119        android:gravity="center"
120        android:textSize="12dp"
121        android:textColor="?android:attr/textColorPrimaryInverse"
122        android:scaleType="fitCenter"/>
123
124</FrameLayout>
125