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

Commit 41615284 authored by Mark Renouf's avatar Mark Renouf Committed by Android (Google) Code Review
Browse files

Merge "SwipeDismiss: limit fade to 50% alpha while swiping" into klp-modular-dev

parents bf4927ee d0761216
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;