Merge "Fix NotifKeyguardViewStateRepo#isPulseExpanding" into main
This commit is contained in:
commit
715a2fef96
@ -393,7 +393,6 @@ object KeyguardRootViewBinder {
|
||||
iconsAppearTranslationPx: Int,
|
||||
screenOffAnimationController: ScreenOffAnimationController,
|
||||
) {
|
||||
val statusViewMigrated = KeyguardShadeMigrationNssl.isEnabled
|
||||
animate().cancel()
|
||||
val animatorListener =
|
||||
object : AnimatorListenerAdapter() {
|
||||
@ -404,13 +403,13 @@ object KeyguardRootViewBinder {
|
||||
when {
|
||||
!isVisible.isAnimating -> {
|
||||
alpha = 1f
|
||||
if (!statusViewMigrated) {
|
||||
if (!KeyguardShadeMigrationNssl.isEnabled) {
|
||||
translationY = 0f
|
||||
}
|
||||
visibility = if (isVisible.value) View.VISIBLE else View.INVISIBLE
|
||||
}
|
||||
newAodTransition() -> {
|
||||
animateInIconTranslation(statusViewMigrated)
|
||||
animateInIconTranslation()
|
||||
if (isVisible.value) {
|
||||
CrossFadeHelper.fadeIn(this, animatorListener)
|
||||
} else {
|
||||
@ -419,7 +418,7 @@ object KeyguardRootViewBinder {
|
||||
}
|
||||
!isVisible.value -> {
|
||||
// Let's make sure the icon are translated to 0, since we cancelled it above
|
||||
animateInIconTranslation(statusViewMigrated)
|
||||
animateInIconTranslation()
|
||||
CrossFadeHelper.fadeOut(this, animatorListener)
|
||||
}
|
||||
visibility != View.VISIBLE -> {
|
||||
@ -429,13 +428,12 @@ object KeyguardRootViewBinder {
|
||||
appearIcons(
|
||||
animate = screenOffAnimationController.shouldAnimateAodIcons(),
|
||||
iconsAppearTranslationPx,
|
||||
statusViewMigrated,
|
||||
animatorListener,
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
// Let's make sure the icons are translated to 0, since we cancelled it above
|
||||
animateInIconTranslation(statusViewMigrated)
|
||||
animateInIconTranslation()
|
||||
// We were fading out, let's fade in instead
|
||||
CrossFadeHelper.fadeIn(this, animatorListener)
|
||||
}
|
||||
@ -445,11 +443,10 @@ object KeyguardRootViewBinder {
|
||||
private fun View.appearIcons(
|
||||
animate: Boolean,
|
||||
iconAppearTranslation: Int,
|
||||
statusViewMigrated: Boolean,
|
||||
animatorListener: Animator.AnimatorListener,
|
||||
) {
|
||||
if (animate) {
|
||||
if (!statusViewMigrated) {
|
||||
if (!KeyguardShadeMigrationNssl.isEnabled) {
|
||||
translationY = -iconAppearTranslation.toFloat()
|
||||
}
|
||||
alpha = 0f
|
||||
@ -457,19 +454,19 @@ object KeyguardRootViewBinder {
|
||||
.alpha(1f)
|
||||
.setInterpolator(Interpolators.LINEAR)
|
||||
.setDuration(AOD_ICONS_APPEAR_DURATION)
|
||||
.apply { if (statusViewMigrated) animateInIconTranslation() }
|
||||
.apply { if (KeyguardShadeMigrationNssl.isEnabled) animateInIconTranslation() }
|
||||
.setListener(animatorListener)
|
||||
.start()
|
||||
} else {
|
||||
alpha = 1.0f
|
||||
if (!statusViewMigrated) {
|
||||
if (!KeyguardShadeMigrationNssl.isEnabled) {
|
||||
translationY = 0f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun View.animateInIconTranslation(statusViewMigrated: Boolean) {
|
||||
if (!statusViewMigrated) {
|
||||
private fun View.animateInIconTranslation() {
|
||||
if (!KeyguardShadeMigrationNssl.isEnabled) {
|
||||
animate().animateInIconTranslation().setDuration(AOD_ICONS_APPEAR_DURATION).start()
|
||||
}
|
||||
}
|
||||
|
@ -1096,7 +1096,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPulseExpansionChanged(boolean expandingChanged) {
|
||||
public void onPulseExpansionAmountChanged(boolean expandingChanged) {
|
||||
if (mKeyguardBypassController.getBypassEnabled()) {
|
||||
// Position the notifications while dragging down while pulsing
|
||||
requestScrollerTopPaddingUpdate(false /* animate */);
|
||||
|
@ -20,9 +20,9 @@ import android.util.FloatProperty
|
||||
import android.view.animation.Interpolator
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import androidx.core.animation.ObjectAnimator
|
||||
import com.android.systemui.Dumpable
|
||||
import com.android.app.animation.Interpolators
|
||||
import com.android.app.animation.InterpolatorsAndroidX
|
||||
import com.android.systemui.Dumpable
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.dump.DumpManager
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
@ -31,6 +31,7 @@ import com.android.systemui.shade.ShadeExpansionListener
|
||||
import com.android.systemui.shade.ShadeViewController
|
||||
import com.android.systemui.statusbar.StatusBarState
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||
import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor
|
||||
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
|
||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
|
||||
import com.android.systemui.statusbar.phone.DozeParameters
|
||||
@ -206,8 +207,15 @@ constructor(
|
||||
val nowExpanding = isPulseExpanding()
|
||||
val changed = nowExpanding != pulseExpanding
|
||||
pulseExpanding = nowExpanding
|
||||
for (listener in wakeUpListeners) {
|
||||
listener.onPulseExpansionChanged(changed)
|
||||
if (!NotificationIconContainerRefactor.isEnabled) {
|
||||
for (listener in wakeUpListeners) {
|
||||
listener.onPulseExpansionAmountChanged(changed)
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
for (listener in wakeUpListeners) {
|
||||
listener.onPulseExpandingChanged(pulseExpanding)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -620,13 +628,20 @@ constructor(
|
||||
*
|
||||
* @param expandingChanged if the user has started or stopped expanding
|
||||
*/
|
||||
fun onPulseExpansionChanged(expandingChanged: Boolean) {}
|
||||
@Deprecated(
|
||||
message = "Use onPulseExpandedChanged instead.",
|
||||
replaceWith = ReplaceWith("onPulseExpandedChanged"),
|
||||
)
|
||||
fun onPulseExpansionAmountChanged(expandingChanged: Boolean) {}
|
||||
|
||||
/**
|
||||
* Called when the animator started by [scheduleDelayedDozeAmountAnimation] begins running
|
||||
* after the start delay, or after it ends/is cancelled.
|
||||
*/
|
||||
fun onDelayedDozeAmountAnimationRunning(running: Boolean) {}
|
||||
|
||||
/** Called whenever a pulse has started or stopped expanding. */
|
||||
fun onPulseExpandingChanged(isPulseExpanding: Boolean) {}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -62,8 +62,8 @@ constructor(
|
||||
override val isPulseExpanding: Flow<Boolean> = conflatedCallbackFlow {
|
||||
val listener =
|
||||
object : NotificationWakeUpCoordinator.WakeUpListener {
|
||||
override fun onPulseExpansionChanged(expandingChanged: Boolean) {
|
||||
trySend(expandingChanged)
|
||||
override fun onPulseExpandingChanged(isPulseExpanding: Boolean) {
|
||||
trySend(isPulseExpanding)
|
||||
}
|
||||
}
|
||||
trySend(wakeUpCoordinator.isPulseExpanding())
|
||||
|
@ -608,7 +608,7 @@ public class LegacyNotificationIconAreaControllerImpl implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPulseExpansionChanged(boolean expandingChanged) {
|
||||
public void onPulseExpansionAmountChanged(boolean expandingChanged) {
|
||||
if (expandingChanged) {
|
||||
updateAodIconsVisibility(true /* animate */, false /* force */);
|
||||
}
|
||||
|
@ -284,11 +284,22 @@ public class NotificationIconContainer extends ViewGroup {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NotificationIconContainer("
|
||||
+ "dozing=" + mDozing + " onLockScreen=" + mOnLockScreen
|
||||
+ " overrideIconColor=" + mOverrideIconColor
|
||||
+ " speedBumpIndex=" + mSpeedBumpIndex
|
||||
+ " themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary) + ')';
|
||||
if (NotificationIconContainerRefactor.isEnabled()) {
|
||||
return super.toString()
|
||||
+ " {"
|
||||
+ " overrideIconColor=" + mOverrideIconColor
|
||||
+ ", maxIcons=" + mMaxIcons
|
||||
+ ", isStaticLayout=" + mIsStaticLayout
|
||||
+ ", themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary)
|
||||
+ " }";
|
||||
} else {
|
||||
return "NotificationIconContainer("
|
||||
+ "dozing=" + mDozing + " onLockScreen=" + mOnLockScreen
|
||||
+ " overrideIconColor=" + mOverrideIconColor
|
||||
+ " speedBumpIndex=" + mSpeedBumpIndex
|
||||
+ " themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary)
|
||||
+ ')';
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
@ -80,7 +80,7 @@ class NotificationsKeyguardViewStateRepositoryTest : SysuiTestCase() {
|
||||
assertThat(isPulseExpanding).isFalse()
|
||||
|
||||
withArgCaptor { verify(mockWakeUpCoordinator).addListener(capture()) }
|
||||
.onPulseExpansionChanged(true)
|
||||
.onPulseExpandingChanged(true)
|
||||
runCurrent()
|
||||
|
||||
assertThat(isPulseExpanding).isTrue()
|
||||
|
Loading…
x
Reference in New Issue
Block a user