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

Commit 19b01af0 authored by burakov's avatar burakov
Browse files

Add an infix `to` as a shortcut for showing overlays.

This is analogous to the to(sceneKey) shortcut for changing scenes.

Bug: 353679003
Flag: com.android.systemui.scene_container
Test: Existing unit tests still pass.
Change-Id: I44b48979d1fc9f3de49074389e0da4566117dbed
parent 58736880
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -379,6 +379,10 @@ sealed class UserAction {
        return this to UserActionResult(toScene = scene)
    }

    infix fun to(overlay: OverlayKey): Pair<UserAction, UserActionResult> {
        return this to UserActionResult(toOverlay = overlay)
    }

    /** Resolve this into a [Resolved] user action given [layoutDirection]. */
    internal abstract fun resolve(layoutDirection: LayoutDirection): Resolved