Minor Copy/Paste overlay UI edits

- update background color of text view to match buttons
- add padding to right edge of edit text activity TextView
- add ellipsis when text is cut off in preview

Bug: 223845368
Fix: 223845368
Bug: 223965587
Fix: 223965587
Bug: 223829956
Fix: 223829956
Test: manual (visual changes; tested in light and dark modes)
Change-Id: Ibcb276c34e402687a7954887d0574e60501d178b
This commit is contained in:
Miranda Kephart
2022-03-14 11:49:14 -04:00
parent 4e45ade943
commit 9c6e8f9ced
3 changed files with 11 additions and 2 deletions

View File

@@ -43,10 +43,10 @@
android:layout_height="0dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="@+id/copy_button"
app:layout_constraintEnd_toEndOf="@id/share"
app:layout_constraintTop_toBottomOf="@+id/attribution">
<EditText

View File

@@ -16,6 +16,7 @@
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:alpha="0"
android:layout_width="match_parent"
@@ -118,7 +119,8 @@
android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="10sp"
android:autoSizeMaxTextSize="200sp"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?attr/overlayButtonTextColor"
android:background="?androidprv:attr/colorAccentSecondary"
android:layout_width="@dimen/clipboard_preview_size"
android:layout_height="@dimen/clipboard_preview_size"/>
<ImageView

View File

@@ -190,6 +190,13 @@ public class ClipboardOverlayController {
}
});
mTextPreview.getViewTreeObserver().addOnPreDrawListener(() -> {
int availableHeight = mTextPreview.getHeight()
- (mTextPreview.getPaddingTop() + mTextPreview.getPaddingBottom());
mTextPreview.setMaxLines(availableHeight / mTextPreview.getLineHeight());
return true;
});
mDismissButton.setOnClickListener(view -> animateOut());
mEditChip.setIcon(Icon.createWithResource(mContext, R.drawable.ic_screenshot_edit), true);