diff options
| -rw-r--r-- | packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt index 9f2ac24b844e..30eb302b3bcb 100644 --- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt +++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt @@ -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) + } } /** |