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

Commit d7e8d00a authored by Shawn Lee's avatar Shawn Lee Committed by Android (Google) Code Review
Browse files

Merge "Move OpenCloseListener and TrackingStartedListener out of ShadeViewController" into main

parents 9109075f 7506d8e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1540,13 +1540,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
@@ -52,15 +52,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.
     *
@@ -250,17 +244,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
@@ -43,10 +43,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()
}