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<FrameLayout
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="2dp"
31    android:focusable="true">
32
33    <com.google.android.material.card.MaterialCardView
34        android:layout_width="match_parent"
35        android:layout_height="wrap_content"
36        android:layout_margin="2dp"
37        android:elevation="0dp"
38        android:duplicateParentState="true"
39        app:cardElevation="0dp"
40        app:strokeWidth="1dp"
41        app:strokeColor="?android:strokeColor">
42
43        <!-- The height is 48px.
44             paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) -->
45        <LinearLayout
46            android:layout_width="match_parent"
47            android:layout_height="match_parent"
48            android:orientation="horizontal"
49            android:background="?android:attr/colorBackground"
50            android:gravity="center_vertical">
51
52            <FrameLayout
53                android:id="@+id/icon"
54                android:layout_width="wrap_content"
55                android:layout_height="wrap_content"
56                android:pointerIcon="hand"
57                android:paddingBottom="9dp"
58                android:paddingStart="9dp"
59                android:paddingEnd="8dp"
60                android:paddingTop="9dp">
61
62                <ImageView
63                    android:id="@+id/icon_mime_sm"
64                    android:layout_width="@dimen/grid_item_icon_size"
65                    android:layout_height="@dimen/grid_item_icon_size"
66                    android:layout_gravity="center"
67                    android:contentDescription="@null"
68                    android:scaleType="centerInside"/>
69
70                <ImageView
71                    android:id="@+id/icon_check"
72                    android:layout_width="@dimen/check_icon_size"
73                    android:layout_height="@dimen/check_icon_size"
74                    android:alpha="0"
75                    android:contentDescription="@null"
76                    android:scaleType="fitCenter"
77                    android:src="@drawable/ic_check_circle"/>
78
79            </FrameLayout>
80
81            <ImageView
82                android:id="@+id/icon_briefcase"
83                android:layout_height="@dimen/briefcase_icon_size"
84                android:layout_width="@dimen/briefcase_icon_size"
85                android:layout_marginEnd="@dimen/briefcase_icon_margin"
86                android:src="@drawable/ic_briefcase"
87                android:contentDescription="@string/a11y_work"/>
88
89            <TextView
90                android:id="@android:id/title"
91                android:layout_width="wrap_content"
92                android:layout_height="wrap_content"
93                android:ellipsize="end"
94                android:singleLine="true"
95                android:textAlignment="viewStart"
96                android:textAppearance="@style/CardPrimaryText"
97                android:layout_marginBottom="9dp"
98                android:layout_marginEnd="12dp"
99                android:layout_marginTop="9dp"/>
100
101        </LinearLayout>
102
103    </com.google.android.material.card.MaterialCardView>
104
105    <!-- An overlay that draws the item border when it is focused. -->
106    <View
107        android:layout_width="match_parent"
108        android:layout_height="match_parent"
109        android:layout_margin="1dp"
110        android:background="@drawable/item_doc_grid_border_rounded"
111        android:contentDescription="@null"
112        android:duplicateParentState="true"/>
113
114</FrameLayout>