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

Commit e1bbaa68 authored by Matt Pietal's avatar Matt Pietal Committed by Automerger Merge Worker
Browse files

Merge "Transitions - Fix scrim flash as bouncer goes away" into tm-qpr-dev am:...

Merge "Transitions - Fix scrim flash as bouncer goes away" into tm-qpr-dev am: fbcfaf0d am: d5b2c7bc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21847918



Change-Id: Id3e59e5423a562b723dd8cd75f35184e70aae188
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f538befc d5b2c7bc
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import static java.lang.Integer.max;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.Activity;
@@ -1067,10 +1068,14 @@ public class KeyguardSecurityContainer extends ConstraintLayout {

            int yTranslation = mResources.getDimensionPixelSize(R.dimen.disappear_y_translation);

            AnimatorSet anims = new AnimatorSet();
            ObjectAnimator yAnim = ObjectAnimator.ofFloat(mView, View.TRANSLATION_Y, yTranslation);
            yAnim.setInterpolator(Interpolators.STANDARD_ACCELERATE);
            yAnim.setDuration(500);
            yAnim.start();
            ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mUserSwitcherViewGroup, View.ALPHA,
                    0f);

            anims.setInterpolator(Interpolators.STANDARD_ACCELERATE);
            anims.playTogether(alphaAnim, yAnim);
            anims.start();
        }

        private void setupUserSwitcher() {
+10 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
    private View.OnKeyListener mOnKeyListener = (v, keyCode, event) -> interceptMediaKey(event);
    private ActivityStarter.OnDismissAction mDismissAction;
    private Runnable mCancelAction;
    private boolean mWillRunDismissFromKeyguard;

    private int mLastOrientation = Configuration.ORIENTATION_UNDEFINED;

@@ -262,8 +263,10 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            // If there's a pending runnable because the user interacted with a widget
            // and we're leaving keyguard, then run it.
            boolean deferKeyguardDone = false;
            mWillRunDismissFromKeyguard = false;
            if (mDismissAction != null) {
                deferKeyguardDone = mDismissAction.onDismiss();
                mWillRunDismissFromKeyguard = mDismissAction.willRunAnimationOnKeyguard();
                mDismissAction = null;
                mCancelAction = null;
            }
@@ -526,6 +529,13 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
        return mDismissAction != null || mCancelAction != null;
    }

    /**
     * @return will the dismissal run from the keyguard layout (instead of from bouncer)
     */
    public boolean willRunDismissFromKeyguard() {
        return mWillRunDismissFromKeyguard;
    }

    /**
     * Remove any dismiss action or cancel action that was set.
     */
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ interface BouncerViewDelegate {
        cancelAction: Runnable?,
    )
    fun willDismissWithActions(): Boolean
    fun willRunDismissFromKeyguard(): Boolean
    /** @return the {@link OnBackAnimationCallback} to animate Bouncer during a back gesture. */
    fun getBackCallback(): OnBackAnimationCallback
}
+5 −0
Original line number Diff line number Diff line
@@ -372,6 +372,11 @@ constructor(
        return primaryBouncerView.delegate?.willDismissWithActions() == true
    }

    /** Will the dismissal run from the keyguard layout (instead of from bouncer) */
    fun willRunDismissFromKeyguard(): Boolean {
        return primaryBouncerView.delegate?.willRunDismissFromKeyguard() == true
    }

    /** Returns whether the bouncer should be full screen. */
    private fun needsFullscreenBouncer(): Boolean {
        val mode: KeyguardSecurityModel.SecurityMode =
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */
package com.android.systemui.keyguard.shared.model

/** Alpha values for scrim updates */
data class ScrimAlpha(
    val frontAlpha: Float = 0f,
    val behindAlpha: Float = 0f,
    val notificationsAlpha: Float = 0f,
)
Loading