1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2018 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<LinearLayout
24    xmlns:android="http://schemas.android.com/apk/res/android"
25    android:layout_width="match_parent"
26    android:layout_height="wrap_content"
27    android:orientation="vertical"
28    android:layout_margin="4dp"
29    android:background="@drawable/grid_item_background"
30    android:elevation="@dimen/grid_item_elevation"
31    android:focusable="true">
32
33    <RelativeLayout
34        android:layout_width="match_parent"
35        android:layout_height="wrap_content"
36        android:duplicateParentState="true">
37
38        <!-- Main item thumbnail. Comprised of two overlapping images, the
39             visibility of which is controlled by code in
40             DirectoryFragment.java. -->
41
42        <FrameLayout
43            android:id="@+id/thumbnail"
44            android:layout_width="match_parent"
45            android:layout_height="wrap_content">
46
47            <com.android.documentsui.GridItemThumbnail
48                android:id="@+id/icon_thumb"
49                android:layout_width="match_parent"
50                android:layout_height="wrap_content"
51                android:scaleType="centerCrop"
52                android:contentDescription="@null"
53                android:tint="?attr/gridItemTint"
54                android:tintMode="src_over"/>
55
56            <com.android.documentsui.GridItemThumbnail
57                android:id="@+id/icon_mime_lg"
58                android:layout_width="@dimen/icon_size"
59                android:layout_height="@dimen/icon_size"
60                android:layout_gravity="center"
61                android:scaleType="fitCenter"
62                android:contentDescription="@null"/>
63
64        </FrameLayout>
65
66        <FrameLayout
67            android:layout_width="@dimen/button_touch_size"
68            android:layout_height="@dimen/button_touch_size"
69            android:layout_alignParentTop="true"
70            android:layout_alignParentStart="true"
71            android:pointerIcon="hand">
72
73            <ImageView
74                android:id="@+id/icon_check"
75                android:src="@drawable/ic_check_circle"
76                android:alpha="0"
77                android:layout_width="@dimen/check_icon_size"
78                android:layout_height="@dimen/check_icon_size"
79                android:layout_gravity="center"
80                android:scaleType="fitCenter"
81                android:contentDescription="@null"/>
82
83        </FrameLayout>
84
85        <FrameLayout
86            android:id="@+id/preview_icon"
87            android:layout_width="@dimen/button_touch_size"
88            android:layout_height="@dimen/button_touch_size"
89            android:layout_alignParentTop="true"
90            android:layout_alignParentEnd="true"
91            android:pointerIcon="hand"
92            android:focusable="true"
93            android:clickable="true">
94
95            <ImageView
96                android:layout_width="@dimen/zoom_icon_size"
97                android:layout_height="@dimen/zoom_icon_size"
98                android:padding="2dp"
99                android:layout_gravity="center"
100                android:background="@drawable/circle_button_background"
101                android:scaleType="fitCenter"
102                android:src="@drawable/ic_zoom_out"/>
103
104        </FrameLayout>
105
106        <FrameLayout
107            android:id="@+id/icon_briefcase"
108            android:layout_width="@dimen/button_touch_size"
109            android:layout_height="@dimen/button_touch_size"
110            android:layout_alignParentBottom="true"
111            android:layout_alignParentEnd="true"
112            android:pointerIcon="hand">
113
114            <ImageView
115                android:layout_height="@dimen/briefcase_icon_size_photo"
116                android:layout_width="@dimen/briefcase_icon_size_photo"
117                android:src="@drawable/ic_briefcase_white"
118                android:padding="5dp"
119                android:background="@drawable/circle_button_background"
120                android:layout_gravity="center"
121                android:scaleType="fitCenter"
122                android:contentDescription="@string/a11y_work"/>
123        </FrameLayout>
124
125        <!-- An overlay that draws the item border when it is focused. -->
126        <View
127            android:layout_width="wrap_content"
128            android:layout_height="wrap_content"
129            android:layout_alignBottom="@id/thumbnail"
130            android:layout_alignTop="@id/thumbnail"
131            android:layout_alignLeft="@id/thumbnail"
132            android:layout_alignRight="@id/thumbnail"
133            android:contentDescription="@null"
134            android:background="@drawable/item_doc_grid_border"
135            android:duplicateParentState="true"/>
136
137    </RelativeLayout>
138
139</LinearLayout>
140