-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Add animatedComposable to replace composable to add animati…
…ons (#741) * refactor: add animatedComposable * refactor: replace composable with animatedComposable * lint: run ktlintFormat
- Loading branch information
1 parent
0511002
commit 554cc26
Showing
12 changed files
with
58 additions
and
91 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
core/ui/src/main/java/dev/anilbeesetti/nextplayer/core/ui/designsystem/AnimatedComposable.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,34 @@ | ||
package dev.anilbeesetti.nextplayer.core.ui.designsystem | ||
|
||
import androidx.compose.animation.AnimatedVisibilityScope | ||
import androidx.compose.animation.core.tween | ||
import androidx.compose.animation.fadeIn | ||
import androidx.compose.animation.fadeOut | ||
import androidx.compose.animation.slideInHorizontally | ||
import androidx.compose.animation.slideOutHorizontally | ||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.NamedNavArgument | ||
import androidx.navigation.NavBackStackEntry | ||
import androidx.navigation.NavDeepLink | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
|
||
fun NavGraphBuilder.animatedComposable( | ||
route: String, | ||
arguments: List<NamedNavArgument> = emptyList(), | ||
deepLinks: List<NavDeepLink> = emptyList(), | ||
content: @Composable AnimatedVisibilityScope.(NavBackStackEntry) -> Unit | ||
) = composable( | ||
route = route, | ||
arguments = arguments, | ||
deepLinks = deepLinks, | ||
enterTransition = { | ||
slideInHorizontally(initialOffsetX = { it }, animationSpec = tween(220, delayMillis = 90)) + fadeIn(animationSpec = tween(220, delayMillis = 90)) | ||
}, | ||
exitTransition = null, | ||
popEnterTransition = null, | ||
popExitTransition = { | ||
slideOutHorizontally(targetOffsetX = { it }, animationSpec = tween(220)) + fadeOut(animationSpec = tween(220)) | ||
}, | ||
content = content | ||
) |
13 changes: 0 additions & 13 deletions
13
...ui/src/main/java/dev/anilbeesetti/nextplayer/core/ui/designsystem/NavigationAnimations.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
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
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
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
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
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
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
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
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
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