From 56507dace1add7cf810bcccbdb222a6091b9c7d5 Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Wed, 14 Aug 2024 14:18:01 +0200 Subject: [PATCH] Add MainScreenFab to the navigation rail --- .../main/components/AppNavigationSuiteScaffold.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt index 2846b4bb1..b7490093d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/components/AppNavigationSuiteScaffold.kt @@ -19,14 +19,14 @@ package com.infomaniak.swisstransfer.ui.screen.main.components import androidx.compose.foundation.layout.* -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Add import androidx.compose.material3.* import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffoldLayout import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteType import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import com.infomaniak.swisstransfer.ui.components.MainScreenFab +import com.infomaniak.swisstransfer.ui.components.MainScreenFabType import com.infomaniak.swisstransfer.ui.navigation.MainNavigation import com.infomaniak.swisstransfer.ui.navigation.NavigationItem import com.infomaniak.swisstransfer.ui.theme.Margin @@ -87,9 +87,10 @@ private fun AppNavigationBar(currentDestination: MainNavigation, navigateToSelec private fun AppNavigationRail(currentDestination: MainNavigation, navigateToSelectedItem: (MainNavigation) -> Unit) { NavigationRail( header = { - FloatingActionButton(onClick = {}, modifier = Modifier.padding(bottom = Margin.Large)) { - Icon(Icons.Default.Add, contentDescription = null) - } + MainScreenFab( + modifier = Modifier.padding(vertical = Margin.Large), + mainScreenFabType = MainScreenFabType.NAVIGATION_RAIL, + ) }, containerColor = SwissTransferTheme.colors.navigationItemBackground ) { @@ -113,4 +114,4 @@ private fun NavigationIcon(isNavigationBar: Boolean, navigationItem: NavigationI @Composable private fun NavigationLabel(navigationItem: NavigationItem) { Text(stringResource(navigationItem.label)) -} \ No newline at end of file +}