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

Commit f21f9f3c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "KeygaurdBottomArea additional API cleanup" into tm-qpr-dev am: a0440d7b

parents d3334f7d a0440d7b
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -265,9 +265,6 @@ public interface CentralSurfaces extends Dumpable, ActivityStarter, LifecycleOwn


    boolean isPulsing();
    boolean isPulsing();


    @Nullable
    View getAmbientIndicationContainer();

    boolean isOccluded();
    boolean isOccluded();


    //TODO: These can / should probably be moved to NotificationPresenter or ShadeController
    //TODO: These can / should probably be moved to NotificationPresenter or ShadeController
+0 −6
Original line number Original line Diff line number Diff line
@@ -1858,12 +1858,6 @@ public class CentralSurfacesImpl extends CoreStartable implements
        return mDozeServiceHost.isPulsing();
        return mDozeServiceHost.isPulsing();
    }
    }


    @androidx.annotation.Nullable
    @Override
    public View getAmbientIndicationContainer() {
        return mAmbientIndicationContainer;
    }

    /**
    /**
     * When the keyguard is showing and covered by a "showWhenLocked" activity it
     * When the keyguard is showing and covered by a "showWhenLocked" activity it
     * is occluded. This is controlled by {@link com.android.server.policy.PhoneWindowManager}
     * is occluded. This is controlled by {@link com.android.server.policy.PhoneWindowManager}
+25 −4
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ import android.util.Log;
import android.util.TypedValue;
import android.util.TypedValue;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.view.ViewPropertyAnimator;
import android.view.WindowInsets;
import android.view.WindowInsets;
import android.widget.FrameLayout;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ImageView;
@@ -62,6 +63,9 @@ import com.android.systemui.qrcodescanner.controller.QRCodeScannerController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.wallet.controller.QuickAccessWalletController;
import com.android.systemui.wallet.controller.QuickAccessWalletController;


import java.util.ArrayList;
import java.util.List;

/**
/**
 * Implementation for the bottom area of the Keyguard, including camera/phone affordance and status
 * Implementation for the bottom area of the Keyguard, including camera/phone affordance and status
 * text.
 * text.
@@ -347,8 +351,17 @@ public class KeyguardBottomAreaView extends FrameLayout {
        dozeTimeTick();
        dozeTimeTick();
    }
    }


    public View getIndicationArea() {
    /**
        return mIndicationArea;
     * Returns a list of animators to use to animate the indication areas.
     */
    public List<ViewPropertyAnimator> getIndicationAreaAnimators() {
        List<ViewPropertyAnimator> animators =
                new ArrayList<>(mAmbientIndicationArea != null ? 2 : 1);
        animators.add(mIndicationArea.animate());
        if (mAmbientIndicationArea != null) {
            animators.add(mAmbientIndicationArea.animate());
        }
        return animators;
    }
    }


    @Override
    @Override
@@ -418,9 +431,17 @@ public class KeyguardBottomAreaView extends FrameLayout {
    }
    }


    /**
    /**
     * Sets the alpha of the indication areas and affordances, excluding the lock icon.
     * Sets the alpha of various sub-components, for example the indication areas and bottom quick
     * action buttons. Does not set the alpha of the lock icon.
     */
     */
    public void setAffordanceAlpha(float alpha) {
    public void setComponentAlphas(float alpha) {
        setImportantForAccessibility(
                alpha == 0f
                        ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
                        : View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
        if (mAmbientIndicationArea != null) {
            mAmbientIndicationArea.setAlpha(alpha);
        }
        mIndicationArea.setAlpha(alpha);
        mIndicationArea.setAlpha(alpha);
        mWalletButton.setAlpha(alpha);
        mWalletButton.setAlpha(alpha);
        mQRCodeScannerButton.setAlpha(alpha);
        mQRCodeScannerButton.setAlpha(alpha);
+1 −8
Original line number Original line Diff line number Diff line
@@ -3197,14 +3197,7 @@ public final class NotificationPanelViewController extends PanelViewController {
                getExpandedFraction());
                getExpandedFraction());
        float alpha = Math.min(expansionAlpha, 1 - computeQsExpansionFraction());
        float alpha = Math.min(expansionAlpha, 1 - computeQsExpansionFraction());
        alpha *= mBottomAreaShadeAlpha;
        alpha *= mBottomAreaShadeAlpha;
        mKeyguardBottomArea.setAffordanceAlpha(alpha);
        mKeyguardBottomArea.setComponentAlphas(alpha);
        mKeyguardBottomArea.setImportantForAccessibility(
                alpha == 0f ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
                        : View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
        View ambientIndicationContainer = mCentralSurfaces.getAmbientIndicationContainer();
        if (ambientIndicationContainer != null) {
            ambientIndicationContainer.setAlpha(alpha);
        }
        mLockIconViewController.setAlpha(alpha);
        mLockIconViewController.setAlpha(alpha);
    }
    }


+15 −10
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ import android.view.VelocityTracker;
import android.view.View;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.view.ViewPropertyAnimator;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver;
import android.view.animation.Interpolator;
import android.view.animation.Interpolator;


@@ -66,6 +67,7 @@ import com.android.systemui.util.time.SystemClock;
import com.android.wm.shell.animation.FlingAnimationUtils;
import com.android.wm.shell.animation.FlingAnimationUtils;


import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.List;


public abstract class PanelViewController {
public abstract class PanelViewController {
    public static final boolean DEBUG = PanelView.DEBUG;
    public static final boolean DEBUG = PanelView.DEBUG;
@@ -1032,16 +1034,19 @@ public abstract class PanelViewController {
        animator.start();
        animator.start();
        setAnimator(animator);
        setAnimator(animator);


        View[] viewsToAnimate = {
        final List<ViewPropertyAnimator> indicationAnimators =
                mKeyguardBottomArea.getIndicationArea(),
                mKeyguardBottomArea.getIndicationAreaAnimators();
                mCentralSurfaces.getAmbientIndicationContainer()};
        for (final ViewPropertyAnimator indicationAreaAnimator : indicationAnimators) {
        for (View v : viewsToAnimate) {
            indicationAreaAnimator
            if (v == null) {
                    .translationY(-mHintDistance)
                continue;
                    .setDuration(250)
            }
                    .setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
            v.animate().translationY(-mHintDistance).setDuration(250).setInterpolator(
                    .withEndAction(() -> indicationAreaAnimator
                    Interpolators.FAST_OUT_SLOW_IN).withEndAction(() -> v.animate().translationY(
                            .translationY(0)
                    0).setDuration(450).setInterpolator(mBounceInterpolator).start()).start();
                            .setDuration(450)
                            .setInterpolator(mBounceInterpolator)
                            .start())
                    .start();
        }
        }
    }
    }