From f746ae4b04400cd8dc414a04b4536815a12843e7 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 28 Oct 2024 16:06:58 +0100 Subject: [PATCH 1/8] feat: Update UI if Transfer is expired --- .../java/com/infomaniak/core2/DateUtils.kt | 1 + .../ui/components/transfer/TransferItem.kt | 36 ++++++++++++++++--- .../ui/screen/main/received/ReceivedScreen.kt | 29 +++++++++------ app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 8 files changed, 56 insertions(+), 15 deletions(-) diff --git a/Core2/src/main/java/com/infomaniak/core2/DateUtils.kt b/Core2/src/main/java/com/infomaniak/core2/DateUtils.kt index a80e1654c..5cc1c41a7 100644 --- a/Core2/src/main/java/com/infomaniak/core2/DateUtils.kt +++ b/Core2/src/main/java/com/infomaniak/core2/DateUtils.kt @@ -23,5 +23,6 @@ import java.util.Locale const val FORMAT_DATE_DEFAULT = "dd.MM.yy" const val FORMAT_DATE_TITLE = "E d MMMM" +const val FORMAT_DATE_SIMPLE = "dd/MM/yyyy" fun Date.format(pattern: String = FORMAT_DATE_DEFAULT): String = SimpleDateFormat(pattern, Locale.getDefault()).format(this) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt index e17c3cccc..7432b7285 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt @@ -45,6 +45,15 @@ import java.util.UUID @OptIn(ExperimentalLayoutApi::class) @Composable fun TransferItem(transfer: TransferUi, onClick: () -> Unit) { + + val createdDate = Date(transfer.createdDateTimestamp).format(FORMAT_DATE_TITLE) + val expirationDate = Date(transfer.expirationDateTimestamp) + val remainingDays = transfer.expiresInDays + val remainingDownloads = transfer.downloadLeft + val uploadedSize = Formatter.formatShortFileSize(LocalContext.current, transfer.sizeUploaded) + val files = transfer.files + val filesCount = files.count() + Card( onClick = onClick, colors = CardDefaults.cardColors(containerColor = SwissTransferTheme.materialColors.surfaceContainerHighest), @@ -58,7 +67,7 @@ fun TransferItem(transfer: TransferUi, onClick: () -> Unit) { Column(modifier = Modifier.weight(1.0f)) { Text( - text = Date(transfer.createdDateTimestamp).format(FORMAT_DATE_TITLE), + text = createdDate, style = SwissTransferTheme.typography.bodyMedium, color = SwissTransferTheme.colors.primaryTextColor, maxLines = 1, @@ -67,18 +76,35 @@ fun TransferItem(transfer: TransferUi, onClick: () -> Unit) { Spacer(modifier = Modifier.height(Margin.Mini)) TextDotText( - firstText = { Formatter.formatShortFileSize(LocalContext.current, transfer.sizeUploaded) }, - secondText = { stringResource(R.string.expiresIn, transfer.expiresInDays) }, + firstText = { uploadedSize }, + secondText = { + + val (text, color) = when { + remainingDays < 0 -> { + stringResource(R.string.expiredThe, expirationDate.format(FORMAT_DATE_SIMPLE)) to + SwissTransferTheme.materialColors.error + } + remainingDownloads == 0 -> { + "Transfert expiré (TODO)" to SwissTransferTheme.materialColors.error + } + else -> { + stringResource(R.string.expiresIn, remainingDays) to SwissTransferTheme.colors.secondaryTextColor + } + } + + // TODO: Find a way to also send the color + text to color + }, ) Spacer(modifier = Modifier.height(Margin.Mini)) ContextualFlowRow( - itemCount = transfer.files.count(), + itemCount = filesCount, maxLines = 1, horizontalArrangement = Arrangement.spacedBy(Margin.Mini), overflow = ContextualFlowRowOverflow.expandIndicator { TransferFilePreview(remainingFilesCount = totalItemCount - shownItemCount) }, ) { index -> - TransferFilePreview(file = transfer.files[index]) + TransferFilePreview(file = files[index]) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt index 49a072e4d..01d095860 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt @@ -17,6 +17,7 @@ */ package com.infomaniak.swisstransfer.ui.screen.main.received +import android.util.Log import androidx.compose.foundation.layout.padding import androidx.compose.material3.Surface import androidx.compose.runtime.Composable @@ -118,11 +119,11 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { createdDateTimestamp = Date().time - 30L * 86_400_000L, expirationDateTimestamp = Calendar.getInstance().apply { time = Date() - set(Calendar.DATE, get(Calendar.DATE) + 1) + set(Calendar.DATE, get(Calendar.DATE) + 3) }.time.time, sizeUploaded = 57_689_032L, - downloadLimit = 10, - downloadLeft = 8, + downloadLimit = 1, + downloadLeft = 1, message = "Coucou c'est moi le message de description du transfert.", files = files, ), @@ -131,11 +132,11 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { createdDateTimestamp = Date().time - 5L * 86_400_000L, expirationDateTimestamp = Calendar.getInstance().apply { time = Date() - set(Calendar.DATE, get(Calendar.DATE) + 4) + set(Calendar.DATE, get(Calendar.DATE) + 5) }.time.time, sizeUploaded = 89_723_143L, - downloadLimit = 2, - downloadLeft = 2, + downloadLimit = 20, + downloadLeft = 0, message = null, files = files, ), @@ -144,11 +145,11 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { createdDateTimestamp = Date().time - 0.5f.toLong() * 86_400_000L, expirationDateTimestamp = Calendar.getInstance().apply { time = Date() - set(Calendar.DATE, get(Calendar.DATE) + 7) + set(Calendar.DATE, get(Calendar.DATE) - 4) }.time.time, sizeUploaded = 237_866_728L, - downloadLimit = 420_069, - downloadLeft = 402_690, + downloadLimit = 250, + downloadLeft = 123, message = "3ème transfert. RAS.", files = files, ), @@ -157,7 +158,15 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { TransferItemList( modifier = Modifier.padding(Margin.Medium), transfers = transfers, - onClick = { /* TODO */ } + onClick = { transfer -> + if (transfer.expiresInDays < 0 || transfer.downloadLeft == 0) { + Log.d("TODO", "Display expired transfer bottomSheet") + // TODO + } else { + Log.d("TODO", "Display transfer details screen") + // TODO + } + } ) } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index da1a56135..e1fa06544 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -29,6 +29,7 @@ Datei entfernen Passwort anzeigen Neuer Transfer + Abgelaufen am %s Verfällt in %d Tagen %d Datei diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 638e83742..d997b9d81 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -29,6 +29,7 @@ Eliminar archivo Mostrar contraseña Nueva transferencia + Expirado el %s Caduca en %d días %d archivo diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 48d459e5d..e4dd089da 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -29,6 +29,7 @@ Supprimer le fichier Afficher le mot de passe Nouveau transfert + Expiré le %s Expire dans %d jours %d fichier diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 833758800..792d8c447 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -29,6 +29,7 @@ Rimuovi il file Mostra password Nuovo trasferimento + Scaduto il %s Scade tra %d giorni %d file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c7a3906da..d3a76698a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -34,6 +34,7 @@ Remove file Show password New transfer + Expired on %s Expires in %d days %d file From c8899cf237a5a53dd1ccd6993f9b536deb4e6509 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Tue, 29 Oct 2024 11:45:32 +0100 Subject: [PATCH 2/8] feat: Display BottomSheet when clicking on an expired Transfer --- .../swisstransfer/ui/components/EmptyState.kt | 6 +- .../ui/components/SwissTransferBottomSheet.kt | 22 +- .../transfer/TransferExpiredBottomSheet.kt | 100 +++++ .../swisstransfer/ui/images/icons/Bin.kt | 128 ++++++ .../ui/images/illus/mascotDead/MascotDead.kt | 53 +++ .../images/illus/mascotDead/MascotDeadDark.kt | 415 ++++++++++++++++++ .../illus/mascotDead/MascotDeadLight.kt | 415 ++++++++++++++++++ .../ui/screen/main/received/ReceivedScreen.kt | 49 ++- app/src/main/res/values-de/strings.xml | 3 + app/src/main/res/values-es/strings.xml | 3 + app/src/main/res/values-fr/strings.xml | 5 +- app/src/main/res/values-it/strings.xml | 3 + app/src/main/res/values/strings.xml | 3 + 13 files changed, 1180 insertions(+), 25 deletions(-) create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDead.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadDark.kt create mode 100644 app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadLight.kt diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt index efeac9f0e..8eb2a0b93 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/EmptyState.kt @@ -39,7 +39,7 @@ import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme fun EmptyState( icon: ImageVector, @StringRes title: Int, - @StringRes description: Int, + description: String, modifier: Modifier = Modifier, ) { Box( @@ -49,7 +49,7 @@ fun EmptyState( IllustratedMessageBlock( icon = icon, title = title, - description = stringResource(description), + description = description, modifier = modifier.padding(horizontal = Margin.Medium), ) } @@ -64,7 +64,7 @@ private fun EmptyStatePreview() { EmptyState( icon = AppIllus.MascotSearching, title = R.string.noTransferReceivedTitle, - description = R.string.noTransferReceivedDescription, + description = stringResource(R.string.noTransferReceivedDescription), ) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt index 1f1e9ce2f..d02c083af 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferBottomSheet.kt @@ -49,7 +49,7 @@ fun SwissTransferBottomSheet( modifier: Modifier = Modifier, onDismissRequest: () -> Unit, imageVector: ImageVector? = null, - @StringRes titleRes: Int, + @StringRes titleRes: Int? = null, @StringRes descriptionRes: Int? = null, topButton: @Composable ((Modifier) -> Unit)? = null, bottomButton: @Composable ((Modifier) -> Unit)? = null, @@ -72,8 +72,8 @@ fun SwissTransferBottomSheet( @Composable private fun BottomSheetContent( imageVector: ImageVector?, - titleRes: Int, - descriptionRes: Int?, + @StringRes titleRes: Int?, + @StringRes descriptionRes: Int?, content: @Composable (() -> Unit)?, topButton: @Composable ((Modifier) -> Unit)? = null, bottomButton: @Composable ((Modifier) -> Unit)? = null, @@ -89,13 +89,15 @@ private fun BottomSheetContent( Spacer(modifier = Modifier.height(Margin.Large)) } - Text( - text = stringResource(titleRes), - style = SwissTransferTheme.typography.bodyMedium, - color = SwissTransferTheme.colors.primaryTextColor, - textAlign = TextAlign.Center, - ) - Spacer(modifier = Modifier.height(Margin.Large)) + titleRes?.let { + Text( + text = stringResource(it), + style = SwissTransferTheme.typography.bodyMedium, + color = SwissTransferTheme.colors.primaryTextColor, + textAlign = TextAlign.Center, + ) + Spacer(modifier = Modifier.height(Margin.Large)) + } descriptionRes?.let { Text( diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt new file mode 100644 index 000000000..c140783d7 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt @@ -0,0 +1,100 @@ +/* + * Infomaniak SwissTransfer - Android + * Copyright (C) 2024 Infomaniak Network SA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.infomaniak.swisstransfer.ui.components.transfer + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height +import androidx.compose.material3.Surface +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import com.infomaniak.swisstransfer.R +import com.infomaniak.swisstransfer.ui.components.EmptyState +import com.infomaniak.swisstransfer.ui.components.LargeButton +import com.infomaniak.swisstransfer.ui.components.SwissTransferBottomSheet +import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons +import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus +import com.infomaniak.swisstransfer.ui.images.icons.Bin +import com.infomaniak.swisstransfer.ui.images.illus.mascotDead.MascotDead +import com.infomaniak.swisstransfer.ui.theme.Margin +import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme +import com.infomaniak.swisstransfer.ui.utils.FORMAT_DATE_SIMPLE +import com.infomaniak.swisstransfer.ui.utils.PreviewAllWindows +import com.infomaniak.swisstransfer.ui.utils.format +import java.util.Date + +@Composable +fun TransferExpiredBottomSheet( + isVisible: () -> Boolean, + expirationDate: () -> Date?, + downloadsLimit: () -> Int?, + onDeleteTransferClicked: () -> Unit, + closeBottomSheet: () -> Unit, +) { + + if (!isVisible()) return + + val date = expirationDate() + val descriptionText = if (date != null) { + stringResource( + R.string.transferExpiredDateReachedDescription, + date.format(FORMAT_DATE_SIMPLE), + ) + } else { + stringResource(R.string.transferExpiredLimitReachedDescription, downloadsLimit()!!) + } + + SwissTransferBottomSheet( + modifier = Modifier, + onDismissRequest = closeBottomSheet, + bottomButton = { + LargeButton( + modifier = it, + titleRes = R.string.transferExpiredButton, + imageVector = AppIcons.Bin, + onClick = onDeleteTransferClicked, + ) + }, + ) { + Column { + Spacer(modifier = Modifier.height(Margin.Medium)) + EmptyState( + icon = AppIllus.MascotDead.image(), + title = R.string.transferExpiredTitle, + description = descriptionText, + ) + } + } +} + +@PreviewAllWindows +@Composable +private fun Preview() { + SwissTransferTheme { + Surface { + TransferExpiredBottomSheet( + isVisible = { true }, + expirationDate = { Date() }, + downloadsLimit = { 42 }, + onDeleteTransferClicked = {}, + closeBottomSheet = {}, + ) + } + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt new file mode 100644 index 000000000..8079f2409 --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt @@ -0,0 +1,128 @@ +package com.infomaniak.swisstransfer.ui.images.icons + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType.Companion.NonZero +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.ImageVector.Builder +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.infomaniak.swisstransfer.ui.images.AppImages +import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons + +val AppIcons.Bin: ImageVector + get() { + + if (_bin != null) return _bin!! + + _bin = Builder( + name = "Bin", + defaultWidth = 16.0.dp, + defaultHeight = 16.0.dp, + viewportWidth = 16.0f, + viewportHeight = 16.0f, + ).apply { + path( + fill = SolidColor(Color(0xFFF7FCFA)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(15.502f, 2.115f) + horizontalLineTo(11.236f) + verticalLineTo(1.621f) + curveTo(11.236f, 1.198f, 11.093f, 0.775f, 10.738f, 0.493f) + curveTo(10.382f, 0.211f, 10.027f, 0.0f, 9.6f, 0.0f) + horizontalLineTo(6.471f) + curveTo(5.973f, 0.0f, 5.618f, 0.211f, 5.333f, 0.493f) + curveTo(4.978f, 0.775f, 4.836f, 1.198f, 4.836f, 1.621f) + verticalLineTo(2.185f) + horizontalLineTo(0.569f) + curveTo(0.284f, 2.185f, 0.0f, 2.396f, 0.0f, 2.749f) + curveTo(0.0f, 3.101f, 0.213f, 3.313f, 0.569f, 3.313f) + horizontalLineTo(1.707f) + lineTo(2.631f, 14.52f) + curveTo(2.631f, 14.943f, 2.844f, 15.295f, 3.129f, 15.577f) + curveTo(3.413f, 15.859f, 3.84f, 16.0f, 4.196f, 16.0f) + horizontalLineTo(11.804f) + curveTo(12.231f, 16.0f, 12.587f, 15.859f, 12.871f, 15.577f) + curveTo(13.156f, 15.295f, 13.369f, 14.943f, 13.369f, 14.52f) + lineTo(14.293f, 3.313f) + horizontalLineTo(15.431f) + curveTo(15.716f, 3.313f, 16.0f, 3.101f, 16.0f, 2.749f) + curveTo(16.0f, 2.396f, 15.787f, 2.115f, 15.502f, 2.115f) + close() + moveTo(5.902f, 1.621f) + curveTo(5.902f, 1.48f, 5.973f, 1.339f, 6.044f, 1.269f) + curveTo(6.116f, 1.198f, 6.258f, 1.128f, 6.4f, 1.128f) + horizontalLineTo(9.6f) + curveTo(9.742f, 1.128f, 9.884f, 1.198f, 9.956f, 1.269f) + curveTo(10.027f, 1.339f, 10.169f, 1.48f, 10.169f, 1.621f) + verticalLineTo(2.185f) + horizontalLineTo(5.902f) + verticalLineTo(1.621f) + close() + moveTo(12.373f, 14.379f) + curveTo(12.373f, 14.52f, 12.302f, 14.661f, 12.231f, 14.731f) + curveTo(12.16f, 14.802f, 12.018f, 14.872f, 11.876f, 14.872f) + horizontalLineTo(4.196f) + curveTo(4.053f, 14.872f, 3.911f, 14.802f, 3.84f, 14.731f) + curveTo(3.769f, 14.661f, 3.698f, 14.52f, 3.698f, 14.379f) + lineTo(2.773f, 3.172f) + horizontalLineTo(13.369f) + lineTo(12.373f, 14.379f) + close() + } + path( + fill = SolidColor(Color(0xFFF7FCFA)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(6.471f, 5.85f) + curveTo(6.116f, 5.85f, 5.902f, 6.062f, 5.902f, 6.414f) + verticalLineTo(11.7f) + curveTo(5.902f, 11.982f, 6.116f, 12.194f, 6.471f, 12.194f) + curveTo(6.827f, 12.194f, 7.04f, 11.982f, 7.04f, 11.63f) + verticalLineTo(6.414f) + curveTo(6.969f, 6.062f, 6.756f, 5.85f, 6.471f, 5.85f) + close() + } + path( + fill = SolidColor(Color(0xFFF7FCFA)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(9.6f, 5.85f) + curveTo(9.316f, 5.85f, 9.031f, 6.062f, 9.031f, 6.414f) + verticalLineTo(11.7f) + curveTo(9.031f, 11.982f, 9.244f, 12.264f, 9.6f, 12.264f) + curveTo(9.956f, 12.264f, 10.169f, 12.053f, 10.169f, 11.7f) + verticalLineTo(6.414f) + curveTo(10.169f, 6.062f, 9.956f, 5.85f, 9.6f, 5.85f) + close() + } + }.build() + + return _bin!! + } + +private var _bin: ImageVector? = null + +@Preview +@Composable +private fun Preview() { + Box { + Image( + imageVector = AppIcons.Bin, + contentDescription = null, + modifier = Modifier.size(AppImages.previewSize), + ) + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDead.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDead.kt new file mode 100644 index 000000000..66f50769c --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDead.kt @@ -0,0 +1,53 @@ +/* + * Infomaniak SwissTransfer - Android + * Copyright (C) 2024 Infomaniak Network SA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.infomaniak.swisstransfer.ui.images.illus.mascotDead + +import android.content.res.Configuration +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.infomaniak.swisstransfer.ui.images.AppImages +import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus +import com.infomaniak.swisstransfer.ui.images.ThemedImage +import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme + +val AppIllus.MascotDead: ThemedImage + get() = _mascotDead ?: object : ThemedImage { + override val light = AppIllus.MascotDeadLight + override val dark = AppIllus.MascotDeadDark + }.also { _mascotDead = it } + +private var _mascotDead: ThemedImage? = null + +@Preview(name = "Light") +@Preview(name = "Dark", uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL) +@Composable +private fun Preview() { + SwissTransferTheme { + Box { + Image( + imageVector = AppIllus.MascotDead.image(), + contentDescription = null, + modifier = Modifier.size(AppImages.previewSize), + ) + } + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadDark.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadDark.kt new file mode 100644 index 000000000..bf6bc5e9f --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadDark.kt @@ -0,0 +1,415 @@ +/* + * Infomaniak SwissTransfer - Android + * Copyright (C) 2024 Infomaniak Network SA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.infomaniak.swisstransfer.ui.images.illus.mascotDead + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType.Companion.EvenOdd +import androidx.compose.ui.graphics.PathFillType.Companion.NonZero +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.ImageVector.Builder +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.infomaniak.swisstransfer.ui.images.AppImages +import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus + +val AppIllus.MascotDeadDark: ImageVector + get() { + + if (_mascotDeadDark != null) return _mascotDeadDark!! + + _mascotDeadDark = Builder( + name = "MascotDeadDark", + defaultWidth = 185.0.dp, + defaultHeight = 160.0.dp, + viewportWidth = 185.0f, + viewportHeight = 160.0f, + ).apply { + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(0.0f, 145.66f) + arcToRelative(92.23f, 14.34f, 0.0f, true, false, 184.46f, 0.0f) + arcToRelative(92.23f, 14.34f, 0.0f, true, false, -184.46f, 0.0f) + close() + } + path( + fill = SolidColor(Color(0xFF2B383B)), stroke = SolidColor(Color(0xFFDCE4E5)), + strokeLineWidth = 0.5f, strokeLineCap = Butt, strokeLineJoin = Miter, + strokeLineMiter = 4.0f, pathFillType = NonZero + ) { + moveTo(56.09f, 52.92f) + curveTo(58.09f, 34.48f, 73.65f, 20.51f, 92.2f, 20.51f) + curveTo(110.75f, 20.51f, 126.32f, 34.48f, 128.31f, 52.92f) + lineTo(138.65f, 148.57f) + lineTo(127.5f, 133.27f) + curveTo(121.62f, 125.19f, 109.58f, 125.19f, 103.7f, 133.27f) + curveTo(98.02f, 141.07f, 86.38f, 141.07f, 80.7f, 133.27f) + curveTo(74.82f, 125.19f, 62.78f, 125.19f, 56.9f, 133.27f) + lineTo(45.75f, 148.57f) + lineTo(56.09f, 52.92f) + close() + } + path( + fill = SolidColor(Color(0xFF67DD95)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(92.2f, 78.23f) + moveToRelative(-2.79f, 0.0f) + arcToRelative(2.79f, 2.79f, 0.0f, true, true, 5.59f, 0.0f) + arcToRelative(2.79f, 2.79f, 0.0f, true, true, -5.59f, 0.0f) + } + path( + fill = SolidColor(Color(0xFF67DD95)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(58.59f, 12.98f) + curveTo(59.21f, 14.09f, 58.86f, 15.31f, 58.36f, 16.27f) + curveTo(57.89f, 17.14f, 57.75f, 17.49f, 58.11f, 18.14f) + lineTo(58.31f, 18.5f) + lineTo(57.23f, 19.11f) + lineTo(57.01f, 18.71f) + curveTo(56.46f, 17.73f, 56.69f, 17.03f, 57.32f, 15.87f) + curveTo(57.71f, 15.14f, 57.93f, 14.41f, 57.5f, 13.65f) + curveTo(57.09f, 12.91f, 56.17f, 12.8f, 55.27f, 13.3f) + curveTo(53.96f, 14.03f, 54.05f, 15.18f, 54.4f, 15.92f) + lineTo(53.34f, 16.51f) + curveTo(52.5f, 14.99f, 53.14f, 13.33f, 54.8f, 12.4f) + curveTo(56.12f, 11.66f, 57.8f, 11.56f, 58.59f, 12.98f) + close() + moveTo(58.51f, 21.64f) + lineTo(57.76f, 20.3f) + lineTo(59.1f, 19.55f) + lineTo(59.85f, 20.89f) + lineTo(58.51f, 21.64f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(118.84f, 1.61f) + curveTo(118.83f, 2.47f, 118.22f, 3.07f, 117.61f, 3.47f) + curveTo(117.04f, 3.83f, 116.85f, 3.99f, 116.84f, 4.49f) + lineTo(116.84f, 4.77f) + lineTo(116.0f, 4.77f) + lineTo(116.0f, 4.46f) + curveTo(116.0f, 3.7f, 116.38f, 3.37f, 117.13f, 2.89f) + curveTo(117.6f, 2.59f, 117.97f, 2.23f, 117.98f, 1.64f) + curveTo(117.98f, 1.07f, 117.47f, 0.7f, 116.78f, 0.7f) + curveTo(115.76f, 0.69f, 115.43f, 1.4f, 115.39f, 1.95f) + lineTo(114.57f, 1.95f) + curveTo(114.58f, 0.77f, 115.51f, 0.0f, 116.8f, 0.01f) + curveTo(117.82f, 0.01f, 118.84f, 0.51f, 118.84f, 1.61f) + close() + moveTo(115.91f, 6.69f) + lineTo(115.92f, 5.65f) + lineTo(116.96f, 5.65f) + lineTo(116.95f, 6.69f) + lineTo(115.91f, 6.69f) + close() + } + path( + fill = SolidColor(Color(0xFF67DD95)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(133.4f, 13.05f) + curveTo(132.85f, 14.58f, 131.39f, 15.27f, 130.04f, 15.59f) + curveTo(128.82f, 15.87f, 128.36f, 16.03f, 128.04f, 16.92f) + lineTo(127.86f, 17.42f) + lineTo(126.37f, 16.88f) + lineTo(126.56f, 16.33f) + curveTo(127.05f, 14.98f, 127.92f, 14.62f, 129.56f, 14.25f) + curveTo(130.59f, 14.02f, 131.48f, 13.61f, 131.85f, 12.57f) + curveTo(132.21f, 11.56f, 131.55f, 10.57f, 130.31f, 10.13f) + curveTo(128.51f, 9.48f, 127.48f, 10.53f, 127.07f, 11.49f) + lineTo(125.6f, 10.96f) + curveTo(126.37f, 8.88f, 128.5f, 8.1f, 130.78f, 8.92f) + curveTo(132.6f, 9.57f, 134.1f, 11.11f, 133.4f, 13.05f) + close() + moveTo(125.0f, 20.24f) + lineTo(125.66f, 18.39f) + lineTo(127.51f, 19.05f) + lineTo(126.85f, 20.9f) + lineTo(125.0f, 20.24f) + close() + } + path( + fill = SolidColor(Color(0xFF67DD95)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = EvenOdd + ) { + moveTo(75.37f, 57.74f) + lineTo(72.41f, 60.7f) + lineTo(76.36f, 64.65f) + lineTo(72.4f, 68.6f) + lineTo(75.37f, 71.57f) + lineTo(79.32f, 67.61f) + lineTo(83.27f, 71.57f) + lineTo(86.24f, 68.6f) + lineTo(82.28f, 64.65f) + lineTo(86.23f, 60.7f) + lineTo(83.27f, 57.74f) + lineTo(79.32f, 61.69f) + lineTo(75.37f, 57.74f) + close() + } + path( + fill = SolidColor(Color(0xFF67DD95)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = EvenOdd + ) { + moveTo(99.82f, 57.74f) + lineTo(96.85f, 60.7f) + lineTo(100.8f, 64.65f) + lineTo(96.85f, 68.6f) + lineTo(99.82f, 71.57f) + lineTo(103.77f, 67.61f) + lineTo(107.72f, 71.57f) + lineTo(110.68f, 68.6f) + lineTo(106.73f, 64.65f) + lineTo(110.68f, 60.7f) + lineTo(107.72f, 57.74f) + lineTo(103.77f, 61.69f) + lineTo(99.82f, 57.74f) + close() + } + path( + fill = SolidColor(Color(0xFF2B383B)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(135.73f, 97.57f) + lineTo(126.83f, 82.14f) + lineTo(115.33f, 88.78f) + lineTo(124.24f, 104.2f) + curveTo(126.07f, 107.38f, 130.13f, 108.46f, 133.3f, 106.63f) + curveTo(136.48f, 104.8f, 137.57f, 100.74f, 135.73f, 97.57f) + close() + } + path( + fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFFDCE4E5)), + strokeLineWidth = 0.5f, strokeLineCap = Butt, strokeLineJoin = Miter, + strokeLineMiter = 4.0f, pathFillType = NonZero + ) { + moveTo(115.33f, 88.78f) + lineTo(124.24f, 104.2f) + curveTo(126.07f, 107.38f, 130.13f, 108.46f, 133.3f, 106.63f) + verticalLineTo(106.63f) + curveTo(136.48f, 104.8f, 137.57f, 100.74f, 135.73f, 97.57f) + lineTo(126.83f, 82.14f) + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(145.44f, 110.91f) + curveTo(144.46f, 110.91f, 143.55f, 110.56f, 142.85f, 109.86f) + curveTo(142.15f, 109.15f, 141.8f, 108.24f, 141.8f, 107.26f) + curveTo(141.8f, 106.28f, 142.15f, 105.37f, 142.85f, 104.66f) + lineTo(146.21f, 101.3f) + curveTo(146.85f, 100.67f, 147.76f, 100.25f, 148.67f, 100.25f) + curveTo(149.58f, 100.18f, 150.49f, 100.53f, 151.2f, 101.16f) + curveTo(151.9f, 101.79f, 152.39f, 102.63f, 152.46f, 103.54f) + curveTo(152.6f, 104.45f, 152.32f, 105.37f, 151.76f, 106.14f) + curveTo(151.62f, 106.35f, 151.26f, 106.42f, 151.05f, 106.28f) + curveTo(150.84f, 106.14f, 150.77f, 105.79f, 150.91f, 105.58f) + curveTo(151.34f, 105.01f, 151.48f, 104.38f, 151.4f, 103.75f) + curveTo(151.34f, 103.12f, 150.99f, 102.49f, 150.49f, 102.07f) + curveTo(150.0f, 101.44f, 149.37f, 101.23f, 148.74f, 101.23f) + curveTo(148.04f, 101.3f, 147.41f, 101.58f, 146.99f, 102.0f) + lineTo(143.62f, 105.37f) + curveTo(143.13f, 105.86f, 142.85f, 106.56f, 142.85f, 107.26f) + curveTo(142.85f, 107.96f, 143.13f, 108.59f, 143.62f, 109.15f) + curveTo(144.6f, 110.14f, 146.35f, 110.14f, 147.34f, 109.15f) + lineTo(147.97f, 108.45f) + curveTo(148.18f, 108.24f, 148.53f, 108.24f, 148.74f, 108.45f) + curveTo(148.95f, 108.66f, 148.95f, 109.01f, 148.74f, 109.22f) + lineTo(148.11f, 109.86f) + curveTo(147.41f, 110.56f, 146.49f, 110.91f, 145.44f, 110.91f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(151.62f, 108.45f) + curveTo(150.7f, 108.45f, 149.86f, 108.17f, 149.23f, 107.54f) + curveTo(148.53f, 106.91f, 148.11f, 106.07f, 147.97f, 105.15f) + curveTo(147.83f, 104.24f, 148.11f, 103.33f, 148.67f, 102.56f) + curveTo(148.81f, 102.35f, 149.16f, 102.28f, 149.37f, 102.42f) + curveTo(149.58f, 102.56f, 149.65f, 102.91f, 149.51f, 103.12f) + curveTo(149.09f, 103.68f, 148.95f, 104.31f, 149.02f, 104.94f) + curveTo(149.09f, 105.58f, 149.44f, 106.21f, 149.93f, 106.63f) + curveTo(150.42f, 107.05f, 151.05f, 107.26f, 151.76f, 107.26f) + curveTo(152.39f, 107.26f, 153.02f, 106.98f, 153.51f, 106.49f) + lineTo(156.88f, 103.12f) + curveTo(157.3f, 102.77f, 157.58f, 102.14f, 157.58f, 101.44f) + curveTo(157.58f, 100.74f, 157.3f, 100.11f, 156.81f, 99.54f) + curveTo(155.82f, 98.56f, 154.07f, 98.56f, 153.09f, 99.54f) + lineTo(152.53f, 100.11f) + curveTo(152.32f, 100.32f, 151.97f, 100.32f, 151.76f, 100.11f) + curveTo(151.55f, 99.89f, 151.62f, 99.54f, 151.83f, 99.33f) + lineTo(152.32f, 98.84f) + curveTo(153.02f, 98.14f, 153.93f, 97.79f, 154.91f, 97.79f) + curveTo(155.9f, 97.79f, 156.81f, 98.14f, 157.51f, 98.84f) + curveTo(158.21f, 99.54f, 158.56f, 100.46f, 158.56f, 101.44f) + curveTo(158.56f, 102.42f, 158.21f, 103.33f, 157.51f, 104.03f) + lineTo(154.14f, 107.4f) + curveTo(153.51f, 108.03f, 152.6f, 108.45f, 151.69f, 108.45f) + horizontalLineTo(151.62f) + close() + } + path( + fill = SolidColor(Color(0xFF2B383B)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(59.6f, 104.2f) + lineTo(68.5f, 88.78f) + lineTo(57.01f, 82.14f) + lineTo(48.1f, 97.57f) + curveTo(46.27f, 100.74f, 47.36f, 104.8f, 50.53f, 106.63f) + curveTo(53.71f, 108.46f, 57.76f, 107.38f, 59.6f, 104.2f) + close() + } + path( + fill = SolidColor(Color(0x00000000)), stroke = + SolidColor(Color(0xFFDCE4E5)), strokeLineWidth = 0.5f, strokeLineCap = + Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, pathFillType = + NonZero + ) { + moveTo(57.01f, 82.14f) + lineTo(48.1f, 97.57f) + curveTo(46.27f, 100.74f, 47.36f, 104.8f, 50.53f, 106.63f) + verticalLineTo(106.63f) + curveTo(53.71f, 108.46f, 57.76f, 107.38f, 59.6f, 104.2f) + lineTo(68.5f, 88.78f) + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = EvenOdd + ) { + moveTo(24.52f, 102.28f) + curveTo(24.52f, 100.34f, 26.09f, 98.76f, 28.03f, 98.76f) + curveTo(29.98f, 98.76f, 31.55f, 100.34f, 31.55f, 102.28f) + curveTo(31.55f, 104.22f, 29.98f, 105.79f, 28.03f, 105.79f) + curveTo(26.09f, 105.79f, 24.52f, 104.22f, 24.52f, 102.28f) + close() + moveTo(28.03f, 99.85f) + curveTo(26.69f, 99.85f, 25.6f, 100.93f, 25.6f, 102.28f) + curveTo(25.6f, 103.62f, 26.69f, 104.71f, 28.03f, 104.71f) + curveTo(29.38f, 104.71f, 30.47f, 103.62f, 30.47f, 102.28f) + curveTo(30.47f, 100.93f, 29.38f, 99.85f, 28.03f, 99.85f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(28.58f, 106.91f) + curveTo(27.76f, 106.81f, 26.94f, 106.94f, 26.19f, 107.29f) + curveTo(25.45f, 107.64f, 24.82f, 108.19f, 24.38f, 108.89f) + curveTo(24.04f, 109.43f, 23.82f, 110.03f, 23.74f, 110.66f) + horizontalLineTo(29.48f) + curveTo(29.78f, 110.66f, 30.02f, 110.9f, 30.02f, 111.2f) + curveTo(30.02f, 111.5f, 29.78f, 111.74f, 29.48f, 111.74f) + horizontalLineTo(23.17f) + curveTo(23.02f, 111.74f, 22.89f, 111.69f, 22.79f, 111.58f) + curveTo(22.68f, 111.48f, 22.63f, 111.35f, 22.63f, 111.2f) + curveTo(22.63f, 110.18f, 22.92f, 109.17f, 23.47f, 108.31f) + curveTo(24.02f, 107.44f, 24.8f, 106.75f, 25.73f, 106.31f) + curveTo(26.66f, 105.87f, 27.69f, 105.71f, 28.71f, 105.84f) + curveTo(29.73f, 105.97f, 30.69f, 106.38f, 31.48f, 107.04f) + curveTo(31.71f, 107.23f, 31.74f, 107.57f, 31.55f, 107.8f) + curveTo(31.36f, 108.03f, 31.02f, 108.06f, 30.79f, 107.87f) + curveTo(30.16f, 107.35f, 29.39f, 107.01f, 28.58f, 106.91f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(33.59f, 112.81f) + curveTo(33.29f, 113.15f, 32.85f, 113.36f, 32.36f, 113.36f) + curveTo(31.46f, 113.36f, 30.74f, 112.64f, 30.74f, 111.74f) + curveTo(30.74f, 110.85f, 31.46f, 110.12f, 32.36f, 110.12f) + curveTo(32.76f, 110.12f, 33.12f, 110.26f, 33.4f, 110.5f) + curveTo(33.42f, 110.48f, 33.44f, 110.46f, 33.47f, 110.45f) + lineTo(36.1f, 108.87f) + curveTo(36.13f, 108.85f, 36.15f, 108.84f, 36.18f, 108.83f) + curveTo(36.16f, 108.72f, 36.15f, 108.61f, 36.15f, 108.5f) + curveTo(36.15f, 107.6f, 36.87f, 106.88f, 37.77f, 106.88f) + curveTo(38.66f, 106.88f, 39.39f, 107.6f, 39.39f, 108.5f) + curveTo(39.39f, 109.39f, 38.66f, 110.12f, 37.77f, 110.12f) + curveTo(37.37f, 110.12f, 37.01f, 109.98f, 36.73f, 109.74f) + curveTo(36.71f, 109.76f, 36.68f, 109.78f, 36.66f, 109.79f) + lineTo(34.03f, 111.37f) + curveTo(34.0f, 111.39f, 33.98f, 111.4f, 33.95f, 111.41f) + curveTo(33.97f, 111.52f, 33.98f, 111.63f, 33.98f, 111.74f) + curveTo(33.98f, 111.77f, 33.98f, 111.79f, 33.98f, 111.82f) + curveTo(34.01f, 111.82f, 34.04f, 111.83f, 34.07f, 111.84f) + lineTo(36.46f, 112.8f) + curveTo(36.49f, 112.81f, 36.52f, 112.83f, 36.54f, 112.84f) + curveTo(36.84f, 112.5f, 37.28f, 112.28f, 37.77f, 112.28f) + curveTo(38.66f, 112.28f, 39.39f, 113.01f, 39.39f, 113.91f) + curveTo(39.39f, 114.8f, 38.66f, 115.53f, 37.77f, 115.53f) + curveTo(36.87f, 115.53f, 36.15f, 114.8f, 36.15f, 113.91f) + curveTo(36.15f, 113.88f, 36.15f, 113.86f, 36.15f, 113.83f) + curveTo(36.12f, 113.83f, 36.09f, 113.82f, 36.06f, 113.81f) + lineTo(33.67f, 112.85f) + curveTo(33.64f, 112.84f, 33.61f, 112.82f, 33.59f, 112.81f) + close() + } + }.build() + + return _mascotDeadDark!! + } + +private var _mascotDeadDark: ImageVector? = null + +@Preview +@Composable +private fun Preview() { + Box { + Image( + imageVector = AppIllus.MascotDeadDark, + contentDescription = null, + modifier = Modifier.size(AppImages.previewSize), + ) + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadLight.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadLight.kt new file mode 100644 index 000000000..bada20e2b --- /dev/null +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/illus/mascotDead/MascotDeadLight.kt @@ -0,0 +1,415 @@ +/* + * Infomaniak SwissTransfer - Android + * Copyright (C) 2024 Infomaniak Network SA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.infomaniak.swisstransfer.ui.images.illus.mascotDead + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType.Companion.EvenOdd +import androidx.compose.ui.graphics.PathFillType.Companion.NonZero +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap.Companion.Butt +import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.ImageVector.Builder +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.infomaniak.swisstransfer.ui.images.AppImages +import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus + +val AppIllus.MascotDeadLight: ImageVector + get() { + + if (_mascotDeadLight != null) return _mascotDeadLight!! + + _mascotDeadLight = Builder( + name = "MascotDeadLight", + defaultWidth = 185.0.dp, + defaultHeight = 160.0.dp, + viewportWidth = 185.0f, + viewportHeight = 160.0f, + ).apply { + path( + fill = SolidColor(Color(0xFFE3F6DC)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(0.27f, 145.66f) + arcToRelative(92.23f, 14.34f, 0.0f, true, false, 184.46f, 0.0f) + arcToRelative(92.23f, 14.34f, 0.0f, true, false, -184.46f, 0.0f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = SolidColor(Color(0xFF014958)), + strokeLineWidth = 1.0f, strokeLineCap = Butt, strokeLineJoin = Miter, + strokeLineMiter = 4.0f, pathFillType = NonZero + ) { + moveTo(56.61f, 52.95f) + curveTo(58.59f, 34.64f, 74.05f, 20.76f, 92.47f, 20.76f) + curveTo(110.89f, 20.76f, 126.35f, 34.64f, 128.33f, 52.95f) + lineTo(138.57f, 147.67f) + lineTo(127.97f, 133.12f) + curveTo(122.0f, 124.91f, 109.75f, 124.91f, 103.77f, 133.12f) + curveTo(98.19f, 140.78f, 86.76f, 140.78f, 81.18f, 133.12f) + curveTo(75.2f, 124.91f, 62.95f, 124.91f, 56.97f, 133.12f) + lineTo(46.37f, 147.67f) + lineTo(56.61f, 52.95f) + close() + } + path( + fill = SolidColor(Color(0xFF3CB572)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(92.47f, 78.23f) + moveToRelative(-2.79f, 0.0f) + arcToRelative(2.79f, 2.79f, 0.0f, true, true, 5.59f, 0.0f) + arcToRelative(2.79f, 2.79f, 0.0f, true, true, -5.59f, 0.0f) + } + path( + fill = SolidColor(Color(0xFF3CB572)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(58.86f, 12.98f) + curveTo(59.48f, 14.09f, 59.13f, 15.31f, 58.62f, 16.27f) + curveTo(58.16f, 17.14f, 58.02f, 17.49f, 58.38f, 18.14f) + lineTo(58.58f, 18.5f) + lineTo(57.5f, 19.11f) + lineTo(57.28f, 18.71f) + curveTo(56.73f, 17.73f, 56.96f, 17.03f, 57.59f, 15.87f) + curveTo(57.98f, 15.14f, 58.2f, 14.41f, 57.77f, 13.65f) + curveTo(57.36f, 12.91f, 56.44f, 12.8f, 55.54f, 13.3f) + curveTo(54.23f, 14.03f, 54.32f, 15.18f, 54.67f, 15.92f) + lineTo(53.61f, 16.51f) + curveTo(52.77f, 14.99f, 53.41f, 13.33f, 55.07f, 12.4f) + curveTo(56.39f, 11.66f, 58.07f, 11.56f, 58.86f, 12.98f) + close() + moveTo(58.78f, 21.64f) + lineTo(58.03f, 20.3f) + lineTo(59.37f, 19.55f) + lineTo(60.12f, 20.89f) + lineTo(58.78f, 21.64f) + close() + } + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(119.11f, 1.61f) + curveTo(119.1f, 2.47f, 118.5f, 3.07f, 117.88f, 3.47f) + curveTo(117.32f, 3.83f, 117.11f, 3.99f, 117.11f, 4.49f) + lineTo(117.11f, 4.77f) + lineTo(116.27f, 4.77f) + lineTo(116.27f, 4.46f) + curveTo(116.27f, 3.7f, 116.65f, 3.37f, 117.4f, 2.89f) + curveTo(117.87f, 2.59f, 118.24f, 2.23f, 118.25f, 1.64f) + curveTo(118.25f, 1.07f, 117.74f, 0.7f, 117.04f, 0.7f) + curveTo(116.03f, 0.69f, 115.7f, 1.4f, 115.67f, 1.95f) + lineTo(114.84f, 1.95f) + curveTo(114.85f, 0.77f, 115.78f, 0.0f, 117.07f, 0.01f) + curveTo(118.09f, 0.01f, 119.11f, 0.51f, 119.11f, 1.61f) + close() + moveTo(116.18f, 6.69f) + lineTo(116.19f, 5.65f) + lineTo(117.23f, 5.65f) + lineTo(117.22f, 6.69f) + lineTo(116.18f, 6.69f) + close() + } + path( + fill = SolidColor(Color(0xFF3CB572)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(133.67f, 13.05f) + curveTo(133.12f, 14.58f, 131.66f, 15.27f, 130.31f, 15.59f) + curveTo(129.08f, 15.87f, 128.63f, 16.03f, 128.31f, 16.92f) + lineTo(128.13f, 17.42f) + lineTo(126.64f, 16.88f) + lineTo(126.83f, 16.33f) + curveTo(127.32f, 14.98f, 128.19f, 14.62f, 129.83f, 14.25f) + curveTo(130.85f, 14.02f, 131.74f, 13.61f, 132.12f, 12.57f) + curveTo(132.48f, 11.56f, 131.82f, 10.57f, 130.58f, 10.13f) + curveTo(128.78f, 9.48f, 127.75f, 10.53f, 127.34f, 11.49f) + lineTo(125.87f, 10.96f) + curveTo(126.64f, 8.88f, 128.77f, 8.1f, 131.05f, 8.92f) + curveTo(132.87f, 9.57f, 134.37f, 11.11f, 133.67f, 13.05f) + close() + moveTo(125.27f, 20.24f) + lineTo(125.93f, 18.39f) + lineTo(127.78f, 19.05f) + lineTo(127.12f, 20.9f) + lineTo(125.27f, 20.24f) + close() + } + path( + fill = SolidColor(Color(0xFF3CB572)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = EvenOdd + ) { + moveTo(75.64f, 57.74f) + lineTo(72.67f, 60.7f) + lineTo(76.63f, 64.65f) + lineTo(72.67f, 68.6f) + lineTo(75.64f, 71.57f) + lineTo(79.59f, 67.61f) + lineTo(83.54f, 71.57f) + lineTo(86.5f, 68.6f) + lineTo(82.55f, 64.65f) + lineTo(86.5f, 60.7f) + lineTo(83.54f, 57.74f) + lineTo(79.59f, 61.69f) + lineTo(75.64f, 57.74f) + close() + } + path( + fill = SolidColor(Color(0xFF3CB572)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = EvenOdd + ) { + moveTo(100.08f, 57.74f) + lineTo(97.12f, 60.7f) + lineTo(101.07f, 64.65f) + lineTo(97.12f, 68.6f) + lineTo(100.08f, 71.57f) + lineTo(104.04f, 67.61f) + lineTo(107.99f, 71.57f) + lineTo(110.95f, 68.6f) + lineTo(107.0f, 64.65f) + lineTo(110.95f, 60.7f) + lineTo(107.99f, 57.74f) + lineTo(104.04f, 61.69f) + lineTo(100.08f, 57.74f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = 0.0f, + strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, + pathFillType = NonZero + ) { + moveTo(136.0f, 97.57f) + lineTo(127.1f, 82.14f) + lineTo(115.6f, 88.78f) + lineTo(124.51f, 104.2f) + curveTo(126.34f, 107.38f, 130.4f, 108.46f, 133.57f, 106.63f) + curveTo(136.75f, 104.8f, 137.83f, 100.74f, 136.0f, 97.57f) + close() + } + path( + fill = SolidColor(Color(0x00000000)), stroke = SolidColor(Color(0xFF014958)), + strokeLineWidth = 1.0f, strokeLineCap = Butt, strokeLineJoin = Miter, + strokeLineMiter = 4.0f, pathFillType = NonZero + ) { + moveTo(115.6f, 88.78f) + lineTo(124.51f, 104.2f) + curveTo(126.34f, 107.38f, 130.4f, 108.46f, 133.57f, 106.63f) + verticalLineTo(106.63f) + curveTo(136.75f, 104.8f, 137.83f, 100.74f, 136.0f, 97.57f) + lineTo(127.1f, 82.14f) + } + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(145.71f, 110.91f) + curveTo(144.73f, 110.91f, 143.82f, 110.56f, 143.12f, 109.86f) + curveTo(142.42f, 109.15f, 142.07f, 108.24f, 142.07f, 107.26f) + curveTo(142.07f, 106.28f, 142.42f, 105.37f, 143.12f, 104.67f) + lineTo(146.48f, 101.3f) + curveTo(147.12f, 100.67f, 148.03f, 100.25f, 148.94f, 100.25f) + curveTo(149.85f, 100.18f, 150.76f, 100.53f, 151.46f, 101.16f) + curveTo(152.17f, 101.79f, 152.66f, 102.63f, 152.73f, 103.54f) + curveTo(152.87f, 104.46f, 152.59f, 105.37f, 152.03f, 106.14f) + curveTo(151.88f, 106.35f, 151.54f, 106.42f, 151.32f, 106.28f) + curveTo(151.11f, 106.14f, 151.04f, 105.79f, 151.18f, 105.58f) + curveTo(151.6f, 105.02f, 151.74f, 104.38f, 151.68f, 103.75f) + curveTo(151.6f, 103.12f, 151.25f, 102.49f, 150.76f, 102.07f) + curveTo(150.27f, 101.44f, 149.64f, 101.23f, 149.01f, 101.23f) + curveTo(148.31f, 101.3f, 147.68f, 101.58f, 147.26f, 102.0f) + lineTo(143.89f, 105.37f) + curveTo(143.4f, 105.86f, 143.12f, 106.56f, 143.12f, 107.26f) + curveTo(143.12f, 107.96f, 143.4f, 108.59f, 143.89f, 109.15f) + curveTo(144.87f, 110.14f, 146.63f, 110.14f, 147.61f, 109.15f) + lineTo(148.24f, 108.45f) + curveTo(148.45f, 108.24f, 148.8f, 108.24f, 149.01f, 108.45f) + curveTo(149.22f, 108.66f, 149.22f, 109.01f, 149.01f, 109.22f) + lineTo(148.38f, 109.86f) + curveTo(147.68f, 110.56f, 146.76f, 110.91f, 145.71f, 110.91f) + close() + } + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(151.88f, 108.45f) + curveTo(150.97f, 108.45f, 150.13f, 108.17f, 149.5f, 107.54f) + curveTo(148.8f, 106.91f, 148.38f, 106.07f, 148.24f, 105.16f) + curveTo(148.1f, 104.24f, 148.38f, 103.33f, 148.94f, 102.56f) + curveTo(149.08f, 102.35f, 149.43f, 102.28f, 149.64f, 102.42f) + curveTo(149.85f, 102.56f, 149.92f, 102.91f, 149.78f, 103.12f) + curveTo(149.36f, 103.68f, 149.22f, 104.31f, 149.29f, 104.95f) + curveTo(149.36f, 105.58f, 149.71f, 106.21f, 150.2f, 106.63f) + curveTo(150.69f, 107.05f, 151.32f, 107.26f, 152.03f, 107.26f) + curveTo(152.66f, 107.26f, 153.29f, 106.98f, 153.78f, 106.49f) + lineTo(157.15f, 103.12f) + curveTo(157.57f, 102.77f, 157.85f, 102.14f, 157.85f, 101.44f) + curveTo(157.85f, 100.74f, 157.57f, 100.11f, 157.08f, 99.54f) + curveTo(156.09f, 98.56f, 154.34f, 98.56f, 153.36f, 99.54f) + lineTo(152.8f, 100.11f) + curveTo(152.59f, 100.32f, 152.24f, 100.32f, 152.03f, 100.11f) + curveTo(151.82f, 99.9f, 151.88f, 99.54f, 152.1f, 99.33f) + lineTo(152.59f, 98.84f) + curveTo(153.29f, 98.14f, 154.2f, 97.79f, 155.18f, 97.79f) + curveTo(156.16f, 97.79f, 157.08f, 98.14f, 157.78f, 98.84f) + curveTo(158.48f, 99.54f, 158.83f, 100.46f, 158.83f, 101.44f) + curveTo(158.83f, 102.42f, 158.48f, 103.33f, 157.78f, 104.03f) + lineTo(154.41f, 107.4f) + curveTo(153.78f, 108.03f, 152.87f, 108.45f, 151.96f, 108.45f) + horizontalLineTo(151.88f) + close() + } + path( + fill = SolidColor(Color(0xFFffffff)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(59.87f, 104.2f) + lineTo(68.77f, 88.78f) + lineTo(57.28f, 82.14f) + lineTo(48.37f, 97.57f) + curveTo(46.54f, 100.74f, 47.63f, 104.8f, 50.8f, 106.63f) + curveTo(53.98f, 108.46f, 58.03f, 107.38f, 59.87f, 104.2f) + close() + } + path( + fill = SolidColor(Color(0x00000000)), stroke = + SolidColor(Color(0xFF014958)), strokeLineWidth = 1.0f, strokeLineCap = + Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f, pathFillType = + NonZero + ) { + moveTo(57.28f, 82.14f) + lineTo(48.37f, 97.57f) + curveTo(46.54f, 100.74f, 47.63f, 104.8f, 50.8f, 106.63f) + verticalLineTo(106.63f) + curveTo(53.98f, 108.46f, 58.03f, 107.38f, 59.87f, 104.2f) + lineTo(68.77f, 88.78f) + } + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = EvenOdd + ) { + moveTo(24.79f, 102.28f) + curveTo(24.79f, 100.34f, 26.36f, 98.76f, 28.3f, 98.76f) + curveTo(30.25f, 98.76f, 31.82f, 100.34f, 31.82f, 102.28f) + curveTo(31.82f, 104.22f, 30.25f, 105.79f, 28.3f, 105.79f) + curveTo(26.36f, 105.79f, 24.79f, 104.22f, 24.79f, 102.28f) + close() + moveTo(28.3f, 99.85f) + curveTo(26.96f, 99.85f, 25.87f, 100.93f, 25.87f, 102.28f) + curveTo(25.87f, 103.62f, 26.96f, 104.71f, 28.3f, 104.71f) + curveTo(29.65f, 104.71f, 30.74f, 103.62f, 30.74f, 102.28f) + curveTo(30.74f, 100.93f, 29.65f, 99.85f, 28.3f, 99.85f) + close() + } + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(28.85f, 106.91f) + curveTo(28.03f, 106.81f, 27.2f, 106.94f, 26.46f, 107.29f) + curveTo(25.72f, 107.64f, 25.09f, 108.19f, 24.65f, 108.89f) + curveTo(24.31f, 109.42f, 24.09f, 110.03f, 24.01f, 110.66f) + horizontalLineTo(29.75f) + curveTo(30.05f, 110.66f, 30.29f, 110.9f, 30.29f, 111.2f) + curveTo(30.29f, 111.5f, 30.05f, 111.74f, 29.75f, 111.74f) + horizontalLineTo(23.44f) + curveTo(23.29f, 111.74f, 23.16f, 111.68f, 23.05f, 111.58f) + curveTo(22.95f, 111.48f, 22.9f, 111.35f, 22.9f, 111.2f) + curveTo(22.9f, 110.18f, 23.19f, 109.17f, 23.74f, 108.31f) + curveTo(24.29f, 107.44f, 25.07f, 106.75f, 26.0f, 106.31f) + curveTo(26.93f, 105.87f, 27.96f, 105.71f, 28.98f, 105.84f) + curveTo(30.0f, 105.97f, 30.96f, 106.38f, 31.75f, 107.04f) + curveTo(31.98f, 107.23f, 32.01f, 107.57f, 31.82f, 107.8f) + curveTo(31.63f, 108.03f, 31.29f, 108.06f, 31.06f, 107.87f) + curveTo(30.43f, 107.35f, 29.66f, 107.01f, 28.85f, 106.91f) + close() + } + path( + fill = SolidColor(Color(0xFF014958)), stroke = null, strokeLineWidth = + 0.0f, strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = + 4.0f, pathFillType = NonZero + ) { + moveTo(33.85f, 112.81f) + curveTo(33.56f, 113.15f, 33.12f, 113.36f, 32.63f, 113.36f) + curveTo(31.73f, 113.36f, 31.01f, 112.64f, 31.01f, 111.74f) + curveTo(31.01f, 110.85f, 31.73f, 110.12f, 32.63f, 110.12f) + curveTo(33.03f, 110.12f, 33.39f, 110.26f, 33.67f, 110.5f) + curveTo(33.69f, 110.48f, 33.71f, 110.46f, 33.74f, 110.45f) + lineTo(36.37f, 108.87f) + curveTo(36.4f, 108.85f, 36.42f, 108.84f, 36.45f, 108.83f) + curveTo(36.43f, 108.72f, 36.42f, 108.61f, 36.42f, 108.5f) + curveTo(36.42f, 107.6f, 37.14f, 106.88f, 38.04f, 106.88f) + curveTo(38.93f, 106.88f, 39.66f, 107.6f, 39.66f, 108.5f) + curveTo(39.66f, 109.39f, 38.93f, 110.12f, 38.04f, 110.12f) + curveTo(37.64f, 110.12f, 37.28f, 109.98f, 37.0f, 109.74f) + curveTo(36.98f, 109.76f, 36.95f, 109.78f, 36.93f, 109.79f) + lineTo(34.3f, 111.37f) + curveTo(34.27f, 111.39f, 34.25f, 111.4f, 34.22f, 111.41f) + curveTo(34.24f, 111.52f, 34.25f, 111.63f, 34.25f, 111.74f) + curveTo(34.25f, 111.77f, 34.25f, 111.79f, 34.25f, 111.82f) + curveTo(34.28f, 111.82f, 34.31f, 111.83f, 34.34f, 111.84f) + lineTo(36.73f, 112.8f) + curveTo(36.76f, 112.81f, 36.79f, 112.83f, 36.81f, 112.84f) + curveTo(37.11f, 112.5f, 37.55f, 112.28f, 38.04f, 112.28f) + curveTo(38.93f, 112.28f, 39.66f, 113.01f, 39.66f, 113.9f) + curveTo(39.66f, 114.8f, 38.93f, 115.53f, 38.04f, 115.53f) + curveTo(37.14f, 115.53f, 36.42f, 114.8f, 36.42f, 113.9f) + curveTo(36.42f, 113.88f, 36.42f, 113.86f, 36.42f, 113.83f) + curveTo(36.39f, 113.82f, 36.36f, 113.82f, 36.33f, 113.81f) + lineTo(33.94f, 112.85f) + curveTo(33.91f, 112.83f, 33.88f, 112.82f, 33.85f, 112.81f) + close() + } + }.build() + + return _mascotDeadLight!! + } + +private var _mascotDeadLight: ImageVector? = null + +@Preview +@Composable +private fun Preview() { + Box { + Image( + imageVector = AppIllus.MascotDeadLight, + contentDescription = null, + modifier = Modifier.size(AppImages.previewSize), + ) + } +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt index 01d095860..894d22202 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/main/received/ReceivedScreen.kt @@ -20,17 +20,17 @@ package com.infomaniak.swisstransfer.ui.screen.main.received import android.util.Log import androidx.compose.foundation.layout.padding import androidx.compose.material3.Surface -import androidx.compose.runtime.Composable -import androidx.compose.runtime.derivedStateOf -import androidx.compose.runtime.getValue -import androidx.compose.runtime.remember +import androidx.compose.runtime.* +import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.infomaniak.multiplatform_swisstransfer.common.interfaces.ui.FileUi import com.infomaniak.multiplatform_swisstransfer.common.interfaces.ui.TransferUi import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.components.EmptyState +import com.infomaniak.swisstransfer.ui.components.transfer.TransferExpiredBottomSheet import com.infomaniak.swisstransfer.ui.components.transfer.TransferItemList import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus import com.infomaniak.swisstransfer.ui.images.illus.MascotSearching @@ -57,6 +57,11 @@ fun ReceivedScreen( @Composable private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { + + var isVisible: Boolean by rememberSaveable { mutableStateOf(false) } + var expirationDate: Date? by rememberSaveable { mutableStateOf(null) } + var downloadsLimit: Int? by rememberSaveable { mutableStateOf(null) } + BrandTopAppBarScaffold( floatingActionButton = { ReceivedEmptyFab(areTransfersEmpty) }, ) { @@ -64,7 +69,7 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { EmptyState( icon = AppIllus.MascotSearching, title = R.string.noTransferReceivedTitle, - description = R.string.noTransferReceivedDescription, + description = stringResource(R.string.noTransferReceivedDescription), ) } else { @@ -159,15 +164,37 @@ private fun ReceivedScreen(areTransfersEmpty: () -> Boolean) { modifier = Modifier.padding(Margin.Medium), transfers = transfers, onClick = { transfer -> - if (transfer.expiresInDays < 0 || transfer.downloadLeft == 0) { - Log.d("TODO", "Display expired transfer bottomSheet") - // TODO - } else { - Log.d("TODO", "Display transfer details screen") - // TODO + when { + transfer.expiresInDays < 0 -> { + isVisible = true + expirationDate = Date(transfer.expirationDateTimestamp) + } + transfer.downloadLeft == 0 -> { + isVisible = true + downloadsLimit = transfer.downloadLimit + } + else -> { + Log.d("TODO", "Display transfer details screen") + // TODO + } } } ) + + TransferExpiredBottomSheet( + isVisible = { isVisible }, + expirationDate = { expirationDate }, + downloadsLimit = { downloadsLimit }, + onDeleteTransferClicked = { + Log.d("TODO", "Delete expired Transfer") + // TODO + }, + closeBottomSheet = { + isVisible = false + expirationDate = null + downloadsLimit = null + }, + ) } } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index e1fa06544..df76bfdef 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -89,6 +89,9 @@ Es wurde keine Anwendung gefunden, die diese Aktion bearbeitet (Fakultativ) Aus dem Verlauf löschen + Tut mir leid, diese Übertragung ist am %s abgelaufen. Du kannst die Dateien nicht mehr herunterladen oder ansehen. + Entschuldigung, diese Übertragung hat die Grenze der %d möglichen Downloads erreicht. + Diese Übertragung ist nicht mehr verfügbar Eine Nachricht, die du weitergeben willst? Dateien senden an Senden diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index d997b9d81..c9d9ab5a2 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -89,6 +89,9 @@ No se ha encontrado ninguna aplicación que gestione esta acción (Opcional) Borrar del historial + Lo sentimos, esta transferencia expiró el %s. Ya no puede descargar ni ver los archivos. + Lo sentimos, esta transferencia ha alcanzado el límite de %d descargas posibles. + Esta transferencia ya no está disponible ¿Algún mensaje que quieras transmitir? Enviar archivos a Enviar diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index e4dd089da..e324eabac 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -86,10 +86,13 @@ %d jour %d jours - (Facultatif) Lien copié dans le presse-papiers Aucune application n’a été trouvée pour gérer cette action + (Facultatif) Supprimer de l’historique + Désolé, ce transfert a expiré le %s. Tu ne peux plus télécharger ni consulter les fichiers. + Désolé, ce transfert a atteint la limite de %d téléchargements possibles. + Ce transfert n’est plus disponible Un message à faire passer ? Envoyer les fichiers à Envoyer diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 792d8c447..025e4e81c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -89,6 +89,9 @@ Non è stata trovata alcuna applicazione in grado di gestire questa azione (Opzionale) Cancellare dalla cronologia + Spiacente, questo trasferimento è scaduto il %s. Non è più possibile scaricare o visualizzare i file. + Spiacente, questo trasferimento ha raggiunto il limite di %d download possibili. + Questo trasferimento non è più disponibile Invia i file a C’è qualche messaggio che vorrebbe trasmettere? Invia diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d3a76698a..0604e5754 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -94,6 +94,9 @@ No application has been found to handle this action (Optional) Delete from history + Sorry, this transfer expired on %s. You can no longer download or view the files. + Sorry, this transfer has reached the limit of %d possible downloads. + This transfer is no longer available A message to pass on? Send files to Send From 3b3c0657c546b49d926034702b9c07143c1ecaea Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Thu, 31 Oct 2024 13:24:18 +0100 Subject: [PATCH 3/8] fix: Update `TextDotText` to handle the possibility to set the 2nd text in "error mode" --- .../ui/components/TextDotText.kt | 3 +- .../ui/components/transfer/TransferItem.kt | 32 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt index 36d13c81b..2988e9256 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/TextDotText.kt @@ -35,6 +35,7 @@ fun TextDotText( modifier: Modifier = Modifier, color: Color = SwissTransferTheme.colors.secondaryTextColor, style: TextStyle = SwissTransferTheme.typography.bodySmallRegular, + optionalSecondTextColor: Color? = null, ) { Row(modifier) { CustomText(firstText, color, style) @@ -45,7 +46,7 @@ fun TextDotText( style = style, ) Spacer(Modifier.width(Margin.Mini)) - CustomText(secondText, color, style) + CustomText(secondText, optionalSecondTextColor ?: color, style) } } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt index 7432b7285..4739c897b 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt @@ -53,6 +53,18 @@ fun TransferItem(transfer: TransferUi, onClick: () -> Unit) { val uploadedSize = Formatter.formatShortFileSize(LocalContext.current, transfer.sizeUploaded) val files = transfer.files val filesCount = files.count() + val (expiryText, expiryColor) = when { + remainingDays < 0 -> { + stringResource(R.string.expiredThe, expirationDate.format(FORMAT_DATE_SIMPLE)) to + SwissTransferTheme.materialColors.error + } + remainingDownloads == 0 -> { + "Transfert expiré (TODO)" to SwissTransferTheme.materialColors.error + } + else -> { + stringResource(R.string.expiresIn, remainingDays) to SwissTransferTheme.colors.secondaryTextColor + } + } Card( onClick = onClick, @@ -77,24 +89,8 @@ fun TransferItem(transfer: TransferUi, onClick: () -> Unit) { Spacer(modifier = Modifier.height(Margin.Mini)) TextDotText( firstText = { uploadedSize }, - secondText = { - - val (text, color) = when { - remainingDays < 0 -> { - stringResource(R.string.expiredThe, expirationDate.format(FORMAT_DATE_SIMPLE)) to - SwissTransferTheme.materialColors.error - } - remainingDownloads == 0 -> { - "Transfert expiré (TODO)" to SwissTransferTheme.materialColors.error - } - else -> { - stringResource(R.string.expiresIn, remainingDays) to SwissTransferTheme.colors.secondaryTextColor - } - } - - // TODO: Find a way to also send the color - text to color - }, + secondText = { expiryText }, + optionalSecondTextColor = expiryColor, ) Spacer(modifier = Modifier.height(Margin.Mini)) From 98893f9873eca7cd56ea85276158b7fbf68980a2 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Thu, 31 Oct 2024 14:27:36 +0100 Subject: [PATCH 4/8] refactor: Update Date usage --- .../ui/components/transfer/TransferExpiredBottomSheet.kt | 4 ++-- .../swisstransfer/ui/components/transfer/TransferItem.kt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt index c140783d7..472efb506 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt @@ -24,6 +24,8 @@ import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import com.infomaniak.core2.FORMAT_DATE_SIMPLE +import com.infomaniak.core2.format import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.components.EmptyState import com.infomaniak.swisstransfer.ui.components.LargeButton @@ -34,9 +36,7 @@ import com.infomaniak.swisstransfer.ui.images.icons.Bin import com.infomaniak.swisstransfer.ui.images.illus.mascotDead.MascotDead import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme -import com.infomaniak.swisstransfer.ui.utils.FORMAT_DATE_SIMPLE import com.infomaniak.swisstransfer.ui.utils.PreviewAllWindows -import com.infomaniak.swisstransfer.ui.utils.format import java.util.Date @Composable diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt index 4739c897b..f7a6122b1 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import com.infomaniak.core2.FORMAT_DATE_SIMPLE import com.infomaniak.core2.FORMAT_DATE_TITLE import com.infomaniak.core2.format import com.infomaniak.multiplatform_swisstransfer.common.interfaces.ui.FileUi From f564a2e83b06f54895121ce6532769706030dfca Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Fri, 1 Nov 2024 11:17:59 +0100 Subject: [PATCH 5/8] fix: Add missing `Bin` copyright --- .../swisstransfer/ui/images/icons/Bin.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt index 8079f2409..ac2d5b551 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/Bin.kt @@ -1,3 +1,20 @@ +/* + * Infomaniak SwissTransfer - Android + * Copyright (C) 2024 Infomaniak Network SA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.infomaniak.swisstransfer.ui.images.icons import androidx.compose.foundation.Image From ebf636b0c5af331c1d102db244659b9dfbb3d47a Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 4 Nov 2024 15:08:12 +0100 Subject: [PATCH 6/8] review: Remove now useless `Modifier` --- .../ui/components/transfer/TransferExpiredBottomSheet.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt index 472efb506..25799ffc9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferExpiredBottomSheet.kt @@ -61,7 +61,6 @@ fun TransferExpiredBottomSheet( } SwissTransferBottomSheet( - modifier = Modifier, onDismissRequest = closeBottomSheet, bottomButton = { LargeButton( From 086871e42f2ea8d122916f7354a4aae7bd9aa85e Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 4 Nov 2024 15:08:42 +0100 Subject: [PATCH 7/8] =?UTF-8?q?review:=20Use=20`getHumanReadableSize(?= =?UTF-8?q?=E2=80=A6)`=20instead=20of=20`formatShortFileSize(=E2=80=A6)`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/infomaniak/swisstransfer/ui/components/FileItem.kt | 4 ++-- .../swisstransfer/ui/components/transfer/TransferItem.kt | 4 ++-- .../swisstransfer/ui/utils/HumanReadableSizeUtils.kt | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt index 28ba580c0..934ca3887 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/FileItem.kt @@ -17,7 +17,6 @@ */ package com.infomaniak.swisstransfer.ui.components -import android.text.format.Formatter import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background import androidx.compose.foundation.layout.* @@ -35,6 +34,7 @@ import com.infomaniak.swisstransfer.ui.theme.CustomShapes import com.infomaniak.swisstransfer.ui.theme.Dimens import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme +import com.infomaniak.swisstransfer.ui.utils.HumanReadableSizeUtils import com.infomaniak.swisstransfer.ui.utils.PreviewAllWindows @Composable @@ -53,7 +53,7 @@ fun FileItem( isRemoveButtonVisible = isRemoveButtonVisible, onRemove = onRemove, title = file.fileName, - description = Formatter.formatShortFileSize(LocalContext.current, file.fileSize), + description = HumanReadableSizeUtils.getHumanReadableSize(LocalContext.current, file.fileSize), content = { FilePreview( file = file, diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt index f7a6122b1..0d19ac8f5 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/transfer/TransferItem.kt @@ -17,7 +17,6 @@ */ package com.infomaniak.swisstransfer.ui.components.transfer -import android.text.format.Formatter import androidx.compose.foundation.layout.* import androidx.compose.material3.* import androidx.compose.runtime.Composable @@ -38,6 +37,7 @@ import com.infomaniak.swisstransfer.ui.images.icons.ChevronRightThick import com.infomaniak.swisstransfer.ui.theme.CustomShapes import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme +import com.infomaniak.swisstransfer.ui.utils.HumanReadableSizeUtils import com.infomaniak.swisstransfer.ui.utils.PreviewAllWindows import java.util.Calendar import java.util.Date @@ -51,7 +51,7 @@ fun TransferItem(transfer: TransferUi, onClick: () -> Unit) { val expirationDate = Date(transfer.expirationDateTimestamp) val remainingDays = transfer.expiresInDays val remainingDownloads = transfer.downloadLeft - val uploadedSize = Formatter.formatShortFileSize(LocalContext.current, transfer.sizeUploaded) + val uploadedSize = HumanReadableSizeUtils.getHumanReadableSize(LocalContext.current, transfer.sizeUploaded) val files = transfer.files val filesCount = files.count() val (expiryText, expiryColor) = when { diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/HumanReadableSizeUtils.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/HumanReadableSizeUtils.kt index 3d6d4c5b2..7a5e4f6d1 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/HumanReadableSizeUtils.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/HumanReadableSizeUtils.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.res.pluralStringResource import com.infomaniak.swisstransfer.R object HumanReadableSizeUtils { + fun getHumanReadableSize(context: Context, sizeInBytes: Long): String { return Formatter.formatShortFileSize(context, sizeInBytes) } From 85d381c45633917887f48793e20d4358f5c0dae8 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 4 Nov 2024 15:09:05 +0100 Subject: [PATCH 8/8] refactor: Rename `isBottomSheetVisible()` into `isVisible()` --- .../ui/screen/newtransfer/importfiles/ImportFilesScreen.kt | 2 +- .../importfiles/UploadSourceChoiceBottomSheet.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt index fb0df057b..694f4cd7d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt @@ -152,7 +152,7 @@ private fun ImportFilesScreen( } UploadSourceChoiceBottomSheet( - isBottomSheetVisible = { showUploadSourceChoiceBottomSheet }, + isVisible = { showUploadSourceChoiceBottomSheet }, onFilePickerClicked = { filePickerLauncher.launch(arrayOf("*/*")) }, closeBottomSheet = { showUploadSourceChoiceBottomSheet = false }, ) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt index 0351074a2..7e2a5f622 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/UploadSourceChoiceBottomSheet.kt @@ -36,12 +36,12 @@ import com.infomaniak.swisstransfer.ui.utils.PreviewAllWindows @Composable fun UploadSourceChoiceBottomSheet( - isBottomSheetVisible: () -> Boolean, + isVisible: () -> Boolean, onFilePickerClicked: () -> Unit, closeBottomSheet: () -> Unit, ) { - if (!isBottomSheetVisible()) return + if (!isVisible()) return SwissTransferBottomSheet( onDismissRequest = closeBottomSheet, @@ -84,7 +84,7 @@ private fun UploadSourceChoiceBottomSheetPreview() { SwissTransferTheme { Surface { UploadSourceChoiceBottomSheet( - isBottomSheetVisible = { true }, + isVisible = { true }, onFilePickerClicked = {}, closeBottomSheet = {}, )