Skip to content

Commit

Permalink
Merge pull request #105 from trambui09/pb-navhost
Browse files Browse the repository at this point in the history
Change predictive back NavHost implementation
  • Loading branch information
trambui09 authored Nov 12, 2024
2 parents 62dbb26 + 1b84375 commit 67d823a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ import android.app.Activity
import android.content.Intent
import android.content.pm.ActivityInfo
import android.os.Bundle
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.scaleIn
import androidx.compose.animation.scaleOut
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.platform.LocalContext
import androidx.navigation.NavController
import androidx.navigation.NavDestination
Expand Down Expand Up @@ -82,11 +83,14 @@ fun MainNavigation(
NavHost(
navController = navController,
startDestination = "home",
popEnterTransition = {
scaleIn(initialScale = 1.1F) + fadeIn()
},
popExitTransition = {
scaleOut(targetScale = 0.9F) + fadeOut()
scaleOut(
targetScale = 0.9f,
transformOrigin = TransformOrigin(pivotFractionX = 0.5f, pivotFractionY = 0.5f),
)
},
popEnterTransition = {
EnterTransition.None
},
modifier = modifier,
) {
Expand Down
16 changes: 8 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[versions]
accompanist = "0.32.0"
activity = "1.9.0-rc01"
activity = "1.9.3"
agp = "8.2.2"
benchmarkMacroJunit4 = "1.2.3"
baselineprofile = "1.2.3"
Expand All @@ -28,26 +28,26 @@ concurrent = "1.1.0"
core = "1.12.0"
core-splashscreen = "1.0.1"
espresso = "3.5.1"
graphics = "1.0.0-alpha05"
graphics = "1.0.1"
hilt = "2.49"
hiltNavigationCompose = "1.2.0"
junit = "4.13.2"
kotlin = "1.9.20"
ksp = "1.9.20-1.0.14"
lifecycle = "2.7.0"
material3 = "1.2.1"
material3 = "1.3.1"
media3 = "1.4.0-rc01"
navigation = "2.8.0-alpha07"
profileinstaller = "1.3.1"
navigation = "2.8.3"
profileinstaller = "1.4.1"
room = "2.6.1"
spotless = "6.24.0"
test = "1.1.5"
test = "1.2.1"
truth = "1.1.3"
turbine = "1.0.0"
uiautomator = "2.3.0"
window = "1.2.0"
material3-adaptive-navigation-suite = "1.0.0-alpha05"
glance = "1.1.0-alpha01"
material3-adaptive-navigation-suite = "1.3.1"
glance = "1.1.1"
secrets = "2.0.1"
generativeai = "0.7.0"
datastore = "1.0.0"
Expand Down

0 comments on commit 67d823a

Please sign in to comment.