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

Commit 2ba829db authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Fix clipboard overlay in dark mode and RTL

Uses the correct themed colors in dark mode (including clipboard
text preview) and dismisses to the right when in RTL

Bug: 195554988
Test: manual
Change-Id: I221089d142c35ba74f8ecd9299f9162abe8a0cee
parent 163aacdc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
        android:gravity="center">
        <ImageView
            android:id="@+id/overlay_action_chip_icon"
            android:tint="?android:attr/textColorPrimary"
            android:tint="?attr/overlayButtonTextColor"
            android:layout_width="@dimen/overlay_action_chip_icon_size"
            android:layout_height="@dimen/overlay_action_chip_icon_size"/>
        <TextView
@@ -41,6 +41,6 @@
            android:layout_height="wrap_content"
            android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
            android:textSize="@dimen/overlay_action_chip_text_size"
            android:textColor="?android:attr/textColorPrimary"/>
            android:textColor="?attr/overlayButtonTextColor"/>
    </LinearLayout>
</com.android.systemui.screenshot.OverlayActionChip>
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
    </style>

    <style name="FloatingOverlay" parent="@android:style/Theme.DeviceDefault.DayNight">
        <item name="android:textColorPrimary">?android:attr/textColorPrimaryInverse</item>
        <item name="overlayButtonTextColor">?android:attr/textColorPrimaryInverse</item>
    </style>

    <style name="Theme.PeopleTileConfigActivity" parent="@style/Theme.SystemUI">
+2 −0
Original line number Diff line number Diff line
@@ -204,5 +204,7 @@
        <attr name="singleLineVerticalPadding" format="dimension" />
        <attr name="textViewId" format="reference" />
    </declare-styleable>

    <attr name="overlayButtonTextColor" format="color" />
</resources>
+3 −1
Original line number Diff line number Diff line
@@ -664,7 +664,9 @@
        <item name="android:windowActivityTransitions">true</item>
    </style>

    <style name="FloatingOverlay" parent="@android:style/Theme.DeviceDefault.DayNight"/>
    <style name="FloatingOverlay" parent="@android:style/Theme.DeviceDefault.DayNight">
        <item name="overlayButtonTextColor">?android:attr/textColorPrimary</item>
    </style>

    <!-- Clipboard overlay's edit text activity. -->
    <style name="EditTextActivity" parent="@android:style/Theme.DeviceDefault.DayNight">
+1 −23
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ public class ClipboardOverlayController {
    }

    private void animateOut() {
        getExitAnimation().start();
        mView.dismiss();
    }

    private ValueAnimator getEnterAnimation() {
@@ -401,28 +401,6 @@ public class ClipboardOverlayController {
        return anim;
    }

    private ValueAnimator getExitAnimation() {
        ValueAnimator anim = ValueAnimator.ofFloat(0, 1);

        anim.addUpdateListener(animation -> {
            mView.setAlpha(1 - animation.getAnimatedFraction());
            final View actionBackground = requireNonNull(
                    mView.findViewById(R.id.actions_container_background));
            mView.setTranslationX(
                    -animation.getAnimatedFraction() * actionBackground.getWidth() / 2);
        });

        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                hideImmediate();
            }
        });

        return anim;
    }

    private void hideImmediate() {
        // Note this may be called multiple times if multiple dismissal events happen at the same
        // time.
Loading