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