1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2021 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.systemui.clipboardoverlay.ClipboardOverlayView 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" 20 xmlns:app="http://schemas.android.com/apk/res-auto" 21 android:id="@+id/clipboard_ui" 22 android:theme="@style/FloatingOverlay" 23 android:alpha="0" 24 android:layout_width="match_parent" 25 android:layout_height="match_parent" 26 android:contentDescription="@string/clipboard_overlay_window_name"> 27 <ImageView 28 android:id="@+id/actions_container_background" 29 android:visibility="gone" 30 android:layout_height="0dp" 31 android:layout_width="0dp" 32 android:elevation="4dp" 33 android:background="@drawable/action_chip_container_background" 34 android:layout_marginStart="@dimen/overlay_action_container_margin_horizontal" 35 android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom" 36 app:layout_constraintStart_toStartOf="parent" 37 app:layout_constraintTop_toTopOf="@+id/actions_container" 38 app:layout_constraintEnd_toEndOf="@+id/actions_container" 39 app:layout_constraintBottom_toBottomOf="parent"/> 40 <HorizontalScrollView 41 android:id="@+id/actions_container" 42 android:layout_width="0dp" 43 android:layout_height="wrap_content" 44 android:layout_marginEnd="@dimen/overlay_action_container_margin_horizontal" 45 android:paddingEnd="@dimen/overlay_action_container_padding_end" 46 android:paddingVertical="@dimen/overlay_action_container_padding_vertical" 47 android:elevation="4dp" 48 android:scrollbars="none" 49 app:layout_constraintHorizontal_bias="0" 50 app:layout_constraintWidth_percent="1.0" 51 app:layout_constraintWidth_max="wrap" 52 app:layout_constraintStart_toEndOf="@+id/preview_border" 53 app:layout_constraintEnd_toEndOf="parent" 54 app:layout_constraintBottom_toBottomOf="@id/actions_container_background"> 55 <LinearLayout 56 android:id="@+id/actions" 57 android:layout_width="wrap_content" 58 android:layout_height="wrap_content" 59 android:animateLayoutChanges="true"> 60 <include layout="@layout/overlay_action_chip" 61 android:id="@+id/share_chip"/> 62 <include layout="@layout/overlay_action_chip" 63 android:id="@+id/remote_copy_chip"/> 64 </LinearLayout> 65 </HorizontalScrollView> 66 <View 67 android:id="@+id/preview_border" 68 android:layout_width="0dp" 69 android:layout_height="0dp" 70 android:layout_marginStart="@dimen/overlay_preview_container_margin" 71 android:layout_marginTop="@dimen/overlay_border_width_neg" 72 android:layout_marginEnd="@dimen/overlay_border_width_neg" 73 android:layout_marginBottom="@dimen/overlay_preview_container_margin" 74 android:elevation="7dp" 75 android:background="@drawable/overlay_border" 76 app:layout_constraintStart_toStartOf="@id/actions_container_background" 77 app:layout_constraintTop_toTopOf="@id/clipboard_preview" 78 app:layout_constraintEnd_toEndOf="@id/clipboard_preview" 79 app:layout_constraintBottom_toBottomOf="@id/actions_container_background"/> 80 <FrameLayout 81 android:id="@+id/clipboard_preview" 82 android:layout_width="@dimen/clipboard_preview_size" 83 android:layout_height="wrap_content" 84 android:layout_marginStart="@dimen/overlay_border_width" 85 android:layout_marginBottom="@dimen/overlay_border_width" 86 android:layout_gravity="center" 87 android:elevation="7dp" 88 android:background="@drawable/overlay_preview_background" 89 android:clipChildren="true" 90 android:clipToOutline="true" 91 android:clipToPadding="true" 92 app:layout_constraintStart_toStartOf="@id/preview_border" 93 app:layout_constraintBottom_toBottomOf="@id/preview_border"> 94 <TextView android:id="@+id/text_preview" 95 android:textFontWeight="500" 96 android:padding="8dp" 97 android:gravity="center|start" 98 android:ellipsize="end" 99 android:autoSizeTextType="uniform" 100 android:autoSizeMinTextSize="@dimen/clipboard_overlay_min_font" 101 android:autoSizeMaxTextSize="@dimen/clipboard_overlay_max_font" 102 android:textColor="?attr/overlayButtonTextColor" 103 android:textColorLink="?attr/overlayButtonTextColor" 104 android:background="?androidprv:attr/colorAccentSecondary" 105 android:layout_width="@dimen/clipboard_preview_size" 106 android:layout_height="@dimen/clipboard_preview_size"/> 107 <ImageView 108 android:id="@+id/image_preview" 109 android:scaleType="fitCenter" 110 android:adjustViewBounds="true" 111 android:contentDescription="@string/clipboard_image_preview" 112 android:layout_width="match_parent" 113 android:layout_height="wrap_content"/> 114 <TextView 115 android:id="@+id/hidden_preview" 116 android:visibility="gone" 117 android:textFontWeight="500" 118 android:padding="8dp" 119 android:gravity="center" 120 android:textSize="14sp" 121 android:textColor="?attr/overlayButtonTextColor" 122 android:background="?androidprv:attr/colorAccentSecondary" 123 android:layout_width="@dimen/clipboard_preview_size" 124 android:layout_height="@dimen/clipboard_preview_size"/> 125 </FrameLayout> 126 <LinearLayout 127 android:id="@+id/minimized_preview" 128 android:layout_width="wrap_content" 129 android:layout_height="wrap_content" 130 android:visibility="gone" 131 android:elevation="7dp" 132 android:padding="8dp" 133 app:layout_constraintBottom_toBottomOf="parent" 134 app:layout_constraintStart_toStartOf="parent" 135 android:layout_marginStart="@dimen/overlay_action_container_margin_horizontal" 136 android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom" 137 android:background="@drawable/clipboard_minimized_background"> 138 <ImageView 139 android:src="@drawable/ic_content_paste" 140 android:tint="?attr/overlayButtonTextColor" 141 android:layout_width="24dp" 142 android:layout_height="24dp"/> 143 <ImageView 144 android:src="@*android:drawable/ic_chevron_end" 145 android:tint="?attr/overlayButtonTextColor" 146 android:layout_width="24dp" 147 android:layout_height="24dp" 148 android:paddingEnd="-8dp" 149 android:paddingStart="-4dp"/> 150 </LinearLayout> 151 <androidx.constraintlayout.widget.Barrier 152 android:id="@+id/clipboard_content_top" 153 android:layout_width="wrap_content" 154 android:layout_height="wrap_content" 155 android:orientation="horizontal" 156 app:barrierDirection="top" 157 app:constraint_referenced_ids="clipboard_preview,minimized_preview"/> 158 <androidx.constraintlayout.widget.Barrier 159 android:id="@+id/clipboard_content_end" 160 android:layout_width="wrap_content" 161 android:layout_height="wrap_content" 162 android:orientation="vertical" 163 app:barrierDirection="end" 164 app:constraint_referenced_ids="clipboard_preview,minimized_preview"/> 165 <FrameLayout 166 android:id="@+id/dismiss_button" 167 android:layout_width="@dimen/overlay_dismiss_button_tappable_size" 168 android:layout_height="@dimen/overlay_dismiss_button_tappable_size" 169 android:elevation="10dp" 170 android:visibility="gone" 171 android:alpha="0" 172 app:layout_constraintStart_toEndOf="@id/clipboard_content_end" 173 app:layout_constraintEnd_toEndOf="@id/clipboard_content_end" 174 app:layout_constraintTop_toTopOf="@id/clipboard_content_top" 175 app:layout_constraintBottom_toTopOf="@id/clipboard_content_top" 176 android:contentDescription="@string/clipboard_dismiss_description"> 177 <ImageView 178 android:id="@+id/dismiss_image" 179 android:layout_width="match_parent" 180 android:layout_height="match_parent" 181 android:layout_margin="@dimen/overlay_dismiss_button_margin" 182 android:src="@drawable/overlay_cancel"/> 183 </FrameLayout> 184</com.android.systemui.clipboardoverlay.ClipboardOverlayView>