From 3186c166f8670a0280b21cfbd98a1288a4c5e5e2 Mon Sep 17 00:00:00 2001 From: Caitlin Cassidy Date: Tue, 3 Aug 2021 18:15:57 +0000 Subject: [PATCH] [View Controllers] (1/3) Move KeyguardStatusBarView's animation methods out of NotificationPanelViewController and into KeyguardStatusBarViewController. Test: atest and manual Bug: 195442899 Change-Id: I97d1a59191a0cc892fefe2ca26ec176fd256872a --- .../KeyguardStatusBarViewComponent.java | 5 +- .../KeyguardStatusBarViewController.java | 80 +++++++++++- .../NotificationPanelViewController.java | 121 ++++++------------ .../KeyguardStatusBarViewControllerTest.java | 5 +- .../phone/NotificationPanelViewTest.java | 2 +- 5 files changed, 130 insertions(+), 83 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java index 49a617eeb6c09..0b0e430dab948 100644 --- a/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java +++ b/packages/SystemUI/src/com/android/keyguard/dagger/KeyguardStatusBarViewComponent.java @@ -34,7 +34,10 @@ public interface KeyguardStatusBarViewComponent { /** Simple factory for {@link KeyguardStatusBarViewComponent}. */ @Subcomponent.Factory interface Factory { - KeyguardStatusBarViewComponent build(@BindsInstance KeyguardStatusBarView view); + KeyguardStatusBarViewComponent build( + @BindsInstance KeyguardStatusBarView view, + @BindsInstance KeyguardStatusBarViewController.ViewStateProvider + viewStateProvider); } /** Builds a {@link KeyguardStatusViewController}. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java index 3e604ec98e055..fefa994ff20e9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java @@ -19,16 +19,21 @@ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_IN; import static com.android.systemui.statusbar.events.SystemStatusAnimationSchedulerKt.ANIMATING_OUT; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.res.Resources; +import android.view.View; import androidx.annotation.NonNull; import com.android.keyguard.CarrierTextController; import com.android.systemui.R; +import com.android.systemui.animation.Interpolators; import com.android.systemui.battery.BatteryMeterViewController; import com.android.systemui.statusbar.events.SystemStatusAnimationCallback; import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; +import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.UserInfoController; @@ -52,6 +57,7 @@ public class KeyguardStatusBarViewController extends ViewController mView.onUserInfoChanged(picture); + private final ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener = + animation -> { + mKeyguardStatusBarAnimateAlpha = (float) animation.getAnimatedValue(); + updateViewState(); + }; + private final List mBlockedIcons; private boolean mBatteryListening; private StatusBarIconController.TintedIconManager mTintedIconManager; + private float mKeyguardStatusBarAnimateAlpha = 1f; + @Inject public KeyguardStatusBarViewController( KeyguardStatusBarView view, @@ -118,7 +132,8 @@ public class KeyguardStatusBarViewController extends ViewController