[flexiglass] SceneDataSource.
In order to support the new TransitionKey API in SceneTransitionLayout (STL), we must switch from using HoistedSceneTransitionLayoutState to using MutableSceneTransitionLayoutState. Unlike HoistedSceneTransitionLayoutState, the MutableSceneTransitionLayoutState keeps the source of truth of the current scene within itself, forcing us to change our architecture in order to source the state of the current scene from MutableSceneTransitionLayoutState and not from our own repository. This is the first CL in a chain. Here we introduce the SceneDataSource interface which, in the next CL, will be used by our SceneContainerRepository as the new source of truth. Complicating matters is the fact that MutableSceneTransitionLayoutState is a Compose-aware construct that must be instantiated (and bound to) within an @Composable function. Therefore, we introduce both SceneTransitionLayoutDataSource (a MutableSceneTransitionLayoutState based implementation of SceneDataSource) and SceneDataSourceDelegator which also implements SceneDataSource and can be provided into our Dagger graph as a normal dependency in build-time but can receive a SceneDataSource as a delegate, during runtime. By doing that, we allow our code in the data layer (the repository) depend on an object provided from the UI layer (the composable) without breaking the Clean Architecture Dependency Rule and without adding a dependency on Jetpack Compose from a part of the codebase that's not yet allowed to do that. Bug: 323173116 Test: unit test included Test: unit tests updated in following CL(s) Test: manual verification done with following CL(s) Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT Change-Id: Ic1aa6aafb6bc8b7d8a133e441a782d377b1ff4e4
Loading
Please register or sign in to comment