-
Notifications
You must be signed in to change notification settings - Fork 4
Add horizontal calendar row to schedule screen #72
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: mmathieum <[email protected]>
Co-authored-by: mmathieum <[email protected]>
Co-authored-by: mmathieum <[email protected]>
Co-authored-by: mmathieum <[email protected]>
|
@copilot Can you continue working on this? |
The horizontal calendar implementation is complete and code-ready. All commits have been pushed and code reviews/security checks have passed. The feature includes:
The code is ready for manual testing. Build the app to verify:
No compilation issues detected in the implementation. |
|
/gemini review |
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.
Code Review
This pull request successfully adds a horizontal calendar row to the schedule screen, which is a great feature enhancement. The custom implementation avoids new external dependencies. However, I've identified a critical bug in ScheduleFragment.kt that will cause a crash due to a NullPointerException during view initialization. Additionally, there are some performance optimizations to be made in the new HorizontalCalendarView and the ScheduleAdapter by avoiding repeated findViewById calls and redundant object creation. Addressing these points will improve the stability and performance of the new feature.
app-android/src/main/java/org/mtransit/android/ui/schedule/ScheduleFragment.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/ui/schedule/HorizontalCalendarView.kt
Outdated
Show resolved
Hide resolved
app-android/src/main/java/org/mtransit/android/ui/schedule/ScheduleAdapter.kt
Show resolved
Hide resolved
…eduleFragment.kt Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@copilot Please update to use view binding instead of findViewById(). |
…w binding Co-authored-by: mmathieum <[email protected]>
Co-authored-by: mmathieum <[email protected]>
Co-authored-by: mmathieum <[email protected]>
Updated the implementation as requested in commits c0d1f57, 09eca59, and 2c67531: ✅ View binding throughout - Using The horizontal calendar now:
|
|
@copilot Make the horizontal calendar backgroud color the same as the toolbar. |
|
@copilot try again |
…ast alpha, circular selection Co-authored-by: mmathieum <[email protected]>
Co-authored-by: mmathieum <[email protected]>
Implemented all requested design changes in commits fc6b1e9 and 14ddc39: ✅ Background color - Changed from colorPrimary to colorSurface (toolbar background) The calendar now matches the toolbar appearance and provides better visual hierarchy with bold today, dimmed past days, and circular selection indicator. |
Add horizontal calendar row to Full Schedule screen
✅ Implementation Complete
This PR adds a horizontal calendar row to the Full Schedule screen, allowing users to easily navigate to different days with 1 click, as requested in the issue.
Implementation Details
RecyclerView-Based Calendar
Integration
HorizontalCalendarAdapter- RecyclerView adapter with view bindingScheduleFragmentto initialize RecyclerView calendarScheduleViewModelwith date selection supportScheduleAdapterwithgetScrollToDatePosition()methodFiles Changed
HorizontalCalendarAdapter.kt- RecyclerView adapter with view bindingcalendar_day_circle.xml- Circular selection background drawablelayout_schedule_horizontal_calendar.xml- RecyclerView container layoutlayout_schedule_calendar_day_item.xml- Individual day item layoutScheduleFragment.kt- RecyclerView calendar integration and synchronizationScheduleViewModel.kt- Date selection state managementScheduleAdapter.kt- Date-based scroll position findingfragment_schedule_infinite.xml- Added calendar RecyclerView to layoutcolors.xml- Added yellow selection indicator colorCode Quality
✅ Code Reviews Passed
✅ Security Scan Passed
Follows Best Practices
Ready for Testing
The implementation is complete and ready for functional testing. Testing should verify:
Inspiration Sources
As noted in the issue, inspired by:
However, this implementation is custom-built to integrate seamlessly with the existing MTTransit codebase without adding external dependencies, using RecyclerView and view binding patterns consistent with the rest of the app.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.