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

Commit 9f80a2c0 authored by Justin Weir's avatar Justin Weir Committed by Automerger Merge Worker
Browse files

Merge "Make addExpansionListener not send a change event on add" into udc-dev am: 79232399

parents 93a9ece9 79232399
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ constructor(
    fun enable(onPanelInteraction: Runnable) {
        if (action == null) {
            action = Action(onPanelInteraction)
            shadeExpansionStateManager.addShadeExpansionListener(this::onPanelExpansionChanged)
            shadeExpansionStateManager.addExpansionListener(this::onPanelExpansionChanged)
        } else {
            Log.e(TAG, "Already enabled")
        }
+3 −1
Original line number Diff line number Diff line
@@ -108,7 +108,9 @@ abstract class UdfpsAnimationViewController<T : UdfpsAnimationView>(
    }

    override fun onViewAttached() {
        val currentState =
            shadeExpansionStateManager.addExpansionListener(shadeExpansionListener)
        shadeExpansionListener.onPanelExpansionChanged(currentState)
        dialogManager.registerListener(dialogListener)
        dumpManager.registerDumpable(dumpTag, this)
    }
+2 −1
Original line number Diff line number Diff line
@@ -290,7 +290,8 @@ constructor(
        qsExpansion = keyguardViewManager.qsExpansion
        keyguardViewManager.addCallback(statusBarKeyguardViewManagerCallback)
        configurationController.addCallback(configurationListener)
        shadeExpansionStateManager.addExpansionListener(shadeExpansionListener)
        val currentState = shadeExpansionStateManager.addExpansionListener(shadeExpansionListener)
        shadeExpansionListener.onPanelExpansionChanged(currentState)
        updateScaleFactor()
        view.updatePadding()
        updateAlpha()
+3 −1
Original line number Diff line number Diff line
@@ -480,7 +480,9 @@ public class NotificationShadeWindowViewController {
        setDragDownHelper(mLockscreenShadeTransitionController.getTouchHelper());

        mDepthController.setRoot(mView);
        ShadeExpansionChangeEvent currentState =
                mShadeExpansionStateManager.addExpansionListener(mDepthController);
        mDepthController.onPanelExpansionChanged(currentState);
    }

    public NotificationShadeWindowView getView() {
+4 −13
Original line number Diff line number Diff line
@@ -49,23 +49,14 @@ class ShadeExpansionStateManager @Inject constructor() : ShadeStateEvents {
    private var dragDownPxAmount: Float = 0f

    /**
     * Adds a listener that will be notified when the panel expansion fraction has changed.
     * Adds a listener that will be notified when the panel expansion fraction has changed and
     * returns the current state in a ShadeExpansionChangeEvent for legacy purposes (b/23035507).
     *
     * Listener will also be immediately notified with the current values.
     */
    fun addExpansionListener(listener: ShadeExpansionListener) {
        addShadeExpansionListener(listener)
        listener.onPanelExpansionChanged(
            ShadeExpansionChangeEvent(fraction, expanded, tracking, dragDownPxAmount)
        )
    }

    /**
     * Adds a listener that will be notified when the panel expansion fraction has changed.
     * @see #addExpansionListener
     */
    fun addShadeExpansionListener(listener: ShadeExpansionListener) {
    fun addExpansionListener(listener: ShadeExpansionListener): ShadeExpansionChangeEvent {
        expansionListeners.add(listener)
        return ShadeExpansionChangeEvent(fraction, expanded, tracking, dragDownPxAmount)
    }

    /** Removes an expansion listener. */
Loading