-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/ds card component #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // The card components are shaded and rounded areas that give the interface depth. | ||
| // Whether static or interactive - the cards are the basis for further components and modules and can display content and actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the comment lines to KDoc and add missing parameter with descriptions.
| val spacingValue = when (spacing) { | ||
| DSSpacing.SMALL -> DesignSystemTheme.dimensions.spacing.fixedSm | ||
| DSSpacing.MEDIUM -> DesignSystemTheme.dimensions.spacing.fixedMd | ||
| DSSpacing.LARGE -> DesignSystemTheme.dimensions.spacing.fixedLg | ||
| } | ||
|
|
||
| val elevationColor = when (elevation) { | ||
| DSCardElevation.LEVEL_1 -> DesignSystemTheme.activeColor.bgBasicLevel1Default | ||
| DSCardElevation.LEVEL_2 -> DesignSystemTheme.activeColor.bgBasicLevel2Default | ||
| DSCardElevation.LEVEL_3 -> DesignSystemTheme.activeColor.bgBasicLevel3Default | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add these values to the respective enum as attributes.
| } | ||
| } | ||
|
|
||
| enum class DSSpacing { SMALL, MEDIUM, LARGE } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to DSCardSpacing?
| .padding(spacingValue) | ||
| .then(modifier) | ||
| ) { | ||
| Column(modifier = Modifier, content = content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use Modifier.fillMaxSize()? Or even better: Use the content parameter directly for the surfaces' content attribute.
|
|
||
| @Composable | ||
| @Preview() | ||
| fun DSCardPreview() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add DSCardElevation and DSCardSpacing PreviewParameters and use them for the preview. Maybe we could also add a PreviewParameter with some colors to preview adaptive colors.
No description provided.