1<?xml version="1.0" encoding="utf-8"?>
2<!--
3     Copyright (C) 2013 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
18<!-- FYI: This layout has an extra top level container view that was previously used
19     to allow for the insertion of debug info. The debug info is now gone, but the
20     container remains because there is a high likelihood of UI regression relating
21     to focus and selection states, some of which are specific to keyboard
22     when touch mode is not enable. So, if you, heroic engineer of the future,
23     decide to rip these out, please be sure to check out focus and keyboards. -->
24<com.google.android.material.card.MaterialCardView
25    xmlns:android="http://schemas.android.com/apk/res/android"
26    xmlns:app="http://schemas.android.com/apk/res-auto"
27    android:id="@+id/item_root"
28    android:layout_width="match_parent"
29    android:layout_height="wrap_content"
30    android:layout_margin="4dp"
31    android:foreground="?android:attr/selectableItemBackground"
32    android:clickable="true"
33    android:focusable="true"
34    app:cardElevation="0dp">
35
36    <com.google.android.material.card.MaterialCardView
37        android:layout_width="match_parent"
38        android:layout_height="wrap_content"
39        android:elevation="0dp"
40        android:duplicateParentState="true"
41        app:cardElevation="0dp"
42        app:strokeWidth="1dp"
43        app:strokeColor="?android:strokeColor">
44
45        <!-- The height is 48px.
46             paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) -->
47        <LinearLayout
48            android:layout_width="match_parent"
49            android:layout_height="match_parent"
50            android:orientation="horizontal"
51            android:background="?android:attr/colorBackground"
52            android:gravity="center_vertical">
53
54            <FrameLayout
55                android:id="@+id/icon"
56                android:layout_width="wrap_content"
57                android:layout_height="wrap_content"
58                android:pointerIcon="hand"
59                android:paddingBottom="9dp"
60                android:paddingStart="9dp"
61                android:paddingEnd="8dp"
62                android:paddingTop="9dp">
63
64                <ImageView
65                    android:id="@+id/icon_mime_sm"
66                    android:layout_width="@dimen/grid_item_icon_size"
67                    android:layout_height="@dimen/grid_item_icon_size"
68                    android:layout_gravity="center"
69                    android:contentDescription="@null"
70                    android:scaleType="centerInside"/>
71
72                <ImageView
73                    android:id="@+id/icon_check"
74                    android:layout_width="@dimen/check_icon_size"
75                    android:layout_height="@dimen/check_icon_size"
76                    android:alpha="0"
77                    android:contentDescription="@null"
78                    android:scaleType="fitCenter"
79                    android:src="@drawable/ic_check_circle"/>
80
81            </FrameLayout>
82
83            <ImageView
84                android:id="@+id/icon_profile_badge"
85                android:layout_height="@dimen/briefcase_icon_size"
86                android:layout_width="@dimen/briefcase_icon_size"
87                android:layout_marginEnd="@dimen/briefcase_icon_margin"
88                android:src="@drawable/ic_briefcase"
89                android:tint="?android:attr/colorAccent"
90                android:contentDescription="@string/a11y_work"/>
91
92            <TextView
93                android:id="@android:id/title"
94                android:layout_width="wrap_content"
95                android:layout_height="wrap_content"
96                android:ellipsize="end"
97                android:singleLine="true"
98                android:textAlignment="viewStart"
99                android:textAppearance="@style/CardPrimaryText"
100                android:layout_marginBottom="9dp"
101                android:layout_marginEnd="12dp"
102                android:layout_marginTop="9dp"/>
103
104        </LinearLayout>
105
106    </com.google.android.material.card.MaterialCardView>
107
108    <!-- An overlay that draws the item border when it is focused. -->
109    <View
110        android:layout_width="match_parent"
111        android:layout_height="match_parent"
112        android:background="@drawable/item_doc_grid_border_rounded"
113        android:contentDescription="@null"
114        android:duplicateParentState="true"/>
115
116</com.google.android.material.card.MaterialCardView>