From 05ce6528197180d24e0147c81e2c9aae8d7c3ab6 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Tue, 12 Nov 2024 18:22:58 +0100 Subject: [PATCH] feat: Add TopAppBar `downloadButton` --- .../swisstransfer/ui/components/SwissTransferTopAppBar.kt | 5 +++++ .../ui/screen/main/transferdetails/TransferDetailsScreen.kt | 1 + 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt index 381644576..83dd38a94 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferTopAppBar.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.res.stringResource import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons import com.infomaniak.swisstransfer.ui.images.icons.Add +import com.infomaniak.swisstransfer.ui.images.icons.ArrowDownBar import com.infomaniak.swisstransfer.ui.images.icons.ArrowLeft import com.infomaniak.swisstransfer.ui.images.icons.Cross import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme @@ -80,6 +81,9 @@ data class TopAppBarButton( val closeButton: (onClick: () -> Unit) -> TopAppBarButton = { TopAppBarButton(AppIcons.Cross, R.string.contentDescriptionButtonClose, it) } + val downloadButton: (onClick: () -> Unit) -> TopAppBarButton = { + TopAppBarButton(AppIcons.ArrowDownBar, R.string.buttonDownload, it) + } } } @@ -92,6 +96,7 @@ private fun SwissTransferTopAppBarPreview() { navigationMenu = TopAppBarButton.backButton {}, TopAppBarButton(AppIcons.Add, R.string.appName) {}, TopAppBarButton.closeButton {}, + TopAppBarButton.downloadButton {}, ) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt index 1d2c88fe1..778650715 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/transferdetails/TransferDetailsScreen.kt @@ -81,6 +81,7 @@ fun TransferDetailsScreen( SwissTransferTopAppBar( title = Date(transfer.createdDateTimestamp).format(FORMAT_DATE_FULL), navigationMenu = TopAppBarButton.backButton(navigateBack ?: {}), + TopAppBarButton.downloadButton { /* TODO */ }, ) }, floatingActionButton = {},