Skip to content

Commit

Permalink
feat: Add TopAppBar downloadButton
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Nov 13, 2024
1 parent 9a2361e commit 7e41d0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
}

Expand All @@ -92,6 +96,7 @@ private fun SwissTransferTopAppBarPreview() {
navigationMenu = TopAppBarButton.backButton {},
TopAppBarButton(AppIcons.Add, R.string.appName) {},
TopAppBarButton.closeButton {},
TopAppBarButton.downloadButton {},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fun TransferDetailsScreen(
SwissTransferTopAppBar(
title = Date(transfer.createdDateTimestamp).format(FORMAT_DATE_FULL),
navigationMenu = TopAppBarButton.backButton(navigateBack ?: {}),
TopAppBarButton.downloadButton { /* TODO */ },
)
},
floatingActionButton = {},
Expand Down

0 comments on commit 7e41d0c

Please sign in to comment.