@@ -92,28 +92,28 @@ fun NavGraphBuilder.composableWithCompositionLocal(
9292 arguments : List <NamedNavArgument > = emptyList(),
9393 deepLinks : List <NavDeepLink > = emptyList(),
9494 enterTransition : (
95- @JvmSuppressWildcards
96- AnimatedContentTransitionScope < NavBackStackEntry >.() -> EnterTransition ?
95+ @JvmSuppressWildcards AnimatedContentTransitionScope < NavBackStackEntry >.()
96+ -> EnterTransition ?
9797 )? = {
9898 fadeIn(nonSpatialExpressiveSpring())
9999 },
100100 exitTransition : (
101- @JvmSuppressWildcards
102- AnimatedContentTransitionScope < NavBackStackEntry >.() -> ExitTransition ?
101+ @JvmSuppressWildcards AnimatedContentTransitionScope < NavBackStackEntry >.()
102+ -> ExitTransition ?
103103 )? = {
104104 fadeOut(nonSpatialExpressiveSpring())
105105 },
106106 popEnterTransition : (
107- @JvmSuppressWildcards
108- AnimatedContentTransitionScope < NavBackStackEntry >.() -> EnterTransition ?
107+ @JvmSuppressWildcards AnimatedContentTransitionScope < NavBackStackEntry >.()
108+ -> EnterTransition ?
109109 )? =
110110 enterTransition,
111111 popExitTransition : (
112- @JvmSuppressWildcards
113- AnimatedContentTransitionScope < NavBackStackEntry >.() -> ExitTransition ?
112+ @JvmSuppressWildcards AnimatedContentTransitionScope < NavBackStackEntry >.()
113+ -> ExitTransition ?
114114 )? =
115115 exitTransition,
116- content : @Composable AnimatedContentScope .(NavBackStackEntry ) -> Unit
116+ content : @Composable AnimatedContentScope .(NavBackStackEntry ) -> Unit ,
117117) {
118118 composable(
119119 route,
@@ -134,7 +134,7 @@ fun NavGraphBuilder.composableWithCompositionLocal(
134134
135135fun NavGraphBuilder.addHomeGraph (
136136 onSnackSelected : (Long , String , NavBackStackEntry ) -> Unit ,
137- modifier : Modifier = Modifier
137+ modifier : Modifier = Modifier ,
138138) {
139139 composable(HomeSections .FEED .route) { from ->
140140 Feed (
@@ -151,7 +151,7 @@ fun NavGraphBuilder.addHomeGraph(
151151 composable(
152152 HomeSections .CART .route,
153153 deepLinks = listOf (
154- navDeepLink { uriPattern = " https://jetsnack.example.com/home/cart" }
154+ navDeepLink { uriPattern = " https://jetsnack.example.com/home/cart" }
155155 )
156156 ) { from ->
157157 Cart (
@@ -164,15 +164,11 @@ fun NavGraphBuilder.addHomeGraph(
164164 }
165165}
166166
167- enum class HomeSections (
168- @StringRes val title : Int ,
169- val icon : ImageVector ,
170- val route : String
171- ) {
167+ enum class HomeSections (@StringRes val title : Int , val icon : ImageVector , val route : String ) {
172168 FEED (R .string.home_feed, Icons .Outlined .Home , " home/feed" ),
173169 SEARCH (R .string.home_search, Icons .Outlined .Search , " home/search" ),
174170 CART (R .string.home_cart, Icons .Outlined .ShoppingCart , " home/cart" ),
175- PROFILE (R .string.home_profile, Icons .Outlined .AccountCircle , " home/profile" )
171+ PROFILE (R .string.home_profile, Icons .Outlined .AccountCircle , " home/profile" ),
176172}
177173
178174@Composable
@@ -182,7 +178,7 @@ fun JetsnackBottomBar(
182178 navigateToRoute : (String ) -> Unit ,
183179 modifier : Modifier = Modifier ,
184180 color : Color = JetsnackTheme .colors.iconPrimary,
185- contentColor : Color = JetsnackTheme .colors.iconInteractive
181+ contentColor : Color = JetsnackTheme .colors.iconInteractive,
186182) {
187183 val routes = remember { tabs.map { it.route } }
188184 val currentSection = tabs.first { it.route == currentRoute }
@@ -251,7 +247,7 @@ private fun JetsnackBottomNavLayout(
251247 animSpec : AnimationSpec <Float >,
252248 indicator : @Composable BoxScope .() -> Unit ,
253249 modifier : Modifier = Modifier ,
254- content : @Composable () -> Unit
250+ content : @Composable () -> Unit ,
255251) {
256252 // Track how "selected" each item is [0, 1]
257253 val selectionFractions = remember(itemCount) {
@@ -328,11 +324,12 @@ fun JetsnackBottomNavigationItem(
328324 selected : Boolean ,
329325 onSelected : () -> Unit ,
330326 animSpec : AnimationSpec <Float >,
331- modifier : Modifier = Modifier
327+ modifier : Modifier = Modifier ,
332328) {
333329 // Animate the icon/text positions within the item based on selection
334330 val animationProgress by animateFloatAsState(
335- if (selected) 1f else 0f , animSpec,
331+ if (selected) 1f else 0f ,
332+ animSpec,
336333 label = " animation progress"
337334 )
338335 JetsnackBottomNavItemLayout (
@@ -350,7 +347,7 @@ private fun JetsnackBottomNavItemLayout(
350347 icon : @Composable BoxScope .() -> Unit ,
351348 text : @Composable BoxScope .() -> Unit ,
352349 @FloatRange(from = 0.0 , to = 1.0 ) animationProgress : Float ,
353- modifier : Modifier = Modifier
350+ modifier : Modifier = Modifier ,
354351) {
355352 Layout (
356353 modifier = modifier,
@@ -394,7 +391,7 @@ private fun MeasureScope.placeTextAndIcon(
394391 iconPlaceable : Placeable ,
395392 width : Int ,
396393 height : Int ,
397- @FloatRange(from = 0.0 , to = 1.0 ) animationProgress : Float
394+ @FloatRange(from = 0.0 , to = 1.0 ) animationProgress : Float ,
398395): MeasureResult {
399396 val iconY = (height - iconPlaceable.height) / 2
400397 val textY = (height - textPlaceable.height) / 2
@@ -415,7 +412,7 @@ private fun MeasureScope.placeTextAndIcon(
415412private fun JetsnackBottomNavIndicator (
416413 strokeWidth : Dp = 2.dp,
417414 color : Color = JetsnackTheme .colors.iconInteractive,
418- shape : Shape = BottomNavIndicatorShape
415+ shape : Shape = BottomNavIndicatorShape ,
419416) {
420417 Spacer (
421418 modifier = Modifier
0 commit comments