Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b321b856 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Make sensitive text/image both look the same

Bug: 232820831
Fix: 232820831
Test: manual (using clipboard test app)
Change-Id: I5d21e507a1763735341a6c7858dc541e81c45f03
parent bd767e19
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -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"
+4 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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 {