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

Commit 55217ac5 authored by Danny Burakov's avatar Danny Burakov Committed by Android (Google) Code Review
Browse files

Merge "Invocation shortcut for creating user action results that show overlays." into main

parents f33d2b23 f8b2d0b2
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -550,6 +550,22 @@ sealed class UserActionResult(
             */
            requiresFullDistanceSwipe: Boolean = false,
        ): UserActionResult = ChangeScene(toScene, transitionKey, requiresFullDistanceSwipe)

        /** A [UserActionResult] that shows [toOverlay]. */
        operator fun invoke(
            /** The overlay we should be transitioning to during the [UserAction]. */
            toOverlay: OverlayKey,

            /** The key of the transition that should be used. */
            transitionKey: TransitionKey? = null,

            /**
             * If `true`, the swipe will be committed if only if the user swiped at least the swipe
             * distance, i.e. the transition progress was already equal to or bigger than 100% when
             * the user released their finger.
             */
            requiresFullDistanceSwipe: Boolean = false,
        ): UserActionResult = ShowOverlay(toOverlay, transitionKey, requiresFullDistanceSwipe)
    }
}