Skip to content

Commit

Permalink
Add search transition animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Oct 30, 2024
1 parent 0f4ee92 commit 6af69a6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.animation.slideOutHorizontally
import androidx.compose.animation.slideOutVertically
import androidx.navigation.NavBackStackEntry
import com.ramcosta.composedestinations.generated.destinations.NoDaemonDestination
import com.ramcosta.composedestinations.generated.destinations.SearchLocationDestination
import com.ramcosta.composedestinations.spec.DestinationStyle
import com.ramcosta.composedestinations.utils.destination
import net.mullvad.mullvadvpn.constant.SCREEN_ANIMATION_TIME_MILLIS
Expand Down Expand Up @@ -63,6 +64,7 @@ object SelectLocationTransition : DestinationStyle.Animated() {
{
when (targetState.destination()) {
NoDaemonDestination -> fadeOut(snap(SCREEN_ANIMATION_TIME_MILLIS))
SearchLocationDestination -> fadeOut()
else -> slideOutHorizontally { -it.withHorizontalScalingFactor() }
}
}
Expand All @@ -72,6 +74,7 @@ object SelectLocationTransition : DestinationStyle.Animated() {
{
when (initialState.destination()) {
NoDaemonDestination -> fadeIn(snap(0))
SearchLocationDestination -> fadeIn()
else -> slideInHorizontally { -it.withHorizontalScalingFactor() }
}
}
Expand Down

0 comments on commit 6af69a6

Please sign in to comment.