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

Commit b23c2773 authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

Add 'isTransitioningBetween' and 'isTransitioningFromOrTo' in observable

Bug: 353679003
Flag: com.android.systemui.scene_container
Test: Existing unit tests still pass.
Change-Id: I002ce25064c73b1417839367ac2271c63d5771d9
parent 886da50c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -206,6 +206,17 @@ sealed interface ObservableTransitionState {
            (from == null || this.fromContent == from) &&
            (to == null || this.toContent == to)
    }

    /** Whether we are transitioning from [content] to [other], or from [other] to [content]. */
    fun isTransitioningBetween(content: ContentKey, other: ContentKey): Boolean {
        return isTransitioning(from = content, to = other) ||
            isTransitioning(from = other, to = content)
    }

    /** Whether we are transitioning from or to [content]. */
    fun isTransitioningFromOrTo(content: ContentKey): Boolean {
        return isTransitioning(from = content) || isTransitioning(to = content)
    }
}

/**