• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2013 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<!-- FYI: This layout has an extra top level container view that was previously used
18     to allow for the insertion of debug info. The debug info is now gone, but the
19     container remains because there is a high likelihood of UI regression relating
20     to focus and selection states, some of which are specific to keyboard
21     when touch mode is not enable. So, if you, heroic engineer of the future,
22     decide to rip these out, please be sure to check out focus and keyboards. -->
23<FrameLayout
24    xmlns:android="http://schemas.android.com/apk/res/android"
25    xmlns:app="http://schemas.android.com/apk/res-auto"
26    android:id="@+id/item_root"
27    android:layout_width="match_parent"
28    android:layout_height="wrap_content"
29    android:layout_margin="2dp"
30    android:focusable="true">
31
32    <com.google.android.material.card.MaterialCardView
33        android:layout_width="match_parent"
34        android:layout_height="wrap_content"
35        android:layout_margin="2dp"
36        android:elevation="0dp"
37        android:duplicateParentState="true"
38        app:cardElevation="0dp"
39        app:strokeWidth="1dp"
40        app:strokeColor="?android:strokeColor">
41
42        <RelativeLayout
43            android:layout_width="match_parent"
44            android:layout_height="wrap_content"
45            android:duplicateParentState="true">
46
47            <!-- Main item thumbnail.  Comprised of two overlapping images, the
48                 visibility of which is controlled by code in
49                 DirectoryFragment.java. -->
50
51            <FrameLayout
52                android:id="@+id/thumbnail"
53                android:layout_width="match_parent"
54                android:layout_height="wrap_content">
55
56                <com.android.documentsui.GridItemThumbnail
57                    android:id="@+id/icon_thumb"
58                    android:layout_width="match_parent"
59                    android:layout_height="wrap_content"
60                    android:scaleType="centerCrop"
61                    android:contentDescription="@null"
62                    android:tint="?attr/gridItemTint"
63                    android:tintMode="src_over"/>
64
65                <com.android.documentsui.GridItemThumbnail
66                    android:id="@+id/icon_mime_lg"
67                    android:layout_width="@dimen/icon_size"
68                    android:layout_height="@dimen/icon_size"
69                    android:layout_gravity="center"
70                    android:scaleType="fitCenter"
71                    android:contentDescription="@null"/>
72
73            </FrameLayout>
74
75            <FrameLayout
76                android:id="@+id/preview_icon"
77                android:layout_width="@dimen/button_touch_size"
78                android:layout_height="@dimen/button_touch_size"
79                android:layout_alignParentTop="true"
80                android:layout_alignParentEnd="true"
81                android:pointerIcon="hand"
82                android:focusable="true"
83                android:clickable="true">
84
85                <ImageView
86                    android:layout_width="@dimen/zoom_icon_size"
87                    android:layout_height="@dimen/zoom_icon_size"
88                    android:padding="2dp"
89                    android:layout_gravity="center"
90                    android:background="@drawable/circle_button_background"
91                    android:scaleType="fitCenter"
92                    android:src="@drawable/ic_zoom_out"/>
93
94            </FrameLayout>
95
96            <!-- Item nameplate.  Has a mime-type icon and some text fields (title,
97                 size, mod-time, etc). -->
98
99            <LinearLayout
100                android:id="@+id/nameplate"
101                android:background="?android:attr/colorBackground"
102                android:orientation="horizontal"
103                android:layout_width="match_parent"
104                android:layout_height="wrap_content"
105                android:layout_below="@id/thumbnail">
106
107                <FrameLayout
108                    android:id="@+id/icon"
109                    android:layout_width="wrap_content"
110                    android:layout_height="match_parent"
111                    android:layout_centerVertical="true"
112                    android:pointerIcon="hand"
113                    android:paddingTop="8dp"
114                    android:paddingBottom="8dp"
115                    android:paddingStart="12dp"
116                    android:paddingEnd="8dp">
117
118                    <ImageView
119                        android:id="@+id/icon_mime_sm"
120                        android:layout_width="@dimen/grid_item_icon_size"
121                        android:layout_height="@dimen/grid_item_icon_size"
122                        android:layout_gravity="center"
123                        android:scaleType="center"
124                        android:contentDescription="@null"/>
125
126                    <ImageView
127                        android:id="@+id/icon_check"
128                        android:src="@drawable/ic_check_circle"
129                        android:alpha="0"
130                        android:layout_width="@dimen/check_icon_size"
131                        android:layout_height="@dimen/check_icon_size"
132                        android:layout_gravity="center"
133                        android:scaleType="fitCenter"
134                        android:contentDescription="@null"/>
135
136                </FrameLayout>
137
138                <RelativeLayout
139                    android:layout_width="match_parent"
140                    android:layout_height="wrap_content"
141                    android:paddingBottom="8dp"
142                    android:paddingTop="8dp"
143                    android:paddingEnd="12dp">
144
145                    <TextView
146                        android:id="@android:id/title"
147                        android:layout_width="wrap_content"
148                        android:layout_height="wrap_content"
149                        android:layout_alignParentTop="true"
150                        android:layout_alignParentStart="true"
151                        android:singleLine="true"
152                        android:ellipsize="end"
153                        android:textAlignment="viewStart"
154                        android:textAppearance="@style/CardPrimaryText"/>
155
156                    <TextView
157                        android:id="@+id/details"
158                        android:layout_width="wrap_content"
159                        android:layout_height="wrap_content"
160                        android:layout_below="@android:id/title"
161                        android:layout_marginEnd="4dp"
162                        android:singleLine="true"
163                        android:ellipsize="end"
164                        android:textAlignment="viewStart"
165                        android:textAppearance="@android:style/TextAppearance.Material.Caption"/>
166
167                    <TextView
168                        android:id="@+id/date"
169                        android:layout_width="wrap_content"
170                        android:layout_height="wrap_content"
171                        android:layout_below="@android:id/title"
172                        android:layout_toEndOf="@id/details"
173                        android:singleLine="true"
174                        android:ellipsize="end"
175                        android:textAlignment="viewStart"
176                        android:textAppearance="@android:style/TextAppearance.Material.Caption"/>
177
178                </RelativeLayout>
179
180            </LinearLayout>
181
182        </RelativeLayout>
183
184    </com.google.android.material.card.MaterialCardView>
185
186    <!-- An overlay that draws the item border when it is focused. -->
187    <View
188        android:layout_width="match_parent"
189        android:layout_height="match_parent"
190        android:layout_margin="1dp"
191        android:background="@drawable/item_doc_grid_border_rounded"
192        android:contentDescription="@null"
193        android:duplicateParentState="true"/>
194
195</FrameLayout>
196