Merge "Fixed animation for legacy devices and when not always on"
This commit is contained in:
committed by
Android (Google) Code Review
commit
293b2d753d
@@ -17,6 +17,7 @@
|
||||
package com.android.systemui.statusbar.notification
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.FloatProperty
|
||||
import com.android.systemui.Interpolators
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
@@ -25,12 +26,14 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
|
||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
|
||||
import com.android.systemui.statusbar.phone.DozeParameters
|
||||
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class NotificationWakeUpCoordinator @Inject constructor(
|
||||
private val mContext: Context,
|
||||
private val mAmbientPulseManager: AmbientPulseManager,
|
||||
private val mStatusBarStateController: StatusBarStateController)
|
||||
: AmbientPulseManager.OnAmbientChangedListener, StatusBarStateController.StateListener {
|
||||
@@ -59,10 +62,12 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
||||
private var mLinearVisibilityAmount = 0.0f
|
||||
private var mWakingUp = false
|
||||
private val mEntrySetToClearWhenFinished = mutableSetOf<NotificationEntry>()
|
||||
private val mDozeParameters: DozeParameters;
|
||||
|
||||
init {
|
||||
mAmbientPulseManager.addListener(this)
|
||||
mStatusBarStateController.addCallback(this)
|
||||
mDozeParameters = DozeParameters.getInstance(mContext)
|
||||
}
|
||||
|
||||
fun setStackScroller(stackScroller: NotificationStackScrollLayout) {
|
||||
@@ -194,7 +199,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
|
||||
}
|
||||
|
||||
override fun onAmbientStateChanged(entry: NotificationEntry, isPulsing: Boolean) {
|
||||
var animate = true
|
||||
var animate = mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking()
|
||||
if (!isPulsing) {
|
||||
if (mLinearDozeAmount != 0.0f) {
|
||||
if (entry.isRowDismissed) {
|
||||
|
||||
@@ -2432,7 +2432,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
int intrinsicBefore = getIntrinsicHeight();
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
if (intrinsicBefore != getIntrinsicHeight()) {
|
||||
if (intrinsicBefore != getIntrinsicHeight() && intrinsicBefore != 0) {
|
||||
notifyHeightChanged(true /* needsAnimation */);
|
||||
}
|
||||
if (mMenuRow.getMenuView() != null) {
|
||||
|
||||
@@ -3622,10 +3622,13 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mWakeUpCoordinator.setWakingUp(true);
|
||||
mAmbientPulseManager.releaseAllImmediately();
|
||||
mVisualStabilityManager.setScreenOn(true);
|
||||
updateNotificationPanelTouchState();
|
||||
updateVisibleToUser();
|
||||
updateIsKeyguard();
|
||||
mDozeServiceHost.stopDozing();
|
||||
// This is intentionally below the stopDozing call above, since it avoids that we're
|
||||
// unnecessarily animating the wakeUp transition. Animations should only be enabled
|
||||
// once we fully woke up.
|
||||
updateNotificationPanelTouchState();
|
||||
mPulseExpansionHandler.onStartedWakingUp();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
mDependency.injectMockDependency(ConfigurationController.class);
|
||||
mDependency.injectMockDependency(ZenModeController.class);
|
||||
NotificationWakeUpCoordinator coordinator =
|
||||
new NotificationWakeUpCoordinator(
|
||||
new NotificationWakeUpCoordinator(mContext,
|
||||
new AmbientPulseManager(mContext),
|
||||
new StatusBarStateControllerImpl());
|
||||
PulseExpansionHandler expansionHandler = new PulseExpansionHandler(mContext, coordinator);
|
||||
|
||||
Reference in New Issue
Block a user