1<?xml version="1.0" encoding="utf-8"?> 2<!-- Copyright (C) 2017 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16 17<android.support.v7.widget.CardView 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:id="@+id/suggestion_card" 21 android:layout_width="match_parent" 22 android:layout_height="wrap_content" 23 android:layout_marginStart="16dp" 24 android:layout_marginEnd="16dp" 25 app:cardPreventCornerOverlap="false" 26 app:cardUseCompatPadding="true" 27 app:cardElevation="2dp" 28 app:cardCornerRadius="@dimen/suggestion_card_corner_radius"> 29 30 <LinearLayout 31 android:layout_width="match_parent" 32 android:layout_height="wrap_content" 33 android:minHeight="160dp" 34 android:orientation="vertical"> 35 36 <RelativeLayout 37 android:layout_width="match_parent" 38 android:layout_height="wrap_content" 39 android:orientation="horizontal"> 40 41 <ImageView 42 android:id="@android:id/icon" 43 android:layout_width="@dimen/suggestion_card_icon_size" 44 android:layout_height="@dimen/suggestion_card_icon_size" 45 style="@style/SuggestionCardIcon" 46 android:layout_marginTop="16dp" 47 android:layout_marginBottom="6dp" /> 48 49 <FrameLayout 50 android:id="@+id/close_button" 51 android:layout_width="48dp" 52 android:layout_height="48dp" 53 android:layout_alignParentEnd="true" 54 android:paddingTop="8dp" 55 android:paddingEnd="8dp" 56 android:orientation="horizontal" 57 android:contentDescription="@string/dlg_close"> 58 <ImageView 59 android:layout_width="18dp" 60 android:layout_height="18dp" 61 android:layout_gravity="end|top" 62 android:alpha="0.54" 63 android:src="@drawable/ic_suggestion_close_button"/> 64 </FrameLayout> 65 66 </RelativeLayout> 67 68 <TextView 69 android:id="@android:id/title" 70 android:layout_width="match_parent" 71 android:layout_height="wrap_content" 72 style="@style/SuggestionCardText" 73 android:layout_marginStart="12dp" 74 android:layout_marginEnd="12dp" 75 android:singleLine="true" 76 android:textAppearance="@style/TextAppearance.SuggestionTitle" 77 android:fadingEdge="horizontal" /> 78 79 <TextView 80 android:id="@android:id/summary" 81 android:layout_width="match_parent" 82 android:layout_height="wrap_content" 83 style="@style/SuggestionCardText" 84 android:layout_marginStart="12dp" 85 android:layout_marginEnd="12dp" 86 android:singleLine="true" 87 android:textAppearance="@style/TextAppearance.SuggestionSummary" /> 88 89 <FrameLayout 90 android:layout_width="wrap_content" 91 android:layout_height="wrap_content" 92 style="@style/SuggestionCardButton"> 93 <Button 94 android:id="@android:id/primary" 95 style="@style/ActionPrimaryButton" 96 android:layout_gravity="center" 97 android:layout_width="wrap_content" 98 android:layout_height="wrap_content" 99 android:text="@string/suggestion_button_text" /> 100 </FrameLayout> 101 102 </LinearLayout> 103 104</android.support.v7.widget.CardView> 105