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

Commit 46227c33 authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge changes Id046ca42,I2dc80993 into main

* changes:
  [flexiglass] Verify flexi only NSSL methods are not called in legacy
  [flexiglass] Remove ScrollViewFields#headsupHeightConsumer
parents 55b183e7 3d21f63d
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -1160,11 +1160,13 @@ public class NotificationStackScrollLayout

    @Override
    public void addHeadsUpHeightChangedListener(@NonNull Runnable runnable) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mHeadsUpHeightChangedListeners.addIfAbsent(runnable);
    }

    @Override
    public void removeHeadsUpHeightChangedListener(@NonNull Runnable runnable) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mHeadsUpHeightChangedListeners.remove(runnable);
    }

@@ -1240,11 +1242,13 @@ public class NotificationStackScrollLayout

    @Override
    public void setScrolledToTop(boolean scrolledToTop) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mScrollViewFields.setScrolledToTop(scrolledToTop);
    }

    @Override
    public void setStackTop(float stackTop) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        if (mAmbientState.getStackTop() != stackTop) {
            mAmbientState.setStackTop(stackTop);
            onTopPaddingChanged(/* animate = */ isAddOrRemoveAnimationPending());
@@ -1253,51 +1257,54 @@ public class NotificationStackScrollLayout

    @Override
    public void setStackCutoff(float stackCutoff) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mAmbientState.setStackCutoff(stackCutoff);
    }

    @Override
    public void setHeadsUpTop(float headsUpTop) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mAmbientState.setHeadsUpTop(headsUpTop);
        requestChildrenUpdate();
    }

    @Override
    public void setHeadsUpBottom(float headsUpBottom) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mAmbientState.setHeadsUpBottom(headsUpBottom);
        mStateAnimator.setHeadsUpAppearHeightBottom(Math.round(headsUpBottom));
    }

    @Override
    public void closeGutsOnSceneTouch() {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mController.closeControlsDueToOutsideTouch();
    }

    @Override
    public void setSyntheticScrollConsumer(@Nullable Consumer<Float> consumer) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mScrollViewFields.setSyntheticScrollConsumer(consumer);
    }

    @Override
    public void setCurrentGestureOverscrollConsumer(@Nullable Consumer<Boolean> consumer) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mScrollViewFields.setCurrentGestureOverscrollConsumer(consumer);
    }

    @Override
    public void setCurrentGestureInGutsConsumer(@Nullable Consumer<Boolean> consumer) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mScrollViewFields.setCurrentGestureInGutsConsumer(consumer);
    }

    @Override
    public void setRemoteInputRowBottomBoundConsumer(@Nullable Consumer<Float> consumer) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mScrollViewFields.setRemoteInputRowBottomBoundConsumer(consumer);
    }

    @Override
    public void setHeadsUpHeightConsumer(@Nullable Consumer<Float> consumer) {
        mScrollViewFields.setHeadsUpHeightConsumer(consumer);
    }

    /**
     * @param listener to be notified after the location of Notification children might have
     *                 changed.
@@ -2621,11 +2628,13 @@ public class NotificationStackScrollLayout

    @Override
    public int getTopHeadsUpHeight() {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0;
        return getTopHeadsUpIntrinsicHeight();
    }

    @Override
    public int getHeadsUpInset() {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0;
        return mHeadsUpInset;
    }

+0 −3
Original line number Diff line number Diff line
@@ -86,9 +86,6 @@ class ScrollViewFields {
    fun sendRemoteInputRowBottomBound(bottomY: Float?) =
        remoteInputRowBottomBoundConsumer?.accept(bottomY)

    /** send the [headsUpHeight] to the [headsUpHeightConsumer], if present. */
    fun sendHeadsUpHeight(headsUpHeight: Float) = headsUpHeightConsumer?.accept(headsUpHeight)

    fun dump(pw: IndentingPrintWriter) {
        pw.printSection("StackViewStates") {
            pw.println("scrimClippingShape", scrimClippingShape)
+0 −3
Original line number Diff line number Diff line
@@ -77,9 +77,6 @@ interface NotificationScrollView {
    /** Set a consumer for current remote input notification row bottom bound events */
    fun setRemoteInputRowBottomBoundConsumer(consumer: Consumer<Float?>?)

    /** Set a consumer for heads up height changed events */
    fun setHeadsUpHeightConsumer(consumer: Consumer<Float>?)

    /** sets that scrolling is allowed */
    fun setScrollingEnabled(enabled: Boolean)