diff --git a/catalog/src/main/kotlin/com/adevinta/spark/catalog/tabbar/CatalogTabBar.kt b/catalog/src/main/kotlin/com/adevinta/spark/catalog/tabbar/CatalogTabBar.kt index a705a2276..96d06ceba 100644 --- a/catalog/src/main/kotlin/com/adevinta/spark/catalog/tabbar/CatalogTabBar.kt +++ b/catalog/src/main/kotlin/com/adevinta/spark/catalog/tabbar/CatalogTabBar.kt @@ -89,7 +89,8 @@ private fun AppIcon() { modifier = Modifier .padding(start = 16.dp) .size(24.dp), - painter = painter, // spark logo + // spark logo + painter = painter, contentDescription = null, ) } diff --git a/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/kleinanzeigen/Color.kt b/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/kleinanzeigen/Color.kt index 162f9573e..a21edafb8 100644 --- a/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/kleinanzeigen/Color.kt +++ b/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/kleinanzeigen/Color.kt @@ -117,7 +117,7 @@ internal val KleinanzeigenLight: SparkColors = lightSparkColors( onSupportVariant = White, success = Green600, onSuccess = White, - successContainer = Green100, // == surface disabled + successContainer = Green100, onSuccessContainer = Green600, alert = Yellow300, onAlert = Neutral900, @@ -168,7 +168,7 @@ internal val KleinanzeigenDark: SparkColors = lightSparkColors( onSupport = Neutral900, supportContainer = Green700, onSupportContainer = Green100, - supportVariant = Green800, // tertiary => neutral / Dim 1 + supportVariant = Green800, onSupportVariant = White, success = Green100, onSuccess = Neutral900, diff --git a/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/leboncoin/Color.kt b/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/leboncoin/Color.kt index 3617a782c..ad3b5ae57 100644 --- a/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/leboncoin/Color.kt +++ b/catalog/src/main/kotlin/com/adevinta/spark/catalog/themes/themeprovider/leboncoin/Color.kt @@ -201,7 +201,8 @@ internal val LeboncoinColorPartLightLegacy: SparkColors = lightSparkColors( onAccentVariant = Color.White, basic = BrikkeBlack, onBasic = Color.White, - basicContainer = BrikkeGreyLight, // Highlight Surface => backgroundVariant + // Highlight Surface => backgroundVariant + basicContainer = BrikkeGreyLight, onBasicContainer = Blueberry900, main = BrikkeOrange, onMain = Color.White, @@ -211,9 +212,11 @@ internal val LeboncoinColorPartLightLegacy: SparkColors = lightSparkColors( onMainVariant = Color.White, support = BrikkeBlack, onSupport = Color.White, - supportContainer = BrikkeGreyLight, // Highlight Surface => backgroundVariant + // Highlight Surface => backgroundVariant + supportContainer = BrikkeGreyLight, onSupportContainer = Blueberry900, - supportVariant = BrikkeGreyDark, // tertiary => neutral / Dim 1 + // tertiary => neutral / Dim 1 + supportVariant = BrikkeGreyDark, onSupportVariant = Grey10, tertiary = BrikkeGrey, onTertiary = GreyBlue99, @@ -237,11 +240,13 @@ internal val LeboncoinColorPartLightLegacy: SparkColors = lightSparkColors( onInfoContainer = Blueberry700, neutral = NightShade50, onNeutral = Color.White, - neutralContainer = NightShade50, // == surface Highlight + // == surface Highlight + neutralContainer = NightShade50, onNeutralContainer = NightShade700, background = Color.White, onBackground = Blueberry900, - backgroundVariant = GreyBlue90, // == surface disabled + // == surface disabled + backgroundVariant = GreyBlue90, onBackgroundVariant = GreyBlue30, surface = Color.White, onSurface = Grey10, @@ -266,7 +271,8 @@ internal val LeboncoinColorProLightLegacy: SparkColors = lightSparkColors( onAccentVariant = Color.White, basic = BrikkeBlack, onBasic = Color.White, - basicContainer = BrikkeGreyLight, // Highlight Surface => backgroundVariant + // Highlight Surface => backgroundVariant + basicContainer = BrikkeGreyLight, onBasicContainer = Blueberry900, main = BrikkeBlue, onMain = Color.White, @@ -276,9 +282,11 @@ internal val LeboncoinColorProLightLegacy: SparkColors = lightSparkColors( onMainVariant = Color.White, support = BrikkeBlack, onSupport = Color.White, - supportContainer = BrikkeGreyLight, // Highlight Surface => backgroundVariant + // Highlight Surface => backgroundVariant + supportContainer = BrikkeGreyLight, onSupportContainer = Blueberry900, - supportVariant = BrikkeGreyDark, // tertiary => neutral / Dim 1 + // tertiary => neutral / Dim 1 + supportVariant = BrikkeGreyDark, onSupportVariant = Grey10, tertiary = BrikkeGrey, onTertiary = GreyBlue99, @@ -302,11 +310,13 @@ internal val LeboncoinColorProLightLegacy: SparkColors = lightSparkColors( onInfoContainer = Blueberry700, neutral = NightShade50, onNeutral = Color.White, - neutralContainer = NightShade50, // == surface Highlight + // == surface Highlight + neutralContainer = NightShade50, onNeutralContainer = NightShade700, background = Color.White, onBackground = Blueberry900, - backgroundVariant = GreyBlue90, // == surface disabled + // == surface disabled + backgroundVariant = GreyBlue90, onBackgroundVariant = GreyBlue30, surface = Color.White, onSurface = Grey10, @@ -343,7 +353,8 @@ internal val LeboncoinColorPartLight: SparkColors = lightSparkColors( onSupport = Color.White, supportContainer = Blueberry100, onSupportContainer = Blueberry900, - supportVariant = Blueberry700, // tertiary => neutral / Dim 1 + // tertiary => neutral / Dim 1 + supportVariant = Blueberry700, onSupportVariant = Color.White, tertiary = Color.Magenta, onTertiary = Color.Blue, @@ -351,7 +362,8 @@ internal val LeboncoinColorPartLight: SparkColors = lightSparkColors( onTertiaryContainer = Color.Blue, success = Avocado500, onSuccess = Color.White, - successContainer = Avocado100, // == surface disabled + // == surface disabled + successContainer = Avocado100, onSuccessContainer = Avocado700, alert = Banana500, onAlert = NightShade900, @@ -403,7 +415,8 @@ internal val LeboncoinColorProLight: SparkColors = lightSparkColors( onSupport = Color.White, supportContainer = Blueberry100, onSupportContainer = Blueberry900, - supportVariant = Blueberry700, // tertiary => neutral / Dim 1 + // tertiary => neutral / Dim 1 + supportVariant = Blueberry700, onSupportVariant = Color.White, tertiary = Color.Magenta, onTertiary = Color.Blue, @@ -411,7 +424,8 @@ internal val LeboncoinColorProLight: SparkColors = lightSparkColors( onTertiaryContainer = Color.Blue, success = Avocado500, onSuccess = Color.White, - successContainer = Avocado100, // == surface disabled + // == surface disabled + successContainer = Avocado100, onSuccessContainer = Avocado700, alert = Banana500, onAlert = NightShade900, diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/ModalBottomSheetLayout.kt b/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/ModalBottomSheetLayout.kt index d0c4a7536..4b441df58 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/ModalBottomSheetLayout.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/ModalBottomSheetLayout.kt @@ -390,7 +390,8 @@ public fun ModalBottomSheetLayout( DragHandle( Modifier .align(Alignment.CenterHorizontally) - .padding(top = 8.dp, bottom = 16.dp), // specs to extract into default? + // specs to extract into default? + .padding(top = 8.dp, bottom = 16.dp), ) sheetContent() } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/SwipeableV2.kt b/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/SwipeableV2.kt index d55e56b80..d6a147016 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/SwipeableV2.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/SwipeableV2.kt @@ -266,7 +266,13 @@ internal class SwipeableV2State( if (distance > 1e-6f) { val progress = (this.requireOffset() - a) / (b - a) // If we are very close to 0f or 1f, we round to the closest - if (progress < 1e-6f) 0f else if (progress > 1 - 1e-6f) 1f else progress + if (progress < 1e-6f) { + 0f + } else if (progress > 1 - 1e-6f) { + 1f + } else { + progress + } } else { 1f } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/modal/ModalBottomSheet.kt b/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/modal/ModalBottomSheet.kt index 57e21b4de..fa50d356b 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/modal/ModalBottomSheet.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/bottomsheet/modal/ModalBottomSheet.kt @@ -365,7 +365,11 @@ private fun ModalBottomSheetAnchorChangeHandler( val hasPartiallyExpandedState = newAnchors.containsKey(SheetValue.PartiallyExpanded) val newTarget = if (hasPartiallyExpandedState) { SheetValue.PartiallyExpanded - } else if (newAnchors.containsKey(Expanded)) Expanded else Hidden + } else if (newAnchors.containsKey(Expanded)) { + Expanded + } else { + Hidden + } newTarget } } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/buttons/Button.kt b/spark/src/main/kotlin/com/adevinta/spark/components/buttons/Button.kt index fe48a43e5..d0c20f41e 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/buttons/Button.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/buttons/Button.kt @@ -111,7 +111,8 @@ internal fun BaseSparkButton( modifier = Modifier .size(SparkButtonDefaults.IconSize) .testTag("buttonIcon"), - contentDescription = null, // button text should be enough for context + // button text should be enough for context + contentDescription = null, ) Spacer(Modifier.width(SparkButtonDefaults.IconSpacing)) } @@ -125,7 +126,8 @@ internal fun BaseSparkButton( modifier = Modifier .size(SparkButtonDefaults.IconSize) .testTag("buttonIcon"), - contentDescription = null, // button text should be enough for context + // button text should be enough for context + contentDescription = null, ) } } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/image/Image.kt b/spark/src/main/kotlin/com/adevinta/spark/components/image/Image.kt index ba37ec136..74eeea095 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/image/Image.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/image/Image.kt @@ -197,7 +197,8 @@ private fun ImageIconState(sparkIcon: SparkIcon) { EmphasizeDim2 { Icon( sparkIcon = sparkIcon, - contentDescription = null, // The SparkImage handle the content description + // The SparkImage handle the content description + contentDescription = null, modifier = Modifier.padding(8.dp), ) } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/image/UserAvatar.kt b/spark/src/main/kotlin/com/adevinta/spark/components/image/UserAvatar.kt index 5590027f9..303597fc3 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/image/UserAvatar.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/image/UserAvatar.kt @@ -111,7 +111,8 @@ private fun ImageIconState(sparkIcon: SparkIcon) { ) { Illustration( sparkIcon = sparkIcon, - contentDescription = null, // The SparkImage handle the content description + // The SparkImage handle the content description + contentDescription = null, ) } } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/popover/Popover.kt b/spark/src/main/kotlin/com/adevinta/spark/components/popover/Popover.kt index d156dd5bd..25823b87e 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/popover/Popover.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/popover/Popover.kt @@ -83,20 +83,15 @@ import kotlinx.coroutines.launch @OptIn(ExperimentalMaterial3Api::class) public fun Popover( popoverContent: @Composable () -> Unit, - modifier: Modifier = Modifier, // ignored + modifier: Modifier = Modifier, isDismissButtonEnabled: Boolean = false, popoverState: TooltipState = rememberTooltipState(isPersistent = true), anchorContent: @Composable () -> Unit, ) { val shape: Shape = TooltipDefaults.richTooltipContainerShape - /** - * ComposeLint lib currently doesn't catch suppress "ComposeModifierMissing" - * and throws a lint error - * TODO: remove unnecessary @modifier parameter when they fix it in a later version - */ - modifier.hashCode() TooltipBox( + modifier = modifier, positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(), tooltip = { val colors: RichTooltipColors = TooltipDefaults.richTooltipColors() diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/tags/Tag.kt b/spark/src/main/kotlin/com/adevinta/spark/components/tags/Tag.kt index 1341f3192..21199aca5 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/tags/Tag.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/tags/Tag.kt @@ -97,7 +97,8 @@ internal fun BaseSparkTag( Icon( sparkIcon = leadingIcon, modifier = Modifier.size(LeadingIconSize), - contentDescription = null, // The tag is associated with a mandatory label so it's okay + // The tag is associated with a mandatory label so it's okay + contentDescription = null, tint = tint ?: LocalContentColor.current, ) } diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/AddonScope.kt b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/AddonScope.kt index 1ae3b2fc4..52e643201 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/AddonScope.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/AddonScope.kt @@ -116,7 +116,8 @@ public abstract class AddonScope { Icon( sparkIcon = icon, modifier = Modifier.size(SparkButtonDefaults.IconSize), - contentDescription = null, // button text should be enough for context + // button text should be enough for context + contentDescription = null, ) } AnimatedVisibility(visible = isLoading) { diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SparkTextField.kt b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SparkTextField.kt index f2385e9ef..5508a5e24 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SparkTextField.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/SparkTextField.kt @@ -193,8 +193,10 @@ internal fun SparkTextField( placeholder: String?, helper: String?, counter: TextFieldCharacterCounter?, - leadingIcon: @Composable (AddonScope.() -> Unit)?, // Should we rename it to leadingContent? - trailingIcon: @Composable (AddonScope.() -> Unit)?, // Should we rename it to trailingContent? + // Should we rename it to leadingContent? + leadingIcon: @Composable (AddonScope.() -> Unit)?, + // Should we rename it to trailingContent? + trailingIcon: @Composable (AddonScope.() -> Unit)?, state: TextFieldState?, stateMessage: String?, visualTransformation: VisualTransformation, diff --git a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt index 688c60ab3..1dd667b0a 100644 --- a/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt +++ b/spark/src/main/kotlin/com/adevinta/spark/components/textfields/TextField.kt @@ -130,7 +130,8 @@ public fun TextField( label = label, placeholder = placeholder, helper = helper, - counter = null, // Available only for MultilineTextField Variant + // Available only for MultilineTextField Variant + counter = null, leadingContent = leadingContent, trailingContent = trailingContentBasedOnState, state = state, @@ -225,7 +226,8 @@ public fun TextField( label = label, placeholder = placeholder, helper = helper, - counter = null, // Available only for MultilineTextField Variant + // Available only for MultilineTextField Variant + counter = null, leadingIcon = leadingContent, trailingIcon = trailingContentBasedOnState, state = state,