diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt index 0afd43465..4d65ae985 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/Buttons.kt @@ -32,8 +32,8 @@ import androidx.compose.ui.unit.dp 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.theme.CustomShapes import com.infomaniak.swisstransfer.ui.theme.Margin -import com.infomaniak.swisstransfer.ui.theme.Shapes import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme @Composable @@ -73,7 +73,7 @@ private fun CoreButton( Button( modifier = modifier.height(buttonSize.height), colors = style.buttonColors(), - shape = Shapes.medium, + shape = CustomShapes.medium, enabled = enabled, onClick = onClick, ) { 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 f36ce4b38..ed8883c2b 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 @@ -42,9 +42,9 @@ import com.infomaniak.library.filetypes.FileType import com.infomaniak.swisstransfer.R import com.infomaniak.swisstransfer.ui.images.AppImages import com.infomaniak.swisstransfer.ui.images.icons.CrossThick +import com.infomaniak.swisstransfer.ui.theme.CustomShapes import com.infomaniak.swisstransfer.ui.theme.LocalIsDarkMode import com.infomaniak.swisstransfer.ui.theme.Margin -import com.infomaniak.swisstransfer.ui.theme.Shapes import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme import com.infomaniak.swisstransfer.ui.utils.PreviewLargeWindow import com.infomaniak.swisstransfer.ui.utils.PreviewSmallWindow @@ -104,7 +104,7 @@ private fun FileItemContent( onClick = onClick, modifier = Modifier.aspectRatio(164 / 152f), colors = CardDefaults.cardColors(containerColor = SwissTransferTheme.materialColors.background), - shape = Shapes.small, + shape = CustomShapes.small, border = BorderStroke(width = 1.dp, SwissTransferTheme.materialColors.outlineVariant) ) { Box( diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt index c04aee1b0..810e1d3a9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/components/SwissTransferFab.kt @@ -36,8 +36,8 @@ import androidx.compose.ui.unit.dp 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.theme.CustomShapes import com.infomaniak.swisstransfer.ui.theme.Margin -import com.infomaniak.swisstransfer.ui.theme.Shapes import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme @Composable @@ -62,8 +62,8 @@ fun SwissTransferFab( } enum class FabType(val shape: CornerBasedShape, val customSize: Dp?) { - NORMAL(Shapes.medium, null), - BIG(Shapes.large, 80.dp), + NORMAL(CustomShapes.medium, null), + BIG(CustomShapes.large, 80.dp), } @Preview(name = "Light mode") diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/CustomShapes.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/CustomShapes.kt index 8a2480ddb..f3ad6a963 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/CustomShapes.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/CustomShapes.kt @@ -18,8 +18,13 @@ package com.infomaniak.swisstransfer.ui.theme import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.ui.unit.dp object CustomShapes { val None = RoundedCornerShape(0) val Rounded = RoundedCornerShape(50) + val extraSmall = RoundedCornerShape(4.dp) + val small = RoundedCornerShape(8.dp) + val medium = RoundedCornerShape(16.dp) + val large = RoundedCornerShape(24.dp) } diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Shapes.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Shapes.kt deleted file mode 100644 index 48d7ea04f..000000000 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Shapes.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.theme - -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Shapes -import androidx.compose.ui.unit.dp - -val Shapes = Shapes( - extraSmall = RoundedCornerShape(4.dp), - small = RoundedCornerShape(8.dp), - medium = RoundedCornerShape(16.dp), - large = RoundedCornerShape(24.dp), - // extraLarge: uses default values, for the bottom sheet corners -) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Theme.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Theme.kt index 6e252c599..0c0bedb8b 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Theme.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/theme/Theme.kt @@ -21,6 +21,7 @@ import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.ColorScheme import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Shapes import androidx.compose.material3.adaptive.WindowAdaptiveInfo import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo import androidx.compose.runtime.* @@ -85,3 +86,11 @@ data class CustomColorScheme( val transferTypeProximityContainer: Color = Color.Unspecified, val transferTypeProximityOnContainer: Color = Color.Unspecified, ) + +private val Shapes = Shapes( + extraSmall = CustomShapes.extraSmall, + small = CustomShapes.small, + medium = CustomShapes.medium, + large = CustomShapes.large, + // extraLarge: uses default values, for the bottom sheet corners +)