Skip to content
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

feat: [ANDROAPP-6693] Compose table migration #336

Merged
merged 12 commits into from
Jan 17, 2025

Conversation

xavimolloy
Copy link
Contributor

No description provided.

@xavimolloy xavimolloy marked this pull request as draft December 2, 2024 08:58
@andresmr andresmr force-pushed the ANDROAPP-6693-move-table-to-design-system branch from a1dc252 to d9cbc3d Compare December 20, 2024 10:42
@andresmr andresmr force-pushed the ANDROAPP-6693-move-table-to-design-system branch from 3fb51ff to accc167 Compare January 9, 2025 09:00
@andresmr andresmr marked this pull request as ready for review January 9, 2025 09:03
textColor = LocalTableColors.current.headerText,
)
columnIndex % 2 == 0 -> CellStyle.HeaderStyle(
backgroundColor = LocalTableColors.current.headerBackground1,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could improve this naming for the headerBackground1 and 2 to something like primary and secondaryHeaderBackground

Copy link
Contributor Author

@xavimolloy xavimolloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job! comment approved!

Comment on lines +40 to +68
data class TableDimensions(
val tableHorizontalPadding: Dp = Spacing.Spacing16,
val tableVerticalPadding: Dp = Spacing.Spacing16,
val defaultCellWidth: Int = 160,
val defaultCellHeight: Dp = Spacing.Spacing36,
val defaultRowHeaderWidth: Int = 275,
val defaultHeaderHeight: Int = 36,
val defaultLegendCornerSize: Dp = Spacing.Spacing2,
val defaultLegendBorderWidth: Dp = Spacing.Spacing8,
val defaultHeaderTextSize: TextUnit = 12.sp,
val defaultRowHeaderTextSize: TextUnit = 12.sp,
val defaultCellTextSize: TextUnit = 12.sp,
val totalWidth: Int = 0,
val cellVerticalPadding: Dp = Spacing.Spacing4,
val cellHorizontalPadding: Dp = Spacing.Spacing4,
val headerCellPaddingValues: PaddingValues = PaddingValues(
horizontal = Spacing.Spacing4,
vertical = Spacing.Spacing11,
),
val tableBottomPadding: Dp = Spacing.Spacing200,
val extraWidths: Map<String, Int> = emptyMap(),
val rowHeaderWidths: Map<String, Int> = emptyMap(),
val columnWidth: Map<String, Map<Int, Int>> = emptyMap(),
val minRowHeaderWidth: Int = 130,
val minColumnWidth: Int = 130,
val maxRowHeaderWidth: Int = Int.MAX_VALUE,
val maxColumnWidth: Int = Int.MAX_VALUE,
val tableEndExtraScroll: Dp = Spacing.Spacing6,
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these be too much properties on the data class, maybe they could be grouped someway. Maybe reducing the amount of properties needed. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this issue is just a migration to validate proper work of the table. Maybe we could improve it in the future

}

private fun updateAllWidthBy(tableId: String, widthOffset: Float): TableDimensions {
val newWidth = (extraWidths[tableId] ?: 0) + widthOffset - 11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 11 represent? why not 12 or 10?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why, maybe is the sum of some padding or margins. @Balcan , @mmmateos , do you know why?

val newWidth = (
columnWidth[tableId]?.get(column)
?: (defaultCellWidth + (currentExtraSize[tableId] ?: 0))
) + widthOffset - 11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

@andresmr andresmr force-pushed the ANDROAPP-6693-move-table-to-design-system branch from 89b0198 to 5bc178d Compare January 15, 2025 11:58
@andresmr andresmr merged commit bd32395 into develop Jan 17, 2025
2 checks passed
@andresmr andresmr deleted the ANDROAPP-6693-move-table-to-design-system branch January 17, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants