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 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 19 android:layout_width="match_parent" 20 android:layout_height="wrap_content" 21 android:layout_margin="@dimen/grid_item_margin" 22 android:background="@color/item_doc_background" 23 android:elevation="@dimen/grid_item_elevation" 24 android:focusable="true" > 25 26 <!-- The height is 48px. 27 paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) --> 28 <LinearLayout 29 android:layout_width="match_parent" 30 android:layout_height="match_parent" 31 android:orientation="horizontal" 32 android:paddingBottom="9dp" 33 android:paddingLeft="9dp" 34 android:paddingRight="12dp" 35 android:paddingTop="9dp" 36 android:gravity="center_vertical"> 37 38 <FrameLayout 39 android:layout_width="wrap_content" 40 android:layout_height="wrap_content" 41 android:layout_marginEnd="8dp" > 42 43 <ImageView 44 android:id="@+id/icon_mime_sm" 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 android:src="@drawable/ic_doc_folder" /> 51 52 <ImageView 53 android:id="@+id/icon_check" 54 android:layout_width="@dimen/check_icon_size" 55 android:layout_height="@dimen/check_icon_size" 56 android:alpha="0" 57 android:contentDescription="@null" 58 android:scaleType="fitCenter" 59 android:src="@drawable/ic_check_circle" /> 60 61 </FrameLayout> 62 63 <TextView 64 android:id="@android:id/title" 65 android:layout_width="wrap_content" 66 android:layout_height="wrap_content" 67 android:ellipsize="end" 68 android:singleLine="true" 69 android:textAlignment="viewStart" 70 android:textAppearance="@android:style/TextAppearance.Material.Subhead" 71 android:textColor="@color/item_title" /> 72 73 </LinearLayout> 74 75 <!-- An overlay that draws the item border when it is focused. --> 76 77 <View 78 android:layout_width="match_parent" 79 android:layout_height="match_parent" 80 android:background="@drawable/item_doc_grid_border" 81 android:contentDescription="@null" 82 android:duplicateParentState="true" /> 83 84 </FrameLayout> 85