-
Notifications
You must be signed in to change notification settings - Fork 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
feat: [ANDROAPP-6693] Compose table migration #336
Conversation
a1dc252
to
d9cbc3d
Compare
3fb51ff
to
accc167
Compare
...mmonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/model/DropdownOption.kt
Show resolved
Hide resolved
...c/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/model/TableModel.kt
Outdated
Show resolved
Hide resolved
...src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/TableColors.kt
Show resolved
Hide resolved
...commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/TableDimensions.kt
Outdated
Show resolved
Hide resolved
textColor = LocalTableColors.current.headerText, | ||
) | ||
columnIndex % 2 == 0 -> CellStyle.HeaderStyle( | ||
backgroundColor = LocalTableColors.current.headerBackground1, |
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.
I think we could improve this naming for the headerBackground1 and 2 to something like primary and secondaryHeaderBackground
...Main/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/internal/TableActions.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/internal/TableHeaderRow.kt
Show resolved
Hide resolved
...in/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/internal/TableHeaderRow.kt
Outdated
Show resolved
Hide resolved
...Main/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/internal/TableItemRow.kt
Outdated
Show resolved
Hide resolved
.../kotlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/internal/VerticalResizing.kt
Outdated
Show resolved
Hide resolved
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.
nice job! comment approved!
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, | ||
) { |
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.
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?
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.
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 |
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.
What does 11 represent? why not 12 or 10?
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.
val newWidth = ( | ||
columnWidth[tableId]?.get(column) | ||
?: (defaultCellWidth + (currentExtraSize[tableId] ?: 0)) | ||
) + widthOffset - 11 |
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.
same here.
...tlin/org/hisp/dhis/mobile/ui/designsystem/component/table/ui/internal/MultiOptionSelector.kt
Outdated
Show resolved
Hide resolved
89b0198
to
5bc178d
Compare
No description provided.