diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/WifiWave.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/WifiWave.kt index 3a055d780..22c71372b 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/WifiWave.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/images/icons/WifiWave.kt @@ -2,7 +2,6 @@ package com.infomaniak.swisstransfer.ui.images.icons import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -65,4 +64,4 @@ private fun Preview() { modifier = Modifier.size(AppImages.previewSize) ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt index 5e4bf7e1a..b5c02a72d 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButton.kt @@ -42,6 +42,7 @@ fun TransferTypeButton( } else { SwissTransferTheme.materialColors.outlineVariant to SwissTransferTheme.colors.secondaryTextColor } + Button( modifier = Modifier .padding(Margin.XSmall) @@ -54,7 +55,7 @@ fun TransferTypeButton( ) { Icon(modifier = Modifier.size(Margin.Medium), imageVector = transferType.buttonIcon, contentDescription = null) Spacer(modifier = Modifier.width(Margin.Small)) - Text(text = stringResource(id = transferType.buttonText), style = SwissTransferTheme.typography.bodyRegular) + Text(text = stringResource(transferType.buttonText), style = SwissTransferTheme.typography.bodySmallRegular) } } 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 8c6b0df6b..254ac8e4e 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 @@ -21,6 +21,7 @@ import android.content.res.Configuration import androidx.annotation.StringRes import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.material3.Surface import androidx.compose.runtime.Composable @@ -36,6 +37,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.theme.Margin import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme @Composable @@ -43,16 +45,21 @@ fun TransferTypeButtons(selectedTransferType: TransferType) { val selectedItem by rememberSaveable { mutableStateOf(selectedTransferType) } - Row(modifier = Modifier.horizontalScroll(rememberScrollState())) { - for (entry in TransferType.entries) { + Row( + modifier = Modifier + .horizontalScroll(rememberScrollState()) + .padding(horizontal = Margin.Small), + ) { + for (transferTypeEntry in TransferType.entries) { TransferTypeButton( - transferType = entry, - isActive = { entry == selectedItem }, + transferType = transferTypeEntry, + isActive = { transferTypeEntry == selectedItem }, ) } } } +// TODO: onClick enum class TransferType(val buttonIcon: ImageVector, @StringRes val buttonText: Int, val onClick: () -> Unit = {}) { LINK(buttonIcon = AppIcons.Chain, buttonText = R.string.transferTypeLink), QR_CODE(buttonIcon = AppIcons.QrCode, buttonText = R.string.transferTypeQrCode),