From 09aded68ae1dd7480b0dd90d64e4ceaafc3e9f10 Mon Sep 17 00:00:00 2001 From: Fabian Devel Date: Tue, 17 Dec 2024 16:11:21 +0100 Subject: [PATCH] refactor(TransferTypes): Directly use the KMP's order for transferTypes to be auto aligned with iOS --- .../components/TransferTypeButtons.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt index 7320d8f99..99e0cbc5f 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt @@ -32,6 +32,7 @@ import com.infomaniak.swisstransfer.ui.images.icons.Chain import com.infomaniak.swisstransfer.ui.images.icons.Envelope import com.infomaniak.swisstransfer.ui.images.icons.QrCode import com.infomaniak.swisstransfer.ui.images.icons.WifiWave +import com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles.components.TransferTypeUi.Companion.toTransferTypeUi import com.infomaniak.swisstransfer.ui.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.GetSetCallbacks @@ -46,7 +47,7 @@ fun TransferTypeButtons(horizontalPadding: Dp, transferType: GetSetCallbacks LaunchedEffect(Unit) { @@ -78,6 +79,13 @@ enum class TransferTypeUi( descriptionRes = null, dbValue = TransferType.QR_CODE, ), + MAIL( + buttonIcon = AppIcons.Envelope, + buttonTextRes = R.string.transferTypeEmail, + titleRes = R.string.uploadSuccessEmailTitle, + descriptionRes = R.plurals.uploadSuccessEmailDescription, + dbValue = TransferType.MAIL, + ), LINK( buttonIcon = AppIcons.Chain, buttonTextRes = R.string.transferTypeLink, @@ -91,13 +99,6 @@ enum class TransferTypeUi( titleRes = R.string.uploadSuccessLinkTitle, descriptionRes = R.string.uploadSuccessLinkDescription, dbValue = TransferType.PROXIMITY, - ), - MAIL( - buttonIcon = AppIcons.Envelope, - buttonTextRes = R.string.transferTypeEmail, - titleRes = R.string.uploadSuccessEmailTitle, - descriptionRes = R.plurals.uploadSuccessEmailDescription, - dbValue = TransferType.MAIL, ); companion object {