summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Liana Kazanova <lkazanova@google.com> 2023-10-31 18:04:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-10-31 18:04:44 +0000
commit5bab04064d04b789443da4cdbfa5b51f39154174 (patch)
treeeb55e24642fb3f2ebdc767852b95a3a1a54bf645
parente798aa5c288ec2bba9e5228af3e2ea65fc4195b2 (diff)
Revert "NSSL Migration - Animate top padding on shade pulldown"
Revert submission 25203598 Reason for revert: Potential culprit for b/308619701 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reverted changes: /q/submissionid:25203598 Change-Id: Iabac32d3704d9108720aa006ada652aa12e26568
-rw-r--r--packages/SystemUI/src/com/android/systemui/common/shared/model/SharedNotificationContainerPosition.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt12
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt33
4 files changed, 7 insertions, 47 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/common/shared/model/SharedNotificationContainerPosition.kt b/packages/SystemUI/src/com/android/systemui/common/shared/model/SharedNotificationContainerPosition.kt
index 48d374207388..b2bc06f0ae29 100644
--- a/packages/SystemUI/src/com/android/systemui/common/shared/model/SharedNotificationContainerPosition.kt
+++ b/packages/SystemUI/src/com/android/systemui/common/shared/model/SharedNotificationContainerPosition.kt
@@ -20,7 +20,4 @@ package com.android.systemui.common.shared.model
data class SharedNotificationContainerPosition(
val top: Float = 0f,
val bottom: Float = 0f,
-
- /** Whether any modifications to top/bottom are smoothly animated */
- val animate: Boolean = false,
)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt
index 6785da4bf4f1..2af7181f2f31 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/SharedNotificationContainerBinder.kt
@@ -59,8 +59,10 @@ object SharedNotificationContainerBinder {
launch {
viewModel.position.collect {
- val animate = it.animate || controller.isAddOrRemoveAnimationPending()
- controller.updateTopPadding(it.top, animate)
+ controller.updateTopPadding(
+ it.top,
+ controller.isAddOrRemoveAnimationPending()
+ )
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
index b86b5dcc7939..1229cb9b49ac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt
@@ -25,7 +25,6 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.NotificationStackSizeCalculator
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
-import com.android.systemui.util.kotlin.sample
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
@@ -119,15 +118,8 @@ constructor(
}
}
} else {
- interactor.topPosition.sample(shadeInteractor.qsExpansion, ::Pair).map {
- (top, qsExpansion) ->
- // When QS expansion > 0, it should directly set the top padding so do not
- // animate it
- val animate = qsExpansion == 0f
- keyguardInteractor.sharedNotificationContainerPosition.value.copy(
- top = top,
- animate = animate
- )
+ interactor.topPosition.map { top ->
+ keyguardInteractor.sharedNotificationContainerPosition.value.copy(top = top)
}
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
index c9837c77e679..0a7dc4e05633 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt
@@ -318,26 +318,7 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() {
sharedNotificationContainerInteractor.setTopPosition(10f)
assertThat(position)
- .isEqualTo(
- SharedNotificationContainerPosition(top = 10f, bottom = 0f, animate = true)
- )
- }
-
- @Test
- fun positionOnQS() =
- testScope.runTest {
- val position by collectLastValue(underTest.position)
-
- // Start on lockscreen with shade expanded
- showLockscreenWithQSExpanded()
-
- // When not in split shade
- sharedNotificationContainerInteractor.setTopPosition(10f)
-
- assertThat(position)
- .isEqualTo(
- SharedNotificationContainerPosition(top = 10f, bottom = 0f, animate = false)
- )
+ .isEqualTo(SharedNotificationContainerPosition(top = 10f, bottom = 0f))
}
@Test
@@ -415,18 +396,6 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() {
)
}
- private suspend fun showLockscreenWithQSExpanded() {
- shadeRepository.setLockscreenShadeExpansion(0f)
- shadeRepository.setQsExpansion(1f)
- keyguardRepository.setStatusBarState(StatusBarState.SHADE_LOCKED)
- keyguardTransitionRepository.sendTransitionStep(
- TransitionStep(
- to = KeyguardState.LOCKSCREEN,
- transitionState = TransitionState.FINISHED
- )
- )
- }
-
@SysUISingleton
@Component(
modules =