Skip to content

Commit

Permalink
Fix navigation transitions to be less distracting (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahkeen authored Aug 20, 2024
1 parent 8d9b3af commit 409321a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideIn
import androidx.compose.animation.slideOut
import androidx.compose.animation.scaleIn
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
Expand All @@ -20,7 +20,6 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.IntOffset
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavDestination
import androidx.navigation.NavHostController
Expand Down Expand Up @@ -108,10 +107,9 @@ fun App() {
.fillMaxSize()
.padding(innerPadding),
navController = navController,
enterTransition = { slideIn { IntOffset(x = it.width, y = 0) } },
exitTransition = { slideOut { IntOffset(x = -it.width / 3, y = 0) } + fadeOut() },
popEnterTransition = { slideIn { IntOffset(x = -it.width, y = 0) } },
popExitTransition = { slideOut { IntOffset(x = it.width, y = 0) } },
enterTransition = { scaleIn(initialScale = 1.05f) + fadeIn() },
exitTransition = { fadeOut() },
popEnterTransition = { scaleIn(initialScale = 0.95f) + fadeIn() },
startDestination = Stories
) {
storiesGraph(navController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import com.emergetools.hackernews.features.comments.CommentsDestinations
import com.emergetools.hackernews.features.stories.components.FeedErrorCard
Expand Down

0 comments on commit 409321a

Please sign in to comment.