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 <!-- FYI: This layout has an extra top level container view that was previously used 19 to allow for the insertion of debug info. The debug info is now gone, but the 20 container remains because there is a high likelihood of UI regression relating 21 to focus and selection states, some of which are specific to keyboard 22 when touch mode is not enable. So, if you, heroic engineer of the future, 23 decide to rip these out, please be sure to check out focus and keyboards. --> 24 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 25 android:layout_width="match_parent" 26 android:layout_height="wrap_content" 27 android:layout_margin="@dimen/grid_item_margin" 28 android:orientation="vertical" 29 android:background="@drawable/grid_item_background" 30 android:elevation="@dimen/grid_item_elevation" 31 android:focusable="true"> 32 33 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 34 android:layout_width="match_parent" 35 android:layout_height="wrap_content" 36 android:duplicateParentState="true"> 37 38 <!-- The height is 48px. 39 paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) --> 40 <LinearLayout 41 android:layout_width="match_parent" 42 android:layout_height="match_parent" 43 android:orientation="horizontal" 44 android:paddingBottom="9dp" 45 android:paddingLeft="9dp" 46 android:paddingRight="12dp" 47 android:paddingTop="9dp" 48 android:gravity="center_vertical"> 49 50 <FrameLayout 51 android:layout_width="wrap_content" 52 android:layout_height="wrap_content" 53 android:pointerIcon="hand" 54 android:layout_marginEnd="8dp" > 55 56 <ImageView 57 android:id="@+id/icon_mime_sm" 58 android:layout_width="wrap_content" 59 android:layout_height="wrap_content" 60 android:layout_gravity="center" 61 android:contentDescription="@null" 62 android:scaleType="centerInside" 63 android:src="@drawable/ic_doc_folder" /> 64 65 <ImageView 66 android:id="@+id/icon_check" 67 android:layout_width="@dimen/check_icon_size" 68 android:layout_height="@dimen/check_icon_size" 69 android:alpha="0" 70 android:contentDescription="@null" 71 android:scaleType="fitCenter" 72 android:src="@drawable/ic_check_circle" /> 73 74 </FrameLayout> 75 76 <TextView 77 android:id="@android:id/title" 78 android:layout_width="wrap_content" 79 android:layout_height="wrap_content" 80 android:ellipsize="end" 81 android:singleLine="true" 82 android:textAlignment="viewStart" 83 android:textAppearance="@android:style/TextAppearance.Material.Subhead" 84 android:textColor="@color/item_title" /> 85 86 </LinearLayout> 87 88 <!-- An overlay that draws the item border when it is focused. --> 89 90 <View 91 android:layout_width="match_parent" 92 android:layout_height="match_parent" 93 android:background="@drawable/item_doc_grid_border" 94 android:contentDescription="@null" 95 android:duplicateParentState="true" /> 96 97 </FrameLayout> 98 99 </LinearLayout>