feat(android): implement auto-reverse route for Android widget#577
feat(android): implement auto-reverse route for Android widget#577
Conversation
drehelis
commented
Feb 13, 2026
Summary of ChangesHello @drehelis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant quality-of-life improvement for Android widget users by implementing an 'auto-reverse route' functionality. This feature intelligently swaps the origin and destination of a widget's displayed route based on the time of day, catering to typical morning and evening commute patterns. It also provides users with the ability to temporarily override this automatic behavior. The changes span across UI, data storage, and core logic to seamlessly integrate this new smart commuting option. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an auto-reverse route feature for the Android widget, which automatically swaps the origin and destination based on the time of day. The implementation includes the necessary UI in the widget configuration screen, data model updates, and the core logic in the widget provider.
My review has identified a few areas for improvement:
- There's an opportunity to modernize the code by replacing deprecated APIs for status bar styling.
- The date and time logic relies on the legacy
java.util.CalendarAPI, which could be updated to the more robustjava.timeAPI. - I also found a bug in a user-facing string for the new feature in the Hebrew translation.
Overall, this is a great addition. The code is well-structured, and the new feature logic is cleverly implemented.
| <item>רכבות ישירות בלבד</item> | ||
| <item>החלפה אחת לכל היותר</item> | ||
| </string-array> | ||
| <string name="widget_auto_reverse_route">היפוך מסלול אוטומטי (01:00 - 13:00)</string> |
There was a problem hiding this comment.
The time window specified in the Hebrew string for widget_auto_reverse_route is (01:00 - 13:00), which corresponds to the morning window. However, the implementation in getEffectiveWidgetData reverses the route during the evening window (13:00 - 01:00). The English and Russian translations correctly reflect this. This discrepancy will likely confuse users. The string should be updated to show the correct time window for the automatic reversal.
| <string name="widget_auto_reverse_route">היפוך מסלול אוטומטי (01:00 - 13:00)</string> | |
| <string name="widget_auto_reverse_route">היפוך מסלול אוטומטי (13:00 - 01:00)</string> |
There was a problem hiding this comment.
even thought this is in hebrew, we read time left->right, no? @guytepper wdys?
There was a problem hiding this comment.
i wouldn't use timestamps here. perhaps היפוך מסלול בוקר/ערב
There was a problem hiding this comment.
i want user to have clarity when widget scheduled to swap, otherwise, how would they know?
There was a problem hiding this comment.
you're giving them enough clarity - morning & evening.
why would it matter if they know the exact times?
There was a problem hiding this comment.
I later plan to add a drop down to customize those, android users wants their freedom 😎
|
/publish |
|
/publish |