diff options
| author | 2024-09-18 15:50:41 +0200 | |
|---|---|---|
| committer | 2024-09-18 16:46:52 +0200 | |
| commit | 2ecace1d82ca3124955f65ccb9b51d6dda8ede71 (patch) | |
| tree | d6595b44b83db8cb57c3e5147cc10f3c991455bf | |
| parent | 5bafeec592fffb8692c04dfd864110f5b23b84cf (diff) | |
Move EmptyShadeView to its own directory
This is an initial step towards setting up the recommended architecture
stack for this view.
Flag: EXEMPT mechanical refactor
Bug: 308591475
Test: builds
Change-Id: Ibcbc7dfa59db6222f4c3aecd901466b560befe8b
| -rw-r--r-- | packages/SystemUI/res/layout/status_bar_no_notifications.xml | 4 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/emptyshade/ui/view/EmptyShadeView.java (renamed from packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java) | 6 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java | 2 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java | 2 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java | 2 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt | 82 |
6 files changed, 49 insertions, 49 deletions
diff --git a/packages/SystemUI/res/layout/status_bar_no_notifications.xml b/packages/SystemUI/res/layout/status_bar_no_notifications.xml index 856ba92b6d41..248e61100cad 100644 --- a/packages/SystemUI/res/layout/status_bar_no_notifications.xml +++ b/packages/SystemUI/res/layout/status_bar_no_notifications.xml @@ -15,7 +15,7 @@ --> <!-- Extends Framelayout --> -<com.android.systemui.statusbar.EmptyShadeView +<com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -46,4 +46,4 @@ android:textAppearance="?android:attr/textAppearanceButton" android:text="@string/unlock_to_see_notif_text"/> </LinearLayout> -</com.android.systemui.statusbar.EmptyShadeView> +</com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/emptyshade/ui/view/EmptyShadeView.java index 2338be28d32c..850e9447beea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/EmptyShadeView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/emptyshade/ui/view/EmptyShadeView.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -11,10 +11,10 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ -package com.android.systemui.statusbar; +package com.android.systemui.statusbar.notification.emptyshade.ui.view; import android.annotation.ColorInt; import android.annotation.DrawableRes; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index e7c67f93eb78..2d21d2dbf1b7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -94,7 +94,6 @@ import com.android.systemui.res.R; import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.shade.QSHeaderBoundsProvider; import com.android.systemui.shade.TouchLogger; -import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.notification.ColorUpdateLogger; @@ -106,6 +105,7 @@ import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager; import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; +import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.logging.NotificationLogger; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index cccac4b479dd..f6cdfbcd1d23 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -31,9 +31,9 @@ import com.android.systemui.animation.ShadeInterpolation; import com.android.systemui.res.R; import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.shade.transition.LargeScreenShadeInterpolator; -import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.notification.SourceType; +import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.row.ActivatableNotificationView; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index a06f4d2d2d80..3809d51b6d24 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -83,13 +83,13 @@ import com.android.systemui.res.R; import com.android.systemui.shade.QSHeaderBoundsProvider; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.transition.LargeScreenShadeInterpolator; -import com.android.systemui.statusbar.EmptyShadeView; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager; import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; +import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt index 3e8bf4792f02..1ef400710102 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt @@ -18,11 +18,11 @@ import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.res.R import com.android.systemui.shade.transition.LargeScreenShadeInterpolator -import com.android.systemui.statusbar.EmptyShadeView import com.android.systemui.statusbar.NotificationShelf import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.notification.RoundableState import com.android.systemui.statusbar.notification.collection.NotificationEntry +import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView import com.android.systemui.statusbar.notification.footer.ui.view.FooterView import com.android.systemui.statusbar.notification.footer.ui.view.FooterView.FooterViewState import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow @@ -79,7 +79,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* bypassController */ { false }, mStatusBarKeyguardViewManager, largeScreenShadeInterpolator, - avalancheController + avalancheController, ) private val testableResources = mContext.getOrCreateTestableResources() @@ -240,7 +240,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { headsUpTop = headsUpTop, stackTop = stackTop, collapsedHeight = collapsedHeight, - intrinsicHeight = intrinsicHeight + intrinsicHeight = intrinsicHeight, ) // When @@ -269,7 +269,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { headsUpTop = headsUpTop, stackTop = stackTop, collapsedHeight = collapsedHeight, - intrinsicHeight = intrinsicHeight + intrinsicHeight = intrinsicHeight, ) // When @@ -548,7 +548,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(false) resetViewStates_expansionChanging_notificationAlphaUpdated( expansionFraction = 0.25f, - expectedAlpha = 0.0f + expectedAlpha = 0.0f, ) } @@ -558,7 +558,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(true) resetViewStates_expansionChanging_notificationAlphaUpdated( expansionFraction = 0.85f, - expectedAlpha = 0.0f + expectedAlpha = 0.0f, ) } @@ -568,7 +568,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { whenever(mStatusBarKeyguardViewManager.isPrimaryBouncerInTransit).thenReturn(false) resetViewStates_expansionChanging_notificationAlphaUpdated( expansionFraction = 0.6f, - expectedAlpha = getContentAlpha(0.6f) + expectedAlpha = getContentAlpha(0.6f), ) } @@ -785,7 +785,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { val gap = stackScrollAlgorithm.getGapForLocation( /* fractionToShade= */ 0f, - /* onKeyguard= */ true + /* onKeyguard= */ true, ) assertThat(gap).isEqualTo(smallGap) } @@ -795,7 +795,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { val gap = stackScrollAlgorithm.getGapForLocation( /* fractionToShade= */ 0.5f, - /* onKeyguard= */ true + /* onKeyguard= */ true, ) assertThat(gap).isEqualTo(smallGap * 0.5f + bigGap * 0.5f) } @@ -805,7 +805,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { val gap = stackScrollAlgorithm.getGapForLocation( /* fractionToShade= */ 0f, - /* onKeyguard= */ false + /* onKeyguard= */ false, ) assertThat(gap).isEqualTo(bigGap) } @@ -869,7 +869,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* mustStayOnScreen= */ true, /* isViewEndVisible= */ true, /* viewEnd= */ 0f, - /* maxHunY= */ 10f + /* maxHunY= */ 10f, ) assertTrue(expandableViewState.headsUpIsVisible) @@ -886,7 +886,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* mustStayOnScreen= */ true, /* isViewEndVisible= */ true, /* viewEnd= */ 10f, - /* maxHunY= */ 0f + /* maxHunY= */ 0f, ) assertFalse(expandableViewState.headsUpIsVisible) @@ -903,7 +903,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* mustStayOnScreen= */ true, /* isViewEndVisible= */ true, /* viewEnd= */ 10f, - /* maxHunY= */ 1f + /* maxHunY= */ 1f, ) assertTrue(expandableViewState.headsUpIsVisible) @@ -920,7 +920,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* mustStayOnScreen= */ false, /* isViewEndVisible= */ true, /* viewEnd= */ 10f, - /* maxHunY= */ 1f + /* maxHunY= */ 1f, ) assertTrue(expandableViewState.headsUpIsVisible) @@ -937,7 +937,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* mustStayOnScreen= */ true, /* isViewEndVisible= */ false, /* viewEnd= */ 10f, - /* maxHunY= */ 1f + /* maxHunY= */ 1f, ) assertTrue(expandableViewState.headsUpIsVisible) @@ -951,7 +951,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { stackScrollAlgorithm.clampHunToTop( /* headsUpTop= */ 10f, /* collapsedHeight= */ 1f, - expandableViewState + expandableViewState, ) // qqs (10 + 0) < viewY (50) @@ -966,7 +966,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { stackScrollAlgorithm.clampHunToTop( /* headsUpTop= */ 10f, /* collapsedHeight= */ 1f, - expandableViewState + expandableViewState, ) // qqs (10 + 0) > viewY (-10) @@ -982,7 +982,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { stackScrollAlgorithm.clampHunToTop( /* headsUpTop= */ 10f, /* collapsedHeight= */ 10f, - expandableViewState + expandableViewState, ) // newTranslation = max(10, -100) = 10 @@ -1000,7 +1000,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { stackScrollAlgorithm.clampHunToTop( /* headsUpTop= */ 10f, /* collapsedHeight= */ 10f, - expandableViewState + expandableViewState, ) // newTranslation = max(10, 5) = 10 @@ -1016,7 +1016,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* hostViewHeight= */ 100f, /* stackY= */ 110f, /* viewMaxHeight= */ 20f, - /* originalCornerRoundness= */ 0f + /* originalCornerRoundness= */ 0f, ) assertEquals(1f, currentRoundness) } @@ -1028,7 +1028,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* hostViewHeight= */ 100f, /* stackY= */ 90f, /* viewMaxHeight= */ 20f, - /* originalCornerRoundness= */ 0f + /* originalCornerRoundness= */ 0f, ) assertEquals(0.5f, currentRoundness) } @@ -1040,7 +1040,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* hostViewHeight= */ 100f, /* stackY= */ 0f, /* viewMaxHeight= */ 20f, - /* originalCornerRoundness= */ 0f + /* originalCornerRoundness= */ 0f, ) assertEquals(0f, currentRoundness) } @@ -1052,7 +1052,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* hostViewHeight= */ 100f, /* stackY= */ 0f, /* viewMaxHeight= */ 20f, - /* originalCornerRoundness= */ 1f + /* originalCornerRoundness= */ 1f, ) assertEquals(1f, currentRoundness) } @@ -1076,7 +1076,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* childrenOnTop= */ 0.0f, /* StackScrollAlgorithmState= */ algorithmState, /* ambientState= */ ambientState, - /* shouldElevateHun= */ true + /* shouldElevateHun= */ true, ) // Then: full shadow would be applied @@ -1104,7 +1104,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* childrenOnTop= */ 0.0f, /* StackScrollAlgorithmState= */ algorithmState, /* ambientState= */ ambientState, - /* shouldElevateHun= */ true + /* shouldElevateHun= */ true, ) // Then: HUN should have shadow, but not as full size @@ -1137,7 +1137,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* childrenOnTop= */ 0.0f, /* StackScrollAlgorithmState= */ algorithmState, /* ambientState= */ ambientState, - /* shouldElevateHun= */ true + /* shouldElevateHun= */ true, ) // Then: HUN should not have shadow @@ -1166,7 +1166,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* childrenOnTop= */ 0.0f, /* StackScrollAlgorithmState= */ algorithmState, /* ambientState= */ ambientState, - /* shouldElevateHun= */ true + /* shouldElevateHun= */ true, ) // Then: HUN should have full shadow @@ -1196,7 +1196,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* childrenOnTop= */ 0.0f, /* StackScrollAlgorithmState= */ algorithmState, /* ambientState= */ ambientState, - /* shouldElevateHun= */ true + /* shouldElevateHun= */ true, ) // Then: HUN should have shadow, but not as full size @@ -1274,14 +1274,14 @@ class StackScrollAlgorithmTest : SysuiTestCase() { setExpansionFractionWithoutShelfDuringAodToLockScreen( ambientState, algorithmState, - fraction = 0.5f + fraction = 0.5f, ) stackScrollAlgorithm.resetViewStates(ambientState, 0) // Then: pulsingNotificationView should show at full height assertEquals( stackScrollAlgorithm.getMaxAllowedChildHeight(pulsingNotificationView), - pulsingNotificationView.viewState.height + pulsingNotificationView.viewState.height, ) // After: reset dozeAmount and expansionFraction @@ -1289,7 +1289,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { setExpansionFractionWithoutShelfDuringAodToLockScreen( ambientState, algorithmState, - fraction = 1f + fraction = 1f, ) } @@ -1302,7 +1302,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* headsUpIsVisible= */ false, /* showingPulsing= */ false, /* isOnKeyguard=*/ false, - /*headsUpOnKeyguard=*/ false + /*headsUpOnKeyguard=*/ false, ) ) .isFalse() @@ -1316,7 +1316,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* headsUpIsVisible= */ true, /* showingPulsing= */ false, /* isOnKeyguard=*/ false, - /*headsUpOnKeyguard=*/ false + /*headsUpOnKeyguard=*/ false, ) ) .isFalse() @@ -1330,7 +1330,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* headsUpIsVisible= */ false, /* showingPulsing= */ true, /* isOnKeyguard=*/ false, - /* headsUpOnKeyguard= */ false + /* headsUpOnKeyguard= */ false, ) ) .isFalse() @@ -1344,7 +1344,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* headsUpIsVisible= */ false, /* showingPulsing= */ false, /* isOnKeyguard=*/ true, - /* headsUpOnKeyguard= */ false + /* headsUpOnKeyguard= */ false, ) ) .isFalse() @@ -1358,7 +1358,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* headsUpIsVisible= */ false, /* showingPulsing= */ false, /* isOnKeyguard=*/ false, - /* headsUpOnKeyguard= */ false + /* headsUpOnKeyguard= */ false, ) ) .isTrue() @@ -1372,7 +1372,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { /* headsUpIsVisible= */ false, /* showingPulsing= */ false, /* isOnKeyguard=*/ true, - /* headsUpOnKeyguard= */ true + /* headsUpOnKeyguard= */ true, ) ) .isTrue() @@ -1408,7 +1408,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { private fun createHunViewMock( isShadeOpen: Boolean, fullyVisible: Boolean, - headerVisibleAmount: Float + headerVisibleAmount: Float, ) = mock<ExpandableNotificationRow>().apply { val childViewStateMock = createHunChildViewState(isShadeOpen, fullyVisible) @@ -1440,7 +1440,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { private fun setExpansionFractionWithoutShelfDuringAodToLockScreen( ambientState: AmbientState, algorithmState: StackScrollAlgorithm.StackScrollAlgorithmState, - fraction: Float + fraction: Float, ) { // showingShelf: false algorithmState.firstViewInShelf = null @@ -1476,7 +1476,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { private fun resetViewStates_hunsOverlapping_bottomHunClipped( topHun: ExpandableNotificationRow, - bottomHun: ExpandableNotificationRow + bottomHun: ExpandableNotificationRow, ) { val topHunHeight = mContext.resources.getDimensionPixelSize(R.dimen.notification_content_min_height) @@ -1524,7 +1524,7 @@ class StackScrollAlgorithmTest : SysuiTestCase() { headsUpBottom: Float = headsUpTop + intrinsicHeight, // assume all the space available stackTop: Float, stackCutoff: Float = 2000f, - fullStackHeight: Float = 3000f + fullStackHeight: Float = 3000f, ) { ambientState.headsUpTop = headsUpTop ambientState.headsUpBottom = headsUpBottom |