-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(RC): adjust transition animations according to the design documen…
…tation [WPB-1817] (#2169)
- Loading branch information
Showing
24 changed files
with
358 additions
and
225 deletions.
There are no files selected for viewing
54 changes: 0 additions & 54 deletions
54
app/src/main/kotlin/com/wire/android/navigation/NavigationAnimationConfig.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 0 additions & 64 deletions
64
app/src/main/kotlin/com/wire/android/navigation/NavigationStyleConfig.kt
This file was deleted.
Oops, something went wrong.
84 changes: 0 additions & 84 deletions
84
app/src/main/kotlin/com/wire/android/navigation/TransitionAnimations.kt
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
app/src/main/kotlin/com/wire/android/navigation/style/DefaultNavGraphAnimations.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() } }, | ||
) |
39 changes: 39 additions & 0 deletions
39
app/src/main/kotlin/com/wire/android/navigation/style/NavigationAnimationStyles.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/kotlin/com/wire/android/navigation/style/ScreenModeStyle.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.