diff options
| author | 2024-03-08 13:50:09 -0800 | |
|---|---|---|
| committer | 2024-03-08 13:52:50 -0800 | |
| commit | 7506d8e6412bb1383261c09e56014eb08c0ac192 (patch) | |
| tree | 764cf4a1e8cc6cdff1d259493880993d9ad1e070 | |
| parent | 0104e4148431a78164970328bc61bb5f4cc84a4d (diff) | |
Move OpenCloseListener and TrackingStartedListener out of ShadeViewController
Bug: 303267342
Test: Existing tests
Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Change-Id: Ie71f1253090d63009603f85de55c52b3c7cf779b
5 files changed, 50 insertions, 24 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 2fd438be9610..f28f7f75df52 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -1534,13 +1534,13 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump mKeyguardBottomArea = keyguardBottomArea; } - @Override + /** Sets a listener to be notified when the shade starts opening or finishes closing. */ public void setOpenCloseListener(OpenCloseListener openCloseListener) { SceneContainerFlag.assertInLegacyMode(); mOpenCloseListener = openCloseListener; } - @Override + /** Sets a listener to be notified when touch tracking begins. */ public void setTrackingStartedListener(TrackingStartedListener trackingStartedListener) { mTrackingStartedListener = trackingStartedListener; } diff --git a/packages/SystemUI/src/com/android/systemui/shade/OpenCloseListener.kt b/packages/SystemUI/src/com/android/systemui/shade/OpenCloseListener.kt new file mode 100644 index 000000000000..108dd47874c3 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/shade/OpenCloseListener.kt @@ -0,0 +1,26 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * 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. + */ + +package com.android.systemui.shade + +/** Listens for when shade begins opening or finishes closing. */ +interface OpenCloseListener { + /** Called when the shade finishes closing. */ + fun onClosingFinished() + + /** Called when the shade starts opening. */ + fun onOpenStarted() +} diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt index 7a1637eeab15..29e2e2eeb776 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt @@ -71,15 +71,9 @@ interface ShadeViewController { /** Returns whether the shade's top level view is enabled. */ val isViewEnabled: Boolean - /** Sets a listener to be notified when the shade starts opening or finishes closing. */ - fun setOpenCloseListener(openCloseListener: OpenCloseListener) - /** Returns whether status bar icons should be hidden when the shade is expanded. */ fun shouldHideStatusBarIconsWhenExpanded(): Boolean - /** Sets a listener to be notified when touch tracking begins. */ - fun setTrackingStartedListener(trackingStartedListener: TrackingStartedListener) - /** * Disables the shade header. * @@ -269,17 +263,3 @@ interface ShadeViewStateProvider { /** Return the fraction of the shade that's expanded, when in lockscreen. */ val lockscreenShadeDragProgress: Float } - -/** Listens for when touch tracking begins. */ -interface TrackingStartedListener { - fun onTrackingStarted() -} - -/** Listens for when shade begins opening or finishes closing. */ -interface OpenCloseListener { - /** Called when the shade finishes closing. */ - fun onClosingFinished() - - /** Called when the shade starts opening. */ - fun onOpenStarted() -} diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt index 3be3f6b1441d..16fa7d26c856 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt @@ -42,10 +42,8 @@ class ShadeViewControllerEmptyImpl @Inject constructor() : override val isFullyCollapsed: Boolean = false override val isTracking: Boolean = false override val isViewEnabled: Boolean = false - override fun setOpenCloseListener(openCloseListener: OpenCloseListener) {} override fun shouldHideStatusBarIconsWhenExpanded() = false override fun blockExpansionForCurrentTouch() {} - override fun setTrackingStartedListener(trackingStartedListener: TrackingStartedListener) {} override fun disableHeader(state1: Int, state2: Int, animated: Boolean) {} override fun startExpandLatencyTracking() {} override fun startBouncerPreHideAnimation() {} diff --git a/packages/SystemUI/src/com/android/systemui/shade/TrackingStartedListener.kt b/packages/SystemUI/src/com/android/systemui/shade/TrackingStartedListener.kt new file mode 100644 index 000000000000..3803c27d5f37 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/shade/TrackingStartedListener.kt @@ -0,0 +1,22 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * 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. + */ + +package com.android.systemui.shade + +/** Listens for when touch tracking begins. */ +interface TrackingStartedListener { + fun onTrackingStarted() +} |