Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt +4 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ import com.android.systemui.scene.shared.model.TransitionKeys.SlightlyFasterShad import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade import com.android.systemui.scene.ui.composable.transitions.bouncerToGoneTransition import com.android.systemui.scene.ui.composable.transitions.bouncerToLockscreenPreview import com.android.systemui.scene.ui.composable.transitions.communalToBouncerTransition import com.android.systemui.scene.ui.composable.transitions.communalToShadeTransition import com.android.systemui.scene.ui.composable.transitions.goneToQuickSettingsTransition import com.android.systemui.scene.ui.composable.transitions.goneToShadeTransition import com.android.systemui.scene.ui.composable.transitions.goneToSplitShadeTransition Loading Loading @@ -89,6 +91,8 @@ val SceneContainerTransitions = transitions { sharedElement(Notifications.Elements.NotificationStackPlaceholder, enabled = false) sharedElement(Notifications.Elements.HeadsUpNotificationPlaceholder, enabled = false) } from(Scenes.Communal, to = Scenes.Shade) { communalToShadeTransition() } from(Scenes.Communal, to = Scenes.Bouncer) { communalToBouncerTransition() } // Overlay transitions Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromCommunalToBouncerTransition.kt 0 → 100644 +23 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.scene.ui.composable.transitions import com.android.compose.animation.scene.TransitionBuilder fun TransitionBuilder.communalToBouncerTransition() { toBouncerTransition() } packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromCommunalToShadeTransition.kt 0 → 100644 +23 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.scene.ui.composable.transitions import com.android.compose.animation.scene.TransitionBuilder fun TransitionBuilder.communalToShadeTransition() { toShadeTransition() } packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToBouncerTransition.kt +1 −19 Original line number Diff line number Diff line package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.CubicBezierEasing import androidx.compose.animation.core.tween import androidx.compose.ui.unit.dp import com.android.compose.animation.scene.TransitionBuilder import com.android.compose.animation.scene.UserActionDistance import com.android.systemui.bouncer.ui.composable.Bouncer const val FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION = 0.5f const val FROM_LOCK_SCREEN_TO_BOUNCER_SWIPE_DISTANCE_FRACTION = 0.5f fun TransitionBuilder.lockscreenToBouncerTransition() { spec = tween(durationMillis = 500) distance = UserActionDistance { fromSceneSize, _ -> fromSceneSize.height * FROM_LOCK_SCREEN_TO_BOUNCER_SWIPE_DISTANCE_FRACTION } translate(Bouncer.Elements.Content, y = 300.dp) fractionRange(end = FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Background) } fractionRange(start = FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Content) } toBouncerTransition() } fun TransitionBuilder.bouncerToLockscreenPreview() { Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/ToBouncerTransition.kt 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.tween import androidx.compose.ui.unit.dp import com.android.compose.animation.scene.TransitionBuilder import com.android.compose.animation.scene.UserActionDistance import com.android.systemui.bouncer.ui.composable.Bouncer const val TO_BOUNCER_FADE_FRACTION = 0.5f private const val TO_BOUNCER_SWIPE_DISTANCE_FRACTION = 0.5f fun TransitionBuilder.toBouncerTransition() { spec = tween(durationMillis = 500) distance = UserActionDistance { fromSceneSize, _ -> fromSceneSize.height * TO_BOUNCER_SWIPE_DISTANCE_FRACTION } translate(Bouncer.Elements.Content, y = 300.dp) fractionRange(end = TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Background) } fractionRange(start = TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Content) } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneContainerTransitions.kt +4 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ import com.android.systemui.scene.shared.model.TransitionKeys.SlightlyFasterShad import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade import com.android.systemui.scene.ui.composable.transitions.bouncerToGoneTransition import com.android.systemui.scene.ui.composable.transitions.bouncerToLockscreenPreview import com.android.systemui.scene.ui.composable.transitions.communalToBouncerTransition import com.android.systemui.scene.ui.composable.transitions.communalToShadeTransition import com.android.systemui.scene.ui.composable.transitions.goneToQuickSettingsTransition import com.android.systemui.scene.ui.composable.transitions.goneToShadeTransition import com.android.systemui.scene.ui.composable.transitions.goneToSplitShadeTransition Loading Loading @@ -89,6 +91,8 @@ val SceneContainerTransitions = transitions { sharedElement(Notifications.Elements.NotificationStackPlaceholder, enabled = false) sharedElement(Notifications.Elements.HeadsUpNotificationPlaceholder, enabled = false) } from(Scenes.Communal, to = Scenes.Shade) { communalToShadeTransition() } from(Scenes.Communal, to = Scenes.Bouncer) { communalToBouncerTransition() } // Overlay transitions Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromCommunalToBouncerTransition.kt 0 → 100644 +23 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.scene.ui.composable.transitions import com.android.compose.animation.scene.TransitionBuilder fun TransitionBuilder.communalToBouncerTransition() { toBouncerTransition() }
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromCommunalToShadeTransition.kt 0 → 100644 +23 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.scene.ui.composable.transitions import com.android.compose.animation.scene.TransitionBuilder fun TransitionBuilder.communalToShadeTransition() { toShadeTransition() }
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToBouncerTransition.kt +1 −19 Original line number Diff line number Diff line package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.CubicBezierEasing import androidx.compose.animation.core.tween import androidx.compose.ui.unit.dp import com.android.compose.animation.scene.TransitionBuilder import com.android.compose.animation.scene.UserActionDistance import com.android.systemui.bouncer.ui.composable.Bouncer const val FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION = 0.5f const val FROM_LOCK_SCREEN_TO_BOUNCER_SWIPE_DISTANCE_FRACTION = 0.5f fun TransitionBuilder.lockscreenToBouncerTransition() { spec = tween(durationMillis = 500) distance = UserActionDistance { fromSceneSize, _ -> fromSceneSize.height * FROM_LOCK_SCREEN_TO_BOUNCER_SWIPE_DISTANCE_FRACTION } translate(Bouncer.Elements.Content, y = 300.dp) fractionRange(end = FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Background) } fractionRange(start = FROM_LOCK_SCREEN_TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Content) } toBouncerTransition() } fun TransitionBuilder.bouncerToLockscreenPreview() { Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/ToBouncerTransition.kt 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.scene.ui.composable.transitions import androidx.compose.animation.core.tween import androidx.compose.ui.unit.dp import com.android.compose.animation.scene.TransitionBuilder import com.android.compose.animation.scene.UserActionDistance import com.android.systemui.bouncer.ui.composable.Bouncer const val TO_BOUNCER_FADE_FRACTION = 0.5f private const val TO_BOUNCER_SWIPE_DISTANCE_FRACTION = 0.5f fun TransitionBuilder.toBouncerTransition() { spec = tween(durationMillis = 500) distance = UserActionDistance { fromSceneSize, _ -> fromSceneSize.height * TO_BOUNCER_SWIPE_DISTANCE_FRACTION } translate(Bouncer.Elements.Content, y = 300.dp) fractionRange(end = TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Background) } fractionRange(start = TO_BOUNCER_FADE_FRACTION) { fade(Bouncer.Elements.Content) } }