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<LinearLayout 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:background="@drawable/list_item_background"
23    android:foreground="?android:attr/selectableItemBackground"
24    android:clickable="true"
25    android:focusable="true"
26    android:orientation="horizontal" >
27
28    <LinearLayout
29        android:layout_width="match_parent"
30        android:layout_height="wrap_content"
31        android:baselineAligned="false"
32        android:gravity="center_vertical"
33        android:minHeight="@dimen/list_item_height"
34        android:orientation="horizontal" >
35
36        <FrameLayout
37            android:id="@android:id/icon"
38            android:pointerIcon="hand"
39            android:layout_width="@dimen/list_item_width"
40            android:layout_height="@dimen/list_item_height"
41            android:paddingBottom="@dimen/list_item_icon_padding"
42            android:paddingTop="@dimen/list_item_icon_padding"
43            android:paddingEnd="16dp"
44            android:paddingStart="@dimen/list_item_padding" >
45
46            <com.google.android.material.card.MaterialCardView
47                app:cardElevation="0dp"
48                app:cardBackgroundColor="@android:color/transparent"
49                android:layout_width="match_parent"
50                android:layout_height="match_parent">
51
52                <ImageView
53                    android:id="@+id/icon_mime"
54                    android:layout_width="wrap_content"
55                    android:layout_height="wrap_content"
56                    android:layout_gravity="center"
57                    android:contentDescription="@null"
58                    android:scaleType="centerInside" />
59
60                <ImageView
61                    android:id="@+id/icon_thumb"
62                    android:layout_width="match_parent"
63                    android:layout_height="match_parent"
64                    android:layout_gravity="center"
65                    android:contentDescription="@null"
66                    android:scaleType="centerCrop" />
67
68                <ImageView
69                    android:id="@+id/icon_check"
70                    android:layout_width="@dimen/check_icon_size"
71                    android:layout_height="@dimen/check_icon_size"
72                    android:layout_gravity="center"
73                    android:alpha="0"
74                    android:contentDescription="@null"
75                    android:scaleType="fitCenter"
76                    android:src="@drawable/ic_check_circle" />
77
78            </com.google.android.material.card.MaterialCardView>
79
80        </FrameLayout>
81
82        <!-- This is the one special case where we want baseline alignment! -->
83
84        <LinearLayout
85            android:layout_width="0dp"
86            android:layout_height="wrap_content"
87            android:layout_weight="1"
88            android:orientation="horizontal" >
89
90            <LinearLayout
91                android:layout_width="0dp"
92                android:layout_height="wrap_content"
93                android:layout_weight="0.4"
94                android:layout_marginEnd="12dp"
95                android:orientation="horizontal">
96
97                <ImageView
98                    android:id="@+id/icon_briefcase"
99                    android:layout_height="@dimen/briefcase_icon_size"
100                    android:layout_width="@dimen/briefcase_icon_size"
101                    android:layout_marginEnd="@dimen/briefcase_icon_margin"
102                    android:layout_gravity="center_vertical"
103                    android:src="@drawable/ic_briefcase"
104                    android:contentDescription="@string/a11y_work"/>
105
106                <TextView
107                    android:id="@android:id/title"
108                    android:layout_width="match_parent"
109                    android:layout_height="wrap_content"
110                    android:ellipsize="middle"
111                    android:singleLine="true"
112                    android:textAlignment="viewStart"
113                    android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
114                    android:textColor="?android:attr/textColorPrimary"/>
115            </LinearLayout>
116
117            <TextView
118                android:id="@+id/file_type"
119                android:layout_width="0dp"
120                android:layout_height="wrap_content"
121                android:layout_marginEnd="12dp"
122                android:layout_weight="0.2"
123                android:ellipsize="end"
124                android:singleLine="true"
125                android:textAlignment="viewStart"
126                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
127                android:textColor="?android:attr/textColorSecondary" />
128
129            <TextView
130                android:id="@+id/size"
131                android:layout_width="0dp"
132                android:layout_height="wrap_content"
133                android:layout_marginEnd="12dp"
134                android:layout_weight="0.2"
135                android:ellipsize="end"
136                android:minWidth="70dp"
137                android:singleLine="true"
138                android:textAlignment="viewEnd"
139                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
140                android:textColor="?android:attr/textColorSecondary" />
141
142            <TextView
143                android:id="@+id/date"
144                android:layout_width="0dp"
145                android:layout_height="wrap_content"
146                android:layout_marginEnd="12dp"
147                android:layout_weight="0.2"
148                android:ellipsize="end"
149                android:minWidth="70dp"
150                android:singleLine="true"
151                android:textAlignment="viewEnd"
152                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
153                android:textColor="?android:attr/textColorSecondary" />
154        </LinearLayout>
155
156        <FrameLayout
157            android:layout_width="wrap_content"
158            android:layout_height="wrap_content">
159
160            <FrameLayout
161                android:id="@+id/preview_icon"
162                android:layout_width="@dimen/list_item_width"
163                android:layout_height="@dimen/list_item_height"
164                android:padding="@dimen/list_item_icon_padding"
165                android:focusable="true">
166
167                <ImageView
168                    android:layout_width="@dimen/check_icon_size"
169                    android:layout_height="@dimen/check_icon_size"
170                    android:layout_gravity="center"
171                    android:scaleType="fitCenter"
172                    android:tint="?android:attr/textColorPrimary"
173                    android:src="@drawable/ic_zoom_out"/>
174
175            </FrameLayout>
176
177            <android.widget.Space
178                android:layout_width="@dimen/list_item_width"
179                android:layout_height="@dimen/list_item_height"/>
180
181        </FrameLayout>
182
183    </LinearLayout>
184
185</LinearLayout>