Introduce SharedElement transitions with NestedSTLs
This is a first iteration to support shared elements across nestedSTLs. This version has several limitations that may be addressed in future CLs. The main mechanism to drive this is by sharing the elements map and the lookaheadScope of all nestedSTLs. This means that they also share Element.stateByContent. Each child writes a reference of its state to its own content but also one into each contentKey of where it is composed in its parent. Before `stateByContent` would hold a state for each content that would compose an element, after this change it also holds a state when any of the nestedSTLs compose this element. This means that always the STL with the lowest nestingDepth has to render the element as the element is not actually placed in the other scene of that transition. Known limitations are: - Interruptions are not supported (will jump cut) - Side-by-side NestedSTLs are not supported. That means if we have a ParentSTL that contains NestedSTL1 and NestedSTL2 then a shared element can be transitioned between the ParentSTL and the NestedSTLs but not between NestedSTL1 and NestedSTL2. Multiple nesting layers are supported though, so ParentSTL > NestedSTL1 > NestedNestedSTL1 would support sharing between any of them. - If the sharedElement appears more than two times on the screen (due to multiple transitions of multiple STLs transitioning at the same time) the behavior is not supported. - A sharedElement can't be present twice in the same hierachy. Meaning that ParentSTL sceneA contains an element. There can't be a NestedSTL on the same scene that would contain the same element in any of its scenes. This would result in a conflict of the idle state. - Currently the sharedElement is always rendered in the ParentSTL during transitions. We don't support more control for this behavior as we do for normal sharedElements yet. - If you disable a sharedElement transition for a specific transition you can only reference the element in the parentSTL to define a custom transition. This is a general limitation where you can't reference elements within NestedSTLs in transition DSL. - NestedSTls are not allowed to share the same contentkeys Test: Manual test app added + Units tests added Bug: b/376659778 Flag: NONE not in production yet Change-Id: I0478d4f73f189e506ace39f2b3544ea6acc75ead
Loading
Please register or sign in to comment