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

Commit d0761216 authored by Mark Renouf's avatar Mark Renouf
Browse files

SwipeDismiss: limit fade to 50% alpha while swiping

BUG: 14319825

Change-Id: I3704fab77f2d3660ae374bdf16c767c124dcb8e9
parent 92bc0753
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3442,14 +3442,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        });
        swipeDismiss.setOnSwipeProgressChangedListener(
                new SwipeDismissLayout.OnSwipeProgressChangedListener() {
                    private static final float ALPHA_DECREASE = 0.5f;
                    private boolean mIsTranslucent = false;

                    @Override
                    public void onSwipeProgressChanged(
                            SwipeDismissLayout layout, float progress, float translate) {
                        WindowManager.LayoutParams newParams = getAttributes();
                        newParams.x = (int) translate;
                        newParams.alpha = 1 - progress;
                        newParams.alpha = 1 - (progress * ALPHA_DECREASE);
                        setAttributes(newParams);

                        int flags = 0;