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

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

Merge "Add 'isTransitioningBetween' and 'isTransitioningFromOrTo' in observable" into main

parents d6204017 b23c2773
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)
    }
}

/**