-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add functionality to show steady location on map #160
Add functionality to show steady location on map #160
Conversation
WalkthroughThe pull request introduces improvements to journey-related components in the Android application. The changes focus on enhancing error handling, coordinate processing, and UI interactions across three main files: Changes
Sequence DiagramsequenceDiagram
participant User
participant LocationHistoryItem
participant SteadyLocationItem
participant JourneyDetailScreen
User->>LocationHistoryItem: Tap on location item
LocationHistoryItem->>SteadyLocationItem: Trigger onTap
SteadyLocationItem->>JourneyDetailScreen: Show journey details
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
app/src/main/java/com/canopas/yourspace/ui/flow/journey/components/JourneyMap.kt (1)
103-105
: Consider adjusting the zoom level for better UX.The current implementation uses a fixed zoom level of 18f when showing only the starting location. This might be too zoomed in for some scenarios.
- cameraPositionState.move(CameraUpdateFactory.newLatLngZoom(fromLatLng, 18f)) + cameraPositionState.move(CameraUpdateFactory.newLatLngZoom(fromLatLng, 16f))app/src/main/java/com/canopas/yourspace/ui/flow/journey/detail/UserJourneyDetailScreen.kt (1)
186-222
: Consider extracting the steady location UI into a separate composable.The UI for steady locations could be moved to a reusable composable to improve code organization and maintainability.
+@Composable +private fun SteadyLocationInfo( + fromAddressStr: String, + createdAt: Long, +) { + Row( + verticalAlignment = Alignment.Top, + modifier = Modifier.wrapContentHeight().padding(4.dp) + ) { + Icon( + painter = painterResource(R.drawable.ic_journey_destination), + contentDescription = "", + tint = AppTheme.colorScheme.primary, + modifier = Modifier + .padding(start = 8.dp) + .background(AppTheme.colorScheme.secondaryInverseVariant, CircleShape) + .size(30.dp) + .padding(4.dp) + ) + Column( + modifier = Modifier + .padding(start = 16.dp) + .weight(1f) + ) { + Text( + text = fromAddressStr, + style = AppTheme.appTypography.body2.copy( + color = AppTheme.colorScheme.textPrimary, + fontWeight = FontWeight.Medium + ), + overflow = TextOverflow.Ellipsis, + modifier = Modifier.padding(end = 16.dp) + ) + + Spacer(modifier = Modifier.size(8.dp)) + + Text( + text = getFormattedLocationTime(createdAt), + style = AppTheme.appTypography.caption.copy(color = AppTheme.colorScheme.textDisabled) + ) + } + } +} // Usage: - Row( - verticalAlignment = Alignment.Top, - modifier = Modifier.wrapContentHeight().padding(4.dp) - ) { - Icon(...) - Column(...) { - Text(...) - Spacer(...) - Text(...) - } - } + SteadyLocationInfo(fromAddressStr, journey.created_at!!)app/src/main/java/com/canopas/yourspace/ui/flow/journey/components/LocationHistory.kt (1)
214-217
: Consider adding visual feedback for clickable items.The clickable area should provide visual feedback when pressed.
.clickable { onTap() } + .composed { + Modifier.conditional(true) { + this.then( + Modifier.background( + color = AppTheme.colorScheme.surface, + shape = RoundedCornerShape(8.dp) + ) + ) + } + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/src/main/java/com/canopas/yourspace/ui/flow/journey/components/JourneyMap.kt
(2 hunks)app/src/main/java/com/canopas/yourspace/ui/flow/journey/components/LocationHistory.kt
(4 hunks)app/src/main/java/com/canopas/yourspace/ui/flow/journey/detail/UserJourneyDetailScreen.kt
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (4)
app/src/main/java/com/canopas/yourspace/ui/flow/journey/components/JourneyMap.kt (2)
94-96
: LGTM! Robust null-safety handling for map bounds.The null check for destination coordinates before including them in the bounds calculation prevents potential crashes.
143-145
: LGTM! Consistent null-safety handling for destination marker.The null check aligns with the bounds calculation logic, ensuring UI consistency.
app/src/main/java/com/canopas/yourspace/ui/flow/journey/detail/UserJourneyDetailScreen.kt (1)
146-185
: LGTM! Well-structured journey details with destination.The implementation provides a clear visual hierarchy with proper spacing and alignment.
app/src/main/java/com/canopas/yourspace/ui/flow/journey/components/LocationHistory.kt (1)
76-78
: LGTM! Clean parameter passing.The showJourneyDetails callback is properly passed as the onTap parameter.
…y-on-map # Conflicts: # app/src/main/java/com/canopas/yourspace/ui/flow/journey/detail/UserJourneyDetailScreen.kt
Changelog
New Features
Screen_recording_20250109_114238.mp4
Summary by CodeRabbit
New Features
Bug Fixes
UI/UX Improvements