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

Commit 4e0880e3 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Synchronize album fade away with Keyguard dismissal

Change-Id: I7aaa6213f6070f0db14131a248a62b317309a3bf
parent c3d5ead8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
    android:fitsSystemWindows="true"
    android:descendantFocusability="afterDescendants">

    <FrameLayout
    <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
            android:id="@+id/backdrop"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
@@ -41,7 +41,7 @@
                   android:layout_height="match_parent"
                   android:scaleType="centerCrop"
                   android:visibility="invisible" />
    </FrameLayout>
    </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>

    <View android:id="@+id/scrim_behind"
        android:layout_width="match_parent"
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ public class KeyguardBouncer {
                    .withLayer()

                    // Make it disappear faster, as the focus should be on the activity behind.
                    .setDuration(duration / 3)
                    .setDuration(duration / 2)
                    .setInterpolator(mFadeOutInterpolator)
                    .setStartDelay(delay)
                    .withEndAction(new Runnable() {
+28 −11
Original line number Diff line number Diff line
@@ -93,11 +93,13 @@ import android.view.ViewPropertyAnimator;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.PathInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -401,6 +403,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    private boolean mDozing;

    private Interpolator mLinearOutSlowIn;
    private Interpolator mLinearInterpolator = new LinearInterpolator();
    private Interpolator mBackdropInterpolator = new AccelerateDecelerateInterpolator();
    private Interpolator mAlphaIn = new PathInterpolator(0f, 0.2f, 1f, 1f);
    private Interpolator mAlphaOut = new PathInterpolator(0f, 0f, 0.8f, 1f);

@@ -1701,7 +1705,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                                + " to "
                                + mBackdropBack.getDrawable());
                    }
                    mBackdropFront.animate().withLayer()
                    mBackdropFront.animate()
                            .setDuration(250)
                            .alpha(0f).withEndAction(mHideBackdropFront);
                }
@@ -1713,8 +1717,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                if (DEBUG_MEDIA) {
                    Log.v(TAG, "DEBUG_MEDIA: Fading out album artwork");
                }
                mBackdrop.animate().withLayer()
                        .alpha(0f).withEndAction(new Runnable() {
                mBackdrop.animate()
                        .alpha(0f)
                        .setInterpolator(mBackdropInterpolator)
                        .setDuration(300)
                        .setStartDelay(0)
                        .withEndAction(new Runnable() {
                            @Override
                            public void run() {
                                mBackdrop.setVisibility(View.GONE);
@@ -1723,6 +1731,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                                mHandler.post(mHideBackdropFront);
                            }
                        });
                if (mKeyguardFadingAway) {
                    mBackdrop.animate()

                            // Make it disappear faster, as the focus should be on the activity behind.
                            .setDuration(mKeyguardFadingAwayDuration / 2)
                            .setStartDelay(mKeyguardFadingAwayDelay)
                            .setInterpolator(mLinearInterpolator)
                            .start();
                }
            }
        }
    }