Skip to content

Commit 7ea4394

Browse files
authored
Merge pull request #503 from kiwicom/renovate/androidx
fix(deps): update dependency androidx.navigation:navigation-compose to v2.7.0
2 parents 852b1ff + 2e5d614 commit 7ea4394

File tree

31 files changed

+106
-61
lines changed

31 files changed

+106
-61
lines changed

catalog/src/main/java/kiwi/orbit/compose/catalog/CatalogApplication.kt

+45
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
package kiwi.orbit.compose.catalog
22

3+
import androidx.compose.animation.EnterTransition
4+
import androidx.compose.animation.ExitTransition
5+
import androidx.compose.animation.core.FastOutLinearInEasing
6+
import androidx.compose.animation.core.LinearOutSlowInEasing
7+
import androidx.compose.animation.core.tween
8+
import androidx.compose.animation.fadeIn
9+
import androidx.compose.animation.fadeOut
10+
import androidx.compose.animation.slideInHorizontally
11+
import androidx.compose.animation.slideOutHorizontally
312
import androidx.compose.foundation.isSystemInDarkTheme
413
import androidx.compose.runtime.Composable
514
import androidx.compose.runtime.SideEffect
@@ -8,6 +17,9 @@ import androidx.compose.runtime.mutableStateOf
817
import androidx.compose.runtime.saveable.rememberSaveable
918
import androidx.compose.runtime.setValue
1019
import androidx.compose.ui.graphics.Color
20+
import androidx.compose.ui.platform.LocalDensity
21+
import androidx.compose.ui.unit.Density
22+
import androidx.compose.ui.unit.dp
1123
import androidx.navigation.compose.NavHost
1224
import androidx.navigation.compose.rememberNavController
1325
import com.google.accompanist.systemuicontroller.rememberSystemUiController
@@ -86,11 +98,16 @@ fun CatalogApplication() {
8698
private fun NavGraph(
8799
onToggleTheme: () -> Unit,
88100
) {
101+
val density = LocalDensity.current
89102
val navController = rememberNavController()
90103

91104
NavHost(
92105
navController = navController,
93106
startDestination = createRoutePattern<Destinations.Main>(),
107+
enterTransition = { SharedXAxisEnterTransition(density) },
108+
exitTransition = { SharedXAxisExitTransition(density) },
109+
popEnterTransition = { SharedXAxisPopEnterTransition(density) },
110+
popExitTransition = { SharedXAxisPopExitTransition(density) },
94111
) {
95112
composable<Destinations.Main> { MainScreen(navController::navigate, onToggleTheme) }
96113

@@ -137,3 +154,31 @@ private fun NavGraph(
137154
topAppBarNavigation<Destinations.TopAppBar>(navController)
138155
}
139156
}
157+
158+
private val SharedXAxisEnterTransition: (Density) -> EnterTransition = { density ->
159+
fadeIn(animationSpec = tween(durationMillis = 210, delayMillis = 90, easing = LinearOutSlowInEasing)) +
160+
slideInHorizontally(animationSpec = tween(durationMillis = 300)) {
161+
with(density) { 30.dp.roundToPx() }
162+
}
163+
}
164+
165+
private val SharedXAxisPopEnterTransition: (Density) -> EnterTransition = { density ->
166+
fadeIn(animationSpec = tween(durationMillis = 210, delayMillis = 90, easing = LinearOutSlowInEasing)) +
167+
slideInHorizontally(animationSpec = tween(durationMillis = 300)) {
168+
with(density) { (-30).dp.roundToPx() }
169+
}
170+
}
171+
172+
private val SharedXAxisExitTransition: (Density) -> ExitTransition = { density ->
173+
fadeOut(animationSpec = tween(durationMillis = 90, easing = FastOutLinearInEasing)) +
174+
slideOutHorizontally(animationSpec = tween(durationMillis = 300)) {
175+
with(density) { (-30).dp.roundToPx() }
176+
}
177+
}
178+
179+
private val SharedXAxisPopExitTransition: (Density) -> ExitTransition = { density ->
180+
fadeOut(animationSpec = tween(durationMillis = 90, easing = FastOutLinearInEasing)) +
181+
slideOutHorizontally(animationSpec = tween(durationMillis = 300)) {
182+
with(density) { 30.dp.roundToPx() }
183+
}
184+
}

gradle/libs.versions.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22

3-
compileSdk = "33"
3+
compileSdk = "34"
44
targetSdk = "33"
55
minSdk = "23"
66

@@ -50,7 +50,7 @@ compose-material = { module = "androidx.compose.material:material" }
5050
compose-material3 = "androidx.compose.material3:material3:1.1.1"
5151
compose-materialRipple = { module = "androidx.compose.material:material-ripple" }
5252
compose-materialIconsExtended = { module = "androidx.compose.material:material-icons-extended" }
53-
compose-navigation = { module = "androidx.navigation:navigation-compose", version = "2.6.0" }
53+
compose-navigation = { module = "androidx.navigation:navigation-compose", version = "2.7.0" }
5454
compose-runtime = { module = "androidx.compose.runtime:runtime" }
5555
compose-runtimeLivedata = { module = "androidx.compose.runtime:runtime-livedata" }
5656
compose-tooling = { module = "androidx.compose.ui:ui-tooling" }
@@ -62,7 +62,7 @@ compose-uiTestManifest = { module = "androidx.compose.ui:ui-test-manifest" }
6262
compose-uiUtil = { module = "androidx.compose.ui:ui-util" }
6363
compose-viewBinding = { module = "androidx.compose.ui:ui-viewbinding" }
6464
hamcrest = { module = "org.hamcrest:hamcrest-all", version = "1.3" }
65-
javaJq = { module = "net.thisptr:jackson-jq", version="1.0.0-preview.20230409" }
65+
javaJq = { module = "net.thisptr:jackson-jq", version = "1.0.0-preview.20230409" }
6666
junit = { module = "junit:junit", version = "4.13.2" }
6767
kiwi-navigationComposeTyped = { module = "com.kiwi.navigation-compose.typed:core", version = "0.6.2" }
6868
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)