1 /*
2 * Copyright (C) 2024 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.qs.composefragment.ui
18
19 import com.android.compose.animation.scene.TransitionBuilder
20 import com.android.systemui.qs.composefragment.SceneKeys
21 import com.android.systemui.qs.shared.ui.ElementKeys
22
TransitionBuildernull23 fun TransitionBuilder.quickQuickSettingsToQuickSettings(
24 animateTilesExpansion: () -> Boolean = { true }
25 ) {
26
<lambda>null27 fractionRange(start = 0.5f) { fade(ElementKeys.QuickSettingsContent) }
28
<lambda>null29 fractionRange(start = 0.9f) { fade(ElementKeys.FooterActions) }
30
31 anchoredTranslate(ElementKeys.QuickSettingsContent, ElementKeys.GridAnchor)
32
33 sharedElement(ElementKeys.TileElementMatcher, enabled = animateTilesExpansion())
34
35 // This will animate between 0f (QQS) and 0.6, fading in the QQS tiles when coming back
36 // from non first page QS. The QS content ends fading out at 0.5f, so there's a brief
37 // overlap, but because they are really faint, it looks better than complete black without
38 // overlap.
<lambda>null39 fractionRange(end = 0.6f) { fade(SceneKeys.QqsTileElementMatcher) }
40 anchoredTranslate(SceneKeys.QqsTileElementMatcher, ElementKeys.GridAnchor)
41 }
42