Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7506d8e6 authored by Shawn Lee's avatar Shawn Lee
Browse files

Move OpenCloseListener and TrackingStartedListener out of ShadeViewController

Bug: 303267342
Test: Existing tests
Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Change-Id: Ie71f1253090d63009603f85de55c52b3c7cf779b
parent 0104e414
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
    }
+26 −0
Original line number Diff line number Diff line
/*
 * 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()
}
+0 −20
Original line number Diff line number Diff line
@@ -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()
}
+0 −2
Original line number Diff line number Diff line
@@ -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() {}
+22 −0
Original line number Diff line number Diff line
/*
 * 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()
}