Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(RC): adjust transition animations according to the design documentation [WPB-1817] #2169

Merged
merged 6 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.rememberAnimatedNavHostEngine
import com.ramcosta.composedestinations.navigation.dependency
import com.ramcosta.composedestinations.spec.Route
import com.wire.android.navigation.style.DefaultNestedNavGraphAnimations
import com.wire.android.navigation.style.DefaultRootNavGraphAnimations
import com.wire.android.ui.NavGraphs
import com.wire.android.ui.home.newconversation.NewConversationViewModel

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Wire
* Copyright (C) 2023 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.wire.android.navigation.style

import androidx.compose.animation.ExperimentalAnimationApi
import com.ramcosta.composedestinations.animations.defaults.NestedNavGraphDefaultAnimations
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations

@OptIn(ExperimentalAnimationApi::class)
val DefaultRootNavGraphAnimations = RootNavGraphDefaultAnimations(
enterTransition = { with(DefaultNavigationAnimation) { enterTransition() } },
exitTransition = { with(DefaultNavigationAnimation) { exitTransition() } },
popEnterTransition = { with(DefaultNavigationAnimation) { popEnterTransition() } },
popExitTransition = { with(DefaultNavigationAnimation) { popExitTransition() } },
)

@OptIn(ExperimentalAnimationApi::class)
val DefaultNestedNavGraphAnimations = NestedNavGraphDefaultAnimations(
enterTransition = { with(DefaultNavigationAnimation) { enterTransition() } },
exitTransition = { with(DefaultNavigationAnimation) { exitTransition() } },
popEnterTransition = { with(DefaultNavigationAnimation) { popEnterTransition() } },
popExitTransition = { with(DefaultNavigationAnimation) { popExitTransition() } },
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Wire
* Copyright (C) 2023 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

package com.wire.android.navigation.style

typealias DefaultNavigationAnimation = SlideNavigationAnimation

object SlideNavigationAnimation : WireDestinationStyleAnimated {
override fun animationType(): TransitionAnimationType = TransitionAnimationType.SLIDE
}

object PopUpNavigationAnimation : WireDestinationStyleAnimated {
override fun animationType(): TransitionAnimationType = TransitionAnimationType.POP_UP
}

object WakeUpScreenPopUpNavigationAnimation : WireDestinationStyleAnimated, ScreenModeStyle {
override fun animationType(): TransitionAnimationType = TransitionAnimationType.POP_UP
override fun screenMode(): ScreenMode = ScreenMode.WAKE_UP
}

object KeepOnScreenPopUpNavigationAnimation : WireDestinationStyleAnimated, ScreenModeStyle {
override fun animationType(): TransitionAnimationType = TransitionAnimationType.POP_UP
override fun screenMode(): ScreenMode = ScreenMode.KEEP_ON
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Wire
* Copyright (C) 2023 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.wire.android.navigation.style

interface ScreenModeStyle {
fun screenMode(): ScreenMode
}

enum class ScreenMode {
KEEP_ON, // keep screen on while that NavigationItem is visible (i.e CallScreen)
WAKE_UP, // wake up the device on navigating to that NavigationItem (i.e IncomingCall)
NONE // do not wake up and allow device to sleep
}
Loading
Loading