Make sensitive text/image both look the same

Bug: 232820831
Fix: 232820831
Test: manual (using clipboard test app)
Change-Id: I5d21e507a1763735341a6c7858dc541e81c45f03
This commit is contained in:
Miranda Kephart
2022-05-17 12:05:52 -04:00
parent bd767e19e7
commit b321b8565b
2 changed files with 4 additions and 18 deletions

View File

@@ -133,18 +133,6 @@
android:background="?androidprv:attr/colorAccentSecondary"
android:layout_width="@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
android:id="@+id/dismiss_button"

View File

@@ -135,7 +135,6 @@ public class ClipboardOverlayController {
private final ImageView mImagePreview;
private final TextView mTextPreview;
private final TextView mHiddenTextPreview;
private final TextView mHiddenImagePreview;
private final View mPreviewBorder;
private final OverlayActionChip mEditChip;
private final OverlayActionChip mRemoteCopyChip;
@@ -157,7 +156,7 @@ public class ClipboardOverlayController {
/** Tracks config changes that require updating insets */
private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges(
ActivityInfo.CONFIG_KEYBOARD_HIDDEN);
ActivityInfo.CONFIG_KEYBOARD_HIDDEN);
public ClipboardOverlayController(Context context,
BroadcastDispatcher broadcastDispatcher,
@@ -185,6 +184,7 @@ public class ClipboardOverlayController {
// Setup the window that we are going to use
mWindowLayoutParams = FloatingWindowUtil.getFloatingWindowParams();
mWindowLayoutParams.setTitle("ClipboardOverlay");
mWindow = FloatingWindowUtil.getFloatingWindow(mContext);
mWindow.setWindowManager(mWindowManager, null, null);
@@ -199,7 +199,6 @@ public class ClipboardOverlayController {
mImagePreview = requireNonNull(mView.findViewById(R.id.image_preview));
mTextPreview = requireNonNull(mView.findViewById(R.id.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));
mEditChip = requireNonNull(mView.findViewById(R.id.edit_chip));
mRemoteCopyChip = requireNonNull(mView.findViewById(R.id.remote_copy_chip));
@@ -465,7 +464,6 @@ public class ClipboardOverlayController {
mTextPreview.setVisibility(View.GONE);
mImagePreview.setVisibility(View.GONE);
mHiddenTextPreview.setVisibility(View.GONE);
mHiddenImagePreview.setVisibility(View.GONE);
v.setVisibility(View.VISIBLE);
}
@@ -494,9 +492,9 @@ public class ClipboardOverlayController {
String mimeType = resolver.getType(uri);
boolean isEditableImage = mimeType != null && mimeType.startsWith("image");
if (isSensitive) {
showSinglePreview(mHiddenImagePreview);
showSinglePreview(mHiddenTextPreview);
if (isEditableImage) {
mHiddenImagePreview.setOnClickListener(listener);
mHiddenTextPreview.setOnClickListener(listener);
}
} else if (isEditableImage) { // if the MIMEtype is image, try to load
try {