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<com.android.documentsui.ListItem xmlns:android="http://schemas.android.com/apk/res/android" 19 android:layout_width="match_parent" 20 android:layout_height="wrap_content" 21 android:background="@color/item_doc_background" 22 android:focusable="true" 23 android:orientation="horizontal" > 24 25 <View 26 android:id="@+id/focus_indicator" 27 android:layout_width="4dp" 28 android:layout_height="match_parent" /> 29 30 <LinearLayout 31 android:layout_width="match_parent" 32 android:layout_height="wrap_content" 33 android:baselineAligned="false" 34 android:gravity="center_vertical" 35 android:minHeight="@dimen/list_item_height" 36 android:orientation="horizontal" 37 android:paddingEnd="@dimen/list_item_padding" 38 android:paddingStart="@dimen/list_item_padding" > 39 40 <FrameLayout 41 android:id="@android:id/icon" 42 android:layout_width="@dimen/list_item_thumbnail_size" 43 android:layout_height="@dimen/list_item_thumbnail_size" 44 android:layout_marginEnd="16dp" 45 android:layout_marginStart="0dp" > 46 47 <ImageView 48 android:id="@+id/icon_mime" 49 android:layout_width="wrap_content" 50 android:layout_height="wrap_content" 51 android:layout_gravity="center" 52 android:contentDescription="@null" 53 android:scaleType="centerInside" /> 54 55 <ImageView 56 android:id="@+id/icon_thumb" 57 android:layout_width="match_parent" 58 android:layout_height="match_parent" 59 android:layout_gravity="center" 60 android:contentDescription="@null" 61 android:scaleType="centerCrop" /> 62 63 <ImageView 64 android:id="@+id/icon_check" 65 android:layout_width="@dimen/check_icon_size" 66 android:layout_height="@dimen/check_icon_size" 67 android:layout_gravity="center" 68 android:alpha="0" 69 android:contentDescription="@null" 70 android:scaleType="fitCenter" 71 android:src="@drawable/ic_check_circle" /> 72 73 </FrameLayout> 74 75 <!-- This is the one special case where we want baseline alignment! --> 76 77 <LinearLayout 78 android:layout_width="0dp" 79 android:layout_height="wrap_content" 80 android:layout_weight="1" 81 android:orientation="horizontal" > 82 83 <TextView 84 android:id="@android:id/title" 85 android:layout_width="0dp" 86 android:layout_height="wrap_content" 87 android:layout_marginEnd="12dp" 88 android:layout_weight="0.5" 89 android:ellipsize="middle" 90 android:singleLine="true" 91 android:textAlignment="viewStart" 92 android:textAppearance="@android:style/TextAppearance.Material.Subhead" 93 android:textColor="?android:attr/textColorPrimary" /> 94 95 <TextView 96 android:id="@android:id/summary" 97 android:layout_width="0dp" 98 android:layout_height="wrap_content" 99 android:layout_marginEnd="12dp" 100 android:layout_weight="0.25" 101 android:ellipsize="end" 102 android:singleLine="true" 103 android:textAlignment="viewStart" 104 android:textAppearance="@android:style/TextAppearance.Material.Body1" 105 android:textColor="?android:attr/textColorSecondary" /> 106 107 <TextView 108 android:id="@+id/size" 109 android:layout_width="0dp" 110 android:layout_height="wrap_content" 111 android:layout_marginEnd="12dp" 112 android:layout_weight="0.125" 113 android:ellipsize="end" 114 android:minWidth="70dp" 115 android:singleLine="true" 116 android:textAlignment="viewEnd" 117 android:textAppearance="@android:style/TextAppearance.Material.Body1" 118 android:textColor="?android:attr/textColorSecondary" /> 119 120 <TextView 121 android:id="@+id/date" 122 android:layout_width="0dp" 123 android:layout_height="wrap_content" 124 android:layout_marginEnd="12dp" 125 android:layout_weight="0.125" 126 android:ellipsize="end" 127 android:minWidth="70dp" 128 android:singleLine="true" 129 android:textAlignment="viewEnd" 130 android:textAppearance="@android:style/TextAppearance.Material.Body1" 131 android:textColor="?android:attr/textColorSecondary" /> 132 </LinearLayout> 133 </LinearLayout> 134 135</com.android.documentsui.ListItem> 136