-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(quantity-pickers): Add error message label and snapshot testing (#…
- Loading branch information
1 parent
173dba8
commit 3515450
Showing
16 changed files
with
462 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...rs/src/main/java/com/decathlon/vitamin/compose/quantity/pickers/VitaminQuantitiesSizes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.decathlon.vitamin.compose.quantity.pickers | ||
|
||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.Immutable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.decathlon.vitamin.compose.foundation.VitaminTheme | ||
|
||
@Immutable | ||
data class QuantitySizes( | ||
val height: Dp, | ||
val width: Dp, | ||
val textStyle: TextStyle, | ||
val shape: RoundedCornerShape, | ||
val helperTextStyle: TextStyle, | ||
val helperIconSize: Dp | ||
) | ||
|
||
object VitaminQuantitiesSizes { | ||
|
||
@Composable | ||
fun primary( | ||
height: Dp = 48.dp, | ||
width: Dp = 156.dp, | ||
textStyle: TextStyle = VitaminTheme.typography.text2, | ||
shape: RoundedCornerShape = VitaminTheme.shapes.radius100, | ||
helperTextStyle: TextStyle = VitaminTheme.typography.text3, | ||
helperIconSize: Dp = 16.dp | ||
): QuantitySizes = | ||
remember( | ||
height, | ||
width, | ||
textStyle, | ||
shape, | ||
helperTextStyle, | ||
helperIconSize | ||
) { | ||
QuantitySizes( | ||
height = height, | ||
width = width, | ||
textStyle = textStyle, | ||
shape = shape, | ||
helperTextStyle = helperTextStyle, | ||
helperIconSize = helperIconSize | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.