Merge "Make sensitive text/image both look the same" into tm-dev

This commit is contained in:
Miranda Kephart
2022-05-18 15:05:06 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 17 deletions

View File

@@ -135,18 +135,6 @@
android:background="?androidprv:attr/colorAccentSecondary" android:background="?androidprv:attr/colorAccentSecondary"
android:layout_width="@dimen/clipboard_preview_size" android:layout_width="@dimen/clipboard_preview_size"
android:layout_height="@dimen/clipboard_preview_size"/> android:layout_height="@dimen/clipboard_preview_size"/>
<TextView
android:id="@+id/hidden_image_preview"
android:visibility="gone"
android:textFontWeight="500"
android:padding="8dp"
android:gravity="center"
android:textSize="14sp"
android:text="@string/clipboard_text_hidden"
android:textColor="#ffffff"
android:background="#000000"
android:layout_width="@dimen/clipboard_preview_size"
android:layout_height="@dimen/clipboard_preview_size"/>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/dismiss_button" android:id="@+id/dismiss_button"

View File

@@ -139,7 +139,6 @@ public class ClipboardOverlayController {
private final ImageView mImagePreview; private final ImageView mImagePreview;
private final TextView mTextPreview; private final TextView mTextPreview;
private final TextView mHiddenTextPreview; private final TextView mHiddenTextPreview;
private final TextView mHiddenImagePreview;
private final View mPreviewBorder; private final View mPreviewBorder;
private final OverlayActionChip mEditChip; private final OverlayActionChip mEditChip;
private final OverlayActionChip mShareChip; private final OverlayActionChip mShareChip;
@@ -190,6 +189,7 @@ public class ClipboardOverlayController {
// Setup the window that we are going to use // Setup the window that we are going to use
mWindowLayoutParams = FloatingWindowUtil.getFloatingWindowParams(); mWindowLayoutParams = FloatingWindowUtil.getFloatingWindowParams();
mWindowLayoutParams.setTitle("ClipboardOverlay"); mWindowLayoutParams.setTitle("ClipboardOverlay");
mWindow = FloatingWindowUtil.getFloatingWindow(mContext); mWindow = FloatingWindowUtil.getFloatingWindow(mContext);
mWindow.setWindowManager(mWindowManager, null, null); mWindow.setWindowManager(mWindowManager, null, null);
@@ -204,7 +204,6 @@ public class ClipboardOverlayController {
mImagePreview = requireNonNull(mView.findViewById(R.id.image_preview)); mImagePreview = requireNonNull(mView.findViewById(R.id.image_preview));
mTextPreview = requireNonNull(mView.findViewById(R.id.text_preview)); mTextPreview = requireNonNull(mView.findViewById(R.id.text_preview));
mHiddenTextPreview = requireNonNull(mView.findViewById(R.id.hidden_text_preview)); mHiddenTextPreview = requireNonNull(mView.findViewById(R.id.hidden_text_preview));
mHiddenImagePreview = requireNonNull(mView.findViewById(R.id.hidden_image_preview));
mPreviewBorder = requireNonNull(mView.findViewById(R.id.preview_border)); mPreviewBorder = requireNonNull(mView.findViewById(R.id.preview_border));
mEditChip = requireNonNull(mView.findViewById(R.id.edit_chip)); mEditChip = requireNonNull(mView.findViewById(R.id.edit_chip));
mShareChip = requireNonNull(mView.findViewById(R.id.share_chip)); mShareChip = requireNonNull(mView.findViewById(R.id.share_chip));
@@ -502,7 +501,6 @@ public class ClipboardOverlayController {
mTextPreview.setVisibility(View.GONE); mTextPreview.setVisibility(View.GONE);
mImagePreview.setVisibility(View.GONE); mImagePreview.setVisibility(View.GONE);
mHiddenTextPreview.setVisibility(View.GONE); mHiddenTextPreview.setVisibility(View.GONE);
mHiddenImagePreview.setVisibility(View.GONE);
v.setVisibility(View.VISIBLE); v.setVisibility(View.VISIBLE);
} }
@@ -534,9 +532,9 @@ public class ClipboardOverlayController {
String mimeType = resolver.getType(uri); String mimeType = resolver.getType(uri);
boolean isEditableImage = mimeType != null && mimeType.startsWith("image"); boolean isEditableImage = mimeType != null && mimeType.startsWith("image");
if (isSensitive) { if (isSensitive) {
showSinglePreview(mHiddenImagePreview); showSinglePreview(mHiddenTextPreview);
if (isEditableImage) { if (isEditableImage) {
mHiddenImagePreview.setOnClickListener(listener); mHiddenTextPreview.setOnClickListener(listener);
} }
} else if (isEditableImage) { // if the MIMEtype is image, try to load } else if (isEditableImage) { // if the MIMEtype is image, try to load
try { try {