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_profile_badge"
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:tint="?android:attr/colorAccent"
105                    android:contentDescription="@string/a11y_work"/>
106
107                <TextView
108                    android:id="@android:id/title"
109                    android:layout_width="match_parent"
110                    android:layout_height="wrap_content"
111                    android:ellipsize="middle"
112                    android:singleLine="true"
113                    android:textAlignment="viewStart"
114                    android:textAppearance="@style/Subhead"
115                    android:textColor="?android:attr/textColorPrimary"/>
116            </LinearLayout>
117
118            <TextView
119                android:id="@+id/file_type"
120                android:layout_width="0dp"
121                android:layout_height="wrap_content"
122                android:layout_marginEnd="12dp"
123                android:layout_weight="0.2"
124                android:ellipsize="end"
125                android:singleLine="true"
126                android:textAlignment="viewStart"
127                android:textAppearance="@style/Body1"
128                android:textColor="?android:attr/textColorSecondary" />
129
130            <TextView
131                android:id="@+id/size"
132                android:layout_width="0dp"
133                android:layout_height="wrap_content"
134                android:layout_marginEnd="12dp"
135                android:layout_weight="0.2"
136                android:ellipsize="end"
137                android:minWidth="70dp"
138                android:singleLine="true"
139                android:textAlignment="viewEnd"
140                android:textAppearance="@style/Body1"
141                android:textColor="?android:attr/textColorSecondary" />
142
143            <TextView
144                android:id="@+id/date"
145                android:layout_width="0dp"
146                android:layout_height="wrap_content"
147                android:layout_marginEnd="12dp"
148                android:layout_weight="0.2"
149                android:ellipsize="end"
150                android:minWidth="70dp"
151                android:singleLine="true"
152                android:textAlignment="viewEnd"
153                android:textAppearance="@style/Body1"
154                android:textColor="?android:attr/textColorSecondary" />
155        </LinearLayout>
156
157        <FrameLayout
158            android:layout_width="wrap_content"
159            android:layout_height="wrap_content">
160
161            <FrameLayout
162                android:id="@+id/preview_icon"
163                android:layout_width="@dimen/list_item_width"
164                android:layout_height="@dimen/list_item_height"
165                android:padding="@dimen/list_item_icon_padding"
166                android:focusable="true">
167
168                <ImageView
169                    android:layout_width="@dimen/check_icon_size"
170                    android:layout_height="@dimen/check_icon_size"
171                    android:layout_gravity="center"
172                    android:scaleType="fitCenter"
173                    android:tint="?android:attr/textColorPrimary"
174                    android:src="@drawable/ic_zoom_out"/>
175
176            </FrameLayout>
177
178            <android.widget.Space
179                android:layout_width="@dimen/list_item_width"
180                android:layout_height="@dimen/list_item_height"/>
181
182        </FrameLayout>
183
184    </LinearLayout>
185
186</LinearLayout>