1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3/* 4* Copyright 2019, The Android Open Source Project 5* 6* Licensed under the Apache License, Version 2.0 (the "License"); 7* you may not use this file except in compliance with the License. 8* You may obtain a copy of the License at 9* 10* http://www.apache.org/licenses/LICENSE-2.0 11* 12* Unless required by applicable law or agreed to in writing, software 13* distributed under the License is distributed on an "AS IS" BASIS, 14* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15* See the License for the specific language governing permissions and 16* limitations under the License. 17*/ 18--> 19<!-- Layout Option: Text preview, with optional title and thumbnail --> 20<LinearLayout 21 xmlns:android="http://schemas.android.com/apk/res/android" 22 xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" 23 xmlns:app="http://schemas.android.com/apk/res-auto" 24 android:id="@androidprv:id/content_preview_text_area" 25 android:layout_width="match_parent" 26 android:layout_height="wrap_content" 27 android:orientation="vertical" 28 android:background="?androidprv:attr/materialColorSurfaceContainer"> 29 30 <include layout="@layout/chooser_headline_row" /> 31 32 <androidx.constraintlayout.widget.ConstraintLayout 33 android:layout_width="match_parent" 34 android:layout_height="wrap_content" 35 android:layout_gravity="center" 36 android:layout_marginHorizontal="@dimen/chooser_edge_margin_normal" 37 android:layout_marginBottom="8dp" 38 android:paddingVertical="@dimen/chooser_edge_margin_normal_half" 39 android:paddingStart="@dimen/chooser_edge_margin_normal_half" 40 android:paddingEnd="0dp" 41 android:background="@drawable/chooser_content_preview_rounded" 42 android:id="@+id/text_preview_layout"> 43 44 <com.android.intentresolver.widget.RoundedRectImageView 45 android:id="@androidprv:id/content_preview_thumbnail" 46 android:layout_width="@dimen/width_text_image_preview_size" 47 android:layout_height="@dimen/width_text_image_preview_size" 48 app:layout_constraintStart_toStartOf="parent" 49 app:layout_constraintTop_toTopOf="parent" 50 app:layout_constraintBottom_toBottomOf="parent" 51 android:adjustViewBounds="true" 52 android:gravity="center" 53 app:radius="@dimen/chooser_corner_radius_small" 54 android:scaleType="centerCrop"/> 55 56 <TextView 57 android:id="@androidprv:id/content_preview_title" 58 android:layout_width="0dp" 59 android:layout_height="wrap_content" 60 app:layout_constraintStart_toEndOf="@androidprv:id/content_preview_thumbnail" 61 app:layout_constraintEnd_toStartOf="@id/copy" 62 app:layout_constraintTop_toTopOf="parent" 63 app:layout_constraintBottom_toTopOf="@androidprv:id/content_preview_text" 64 android:layout_marginStart="@dimen/chooser_edge_margin_normal_half" 65 app:layout_goneMarginStart="0dp" 66 app:layout_constraintVertical_chainStyle="packed" 67 android:ellipsize="end" 68 android:maxLines="1" 69 android:textAlignment="gravity" 70 android:textDirection="locale" 71 android:textStyle="bold" 72 android:textColor="?androidprv:attr/materialColorOnSurface" 73 android:fontFamily="@androidprv:string/config_headlineFontFamily"/> 74 75 <TextView 76 android:id="@androidprv:id/content_preview_text" 77 android:layout_width="0dp" 78 android:layout_height="wrap_content" 79 app:layout_constraintStart_toEndOf="@androidprv:id/content_preview_thumbnail" 80 app:layout_constraintEnd_toStartOf="@id/copy" 81 app:layout_constraintTop_toBottomOf="@androidprv:id/content_preview_title" 82 app:layout_constraintBottom_toBottomOf="parent" 83 android:layout_marginStart="@dimen/chooser_edge_margin_normal_half" 84 app:layout_goneMarginStart="0dp" 85 android:ellipsize="end" 86 android:fontFamily="@androidprv:string/config_headlineFontFamily" 87 android:textColor="?androidprv:attr/materialColorOnSurfaceVariant" 88 android:textAlignment="gravity" 89 android:textDirection="locale" 90 android:maxLines="@integer/text_preview_lines" 91 android:focusable="true"/> 92 93 <FrameLayout 94 android:id="@+id/copy" 95 android:layout_width="48dp" 96 android:layout_height="48dp" 97 style="?android:attr/borderlessButtonStyle" 98 app:layout_constraintStart_toEndOf="@androidprv:id/content_preview_text" 99 app:layout_constraintEnd_toEndOf="parent" 100 app:layout_constraintHorizontal_bias="1" 101 app:layout_constraintTop_toTopOf="parent" 102 app:layout_constraintBottom_toBottomOf="parent" 103 android:layout_marginHorizontal="4dp" 104 android:contentDescription="@android:string/copy" 105 > 106 <ImageView 107 android:layout_width="wrap_content" 108 android:layout_height="wrap_content" 109 android:layout_gravity="center" 110 android:tint="?androidprv:attr/materialColorOnSurfaceVariant" 111 android:src="@androidprv:drawable/ic_menu_copy_material" 112 /> 113 </FrameLayout> 114 </androidx.constraintlayout.widget.ConstraintLayout> 115 116 <include layout="@layout/chooser_action_row" /> 117 118</LinearLayout> 119 120