1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright (C) 2015 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<com.android.messaging.ui.mediapicker.GalleryGridItemView 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 android:layout_width="match_parent" 20 android:layout_height="@dimen/gallery_image_cell_size" 21 android:background="@color/gallery_image_default_background" 22 android:clickable="true"> 23 24 <!-- Thumbnail for image and video contents. --> 25 <com.android.messaging.ui.AsyncImageView 26 android:id="@+id/thumbnail" 27 android:layout_width="match_parent" 28 android:layout_height="match_parent" 29 android:scaleType="centerCrop" /> 30 31 <!-- Additional info such as icon, name and etc. --> 32 <RelativeLayout 33 android:id="@+id/additional_info" 34 android:layout_width="match_parent" 35 android:layout_height="match_parent" 36 android:layout_gravity="center" 37 android:orientation="vertical" 38 android:visibility="gone" > 39 40 <FrameLayout 41 android:layout_width="match_parent" 42 android:layout_height="match_parent" 43 android:layout_above="@id/file_info" > 44 <ImageView 45 android:id="@+id/icon" 46 android:layout_width="@dimen/gallery_icon_size" 47 android:layout_height="@dimen/gallery_icon_size" 48 android:layout_gravity="center" 49 android:scaleType="fitCenter" 50 android:background="@color/background_item_transparent" 51 android:visibility="gone" /> 52 </FrameLayout> 53 54 <!-- File info for audio contents only --> 55 <LinearLayout 56 android:id="@+id/file_info" 57 android:layout_width="match_parent" 58 android:layout_height="wrap_content" 59 android:layout_alignParentBottom="true" 60 android:layout_marginBottom="4dp" 61 android:paddingLeft="4dp" 62 android:paddingRight="4dp" 63 android:orientation="vertical" 64 android:visibility="gone" > 65 66 <TextView 67 android:id="@+id/file_name" 68 android:layout_width="match_parent" 69 android:layout_height="wrap_content" 70 android:singleLine="true" 71 android:ellipsize="end" 72 android:textAppearance="@android:style/TextAppearance.Material.Subhead" /> 73 74 <TextView 75 android:id="@+id/file_type" 76 android:layout_width="match_parent" 77 android:layout_height="wrap_content" 78 android:singleLine="true" 79 android:ellipsize="end" 80 android:gravity="right" 81 android:textAppearance="@android:style/TextAppearance.Material.Caption" /> 82 </LinearLayout> 83 </RelativeLayout> 84 85 <View 86 android:layout_width="match_parent" 87 android:layout_height="match_parent" 88 android:focusableInTouchMode="true" 89 android:background="@drawable/gallery_image_background_selector" /> 90 91 <CheckBox 92 android:id="@+id/checkbox" 93 style="@style/GalleryGridItemViewCheckBoxStyle" 94 android:button="@drawable/gallery_checkbox_selector" 95 android:background="@null" 96 android:layout_width="wrap_content" 97 android:layout_height="wrap_content" 98 android:layout_gravity="top|end" 99 android:paddingTop="4dp" 100 android:visibility="gone" 101 android:contentDescription="@string/gallery_checkbox_content_description" /> 102 103</com.android.messaging.ui.mediapicker.GalleryGridItemView> 104