1 /*
2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.systemui.scene.shared.model
18 
19 /** Models the configuration of the scene container. */
20 data class SceneContainerConfig(
21 
22     /**
23      * The keys to all scenes in the container, sorted by z-order such that the last one renders on
24      * top of all previous ones. Scene keys within the same container must not repeat but it's okay
25      * to have the same scene keys in different containers.
26      */
27     val sceneKeys: List<SceneKey>,
28 
29     /**
30      * The key of the scene that is the initial current scene when the container is first set up,
31      * before taking any application state in to account.
32      */
33     val initialSceneKey: SceneKey,
34 ) {
35     init {
36         check(sceneKeys.isNotEmpty()) { "A container must have at least one scene key." }
37 
38         check(sceneKeys.contains(initialSceneKey)) {
39             "The initial key \"$initialSceneKey\" is not present in this container."
40         }
41     }
42 }
43