-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented UI for workout history page #108
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
Changes from all commits
7310469
3c904b1
b91c17a
c0aabc1
697dd2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,11 +170,11 @@ private fun ProfileScreenTopBar( | |
| private fun ProfileScreenContentPreview() { | ||
| val now = System.currentTimeMillis() | ||
| val historyItems = listOf( | ||
| HistoryItem("Morrison", "11:00 PM", "March 29, 2024", now - (1 * 24 * 60 * 60 * 1000), "1 day ago"), | ||
| HistoryItem("Noyes", "1:00 PM", "March 29, 2024", now - (3 * 24 * 60 * 60 * 1000), "2 days ago"), | ||
| HistoryItem("Teagle Up", "2:00 PM", "March 29, 2024", now - (7 * 24 * 60 * 60 * 1000), "1 day ago"), | ||
| HistoryItem("Teagle Down", "12:00 PM", "March 29, 2024", now - (15 * 24 * 60 * 60 * 1000), "1 day ago"), | ||
| HistoryItem("Helen Newman", "10:00 AM", "March 29, 2024", now, "Today"), | ||
| HistoryItem("Morrison", "11:00 PM", "March 29, 2024", now, "Today", "Mar 29"), | ||
| HistoryItem("Noyes", "1:00 PM", "March 28, 2024", now - 86400000L, "Yesterday", "Mar 28"), | ||
| HistoryItem("Teagle Up", "2:00 PM", "February 15, 2024", now - 4000000000L, "1 month ago", "Feb 15"), | ||
| HistoryItem("Helen Newman", "9:30 AM", "February 10, 2024", now - 4430000000L, "1 month ago", "Feb 10"), | ||
| HistoryItem("Morrison", "6:45 PM", "February 3, 2024", now - 5030000000L, "1 month ago", "Feb 3") | ||
| ) | ||
|
Comment on lines
172
to
178
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preview The preview uses 🤖 Prompt for AI Agents |
||
| ProfileScreenContent( | ||
| uiState = ProfileUiState( | ||
|
|
||
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.
Divider condition uses the wrong collection length.
Line 76 compares against
historyItems.size - 1, but rendering is overhistoryItems.take(5). When there are more than 5 items, this adds a trailing divider after the last visible row.Proposed fix
fun HistoryList( historyItems: List<HistoryItem>, modifier: Modifier = Modifier ) { Column(modifier = modifier) { - historyItems.take(5).forEachIndexed { index, historyItem -> + val visibleItems = historyItems.take(5) + visibleItems.forEachIndexed { index, historyItem -> HistoryItemRow(historyItem = historyItem) - if (index != historyItems.size - 1) { + if (index != visibleItems.lastIndex) { HorizontalDivider(color = GRAY01, thickness = 1.dp) } } } }🤖 Prompt for AI Agents