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 <LinearLayout 80 android:layout_width="0dp" 81 android:layout_height="wrap_content" 82 android:layout_weight="0.4" 83 android:layout_marginEnd="12dp" 84 android:orientation="horizontal"> 85 86 <ImageView 87 android:id="@+id/icon_briefcase" 88 android:layout_height="@dimen/briefcase_icon_size" 89 android:layout_width="@dimen/briefcase_icon_size" 90 android:layout_marginEnd="@dimen/briefcase_icon_margin" 91 android:layout_gravity="center_vertical" 92 android:src="@drawable/ic_briefcase" 93 android:contentDescription="@string/a11y_work"/> 94 95 <TextView 96 android:id="@android:id/title" 97 android:layout_width="match_parent" 98 android:layout_height="wrap_content" 99 android:ellipsize="middle" 100 android:singleLine="true" 101 android:textAlignment="viewStart" 102 android:textAppearance="@android:style/TextAppearance.Material.Subhead" 103 android:textColor="?android:attr/textColorPrimary"/> 104 </LinearLayout> 105 106 <TextView 107 android:id="@+id/file_type" 108 android:layout_width="0dp" 109 android:layout_height="wrap_content" 110 android:layout_marginEnd="12dp" 111 android:layout_weight="0.2" 112 android:ellipsize="end" 113 android:singleLine="true" 114 android:textAlignment="viewStart" 115 android:textAppearance="@android:style/TextAppearance.Material.Body1" 116 android:textColor="?android:attr/textColorSecondary" /> 117 118 <TextView 119 android:id="@+id/size" 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:minWidth="70dp" 126 android:singleLine="true" 127 android:textAlignment="viewEnd" 128 android:textAppearance="@android:style/TextAppearance.Material.Body1" 129 android:textColor="?android:attr/textColorSecondary" /> 130 131 <TextView 132 android:id="@+id/date" 133 android:layout_width="0dp" 134 android:layout_height="wrap_content" 135 android:layout_marginEnd="12dp" 136 android:layout_weight="0.2" 137 android:ellipsize="end" 138 android:minWidth="70dp" 139 android:singleLine="true" 140 android:textAlignment="viewEnd" 141 android:textAppearance="@android:style/TextAppearance.Material.Body1" 142 android:textColor="?android:attr/textColorSecondary" /> 143 </LinearLayout> 144 145 <FrameLayout 146 android:layout_width="wrap_content" 147 android:layout_height="wrap_content"> 148 149 <FrameLayout 150 android:id="@+id/preview_icon" 151 android:layout_width="@dimen/list_item_width" 152 android:layout_height="@dimen/list_item_height" 153 android:padding="@dimen/list_item_icon_padding" 154 android:focusable="true"> 155 156 <ImageView 157 android:layout_width="@dimen/check_icon_size" 158 android:layout_height="@dimen/check_icon_size" 159 android:layout_gravity="center" 160 android:scaleType="fitCenter" 161 android:tint="?android:attr/textColorPrimary" 162 android:src="@drawable/ic_zoom_out"/> 163 164 </FrameLayout> 165 166 <android.widget.Space 167 android:layout_width="@dimen/list_item_width" 168 android:layout_height="@dimen/list_item_height"/> 169 170 </FrameLayout> 171 172 </LinearLayout> 173 174</LinearLayout>