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

Commit b0ea4846 authored by Mindy Pereira's avatar Mindy Pereira
Browse files

Update window alpha at the same time as translating

Note: algorithm for alpha per progress may be updated
This is a first pass proof of concept

Change-Id: Ia043200ea737ff9d132e350449e17ba0fde10d65
parent b279f527
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3449,6 +3449,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                            SwipeDismissLayout layout, float progress, float translate) {
                        WindowManager.LayoutParams newParams = getAttributes();
                        newParams.x = (int) translate;
                        newParams.alpha = 1 - progress;
                        setAttributes(newParams);

                        int flags = 0;
@@ -3464,6 +3465,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                    public void onSwipeCancelled(SwipeDismissLayout layout) {
                        WindowManager.LayoutParams newParams = getAttributes();
                        newParams.x = 0;
                        newParams.alpha = 1;
                        setAttributes(newParams);
                        setFlags(FLAG_FULLSCREEN, FLAG_FULLSCREEN | FLAG_LAYOUT_NO_LIMITS);
                    }