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:color/materialColorSurfaceContainer"> 29 30 <androidx.constraintlayout.widget.ConstraintLayout 31 android:layout_width="match_parent" 32 android:layout_height="wrap_content" 33 android:layout_gravity="center" 34 android:layout_marginHorizontal="@dimen/chooser_edge_margin_normal" 35 android:layout_marginBottom="8dp" 36 android:paddingVertical="@dimen/chooser_edge_margin_normal_half" 37 android:paddingStart="@dimen/chooser_edge_margin_normal_half" 38 android:paddingEnd="0dp" 39 android:background="@drawable/chooser_content_preview_rounded" 40 android:id="@+id/text_preview_layout"> 41 42 <com.android.intentresolver.widget.RoundedRectImageView 43 android:id="@androidprv:id/content_preview_thumbnail" 44 android:layout_width="@dimen/width_text_image_preview_size" 45 android:layout_height="@dimen/width_text_image_preview_size" 46 app:layout_constraintStart_toStartOf="parent" 47 app:layout_constraintTop_toTopOf="parent" 48 app:layout_constraintBottom_toBottomOf="parent" 49 android:adjustViewBounds="true" 50 android:gravity="center" 51 app:radius="@dimen/chooser_corner_radius_small" 52 android:scaleType="centerCrop"/> 53 54 <TextView 55 android:id="@androidprv:id/content_preview_title" 56 android:layout_width="0dp" 57 android:layout_height="wrap_content" 58 app:layout_constraintStart_toEndOf="@androidprv:id/content_preview_thumbnail" 59 app:layout_constraintEnd_toStartOf="@id/copy" 60 app:layout_constraintTop_toTopOf="parent" 61 app:layout_constraintBottom_toTopOf="@androidprv:id/content_preview_text" 62 android:layout_marginStart="@dimen/chooser_edge_margin_normal_half" 63 app:layout_goneMarginStart="0dp" 64 app:layout_constraintVertical_chainStyle="packed" 65 android:ellipsize="end" 66 android:maxLines="1" 67 android:textAlignment="gravity" 68 android:textDirection="locale" 69 android:textStyle="bold" 70 android:textColor="@androidprv:color/materialColorOnSurface" 71 android:fontFamily="@androidprv:string/config_headlineFontFamily"/> 72 73 <TextView 74 android:id="@androidprv:id/content_preview_text" 75 android:layout_width="0dp" 76 android:layout_height="wrap_content" 77 app:layout_constraintStart_toEndOf="@androidprv:id/content_preview_thumbnail" 78 app:layout_constraintEnd_toStartOf="@id/copy" 79 app:layout_constraintTop_toBottomOf="@androidprv:id/content_preview_title" 80 app:layout_constraintBottom_toBottomOf="parent" 81 android:layout_marginStart="@dimen/chooser_edge_margin_normal_half" 82 app:layout_goneMarginStart="0dp" 83 android:ellipsize="end" 84 android:fontFamily="@androidprv:string/config_headlineFontFamily" 85 android:textColor="@androidprv:color/materialColorOnSurfaceVariant" 86 android:textAlignment="gravity" 87 android:textDirection="locale" 88 android:maxLines="@integer/text_preview_lines" 89 android:focusable="true"/> 90 91 <FrameLayout 92 android:id="@+id/copy" 93 android:layout_width="48dp" 94 android:layout_height="48dp" 95 style="?android:attr/borderlessButtonStyle" 96 app:layout_constraintStart_toEndOf="@androidprv:id/content_preview_text" 97 app:layout_constraintEnd_toEndOf="parent" 98 app:layout_constraintHorizontal_bias="1" 99 app:layout_constraintTop_toTopOf="parent" 100 app:layout_constraintBottom_toBottomOf="parent" 101 android:layout_marginHorizontal="4dp" 102 android:contentDescription="@android:string/copy" 103 > 104 <ImageView 105 android:layout_width="wrap_content" 106 android:layout_height="wrap_content" 107 android:layout_gravity="center" 108 android:tint="@androidprv:color/materialColorOnSurfaceVariant" 109 android:src="@androidprv:drawable/ic_menu_copy_material" 110 /> 111 </FrameLayout> 112 </androidx.constraintlayout.widget.ConstraintLayout> 113 114 <include layout="@layout/chooser_action_row" /> 115 116</LinearLayout> 117