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