Skip to content

Compat w/ trip updates (status/schedule)#143

Merged
mmathieum merged 5 commits intomasterfrom
mm/gtfs_rt_trip_updates
Mar 10, 2026
Merged

Compat w/ trip updates (status/schedule)#143
mmathieum merged 5 commits intomasterfrom
mm/gtfs_rt_trip_updates

Conversation

@mmathieum
Copy link
Member

@mmathieum mmathieum commented Mar 9, 2026

- mtransitapps/commons-android#81

Signed-off-by: Mathieu Méa <mathieu.mea@gmail.com>
@mmathieum mmathieum self-assigned this Mar 9, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 changes to improve compatibility with trip updates by standardizing how departure timestamps are accessed. It primarily involves refactoring code to use a dedicated getter method ('getDepartureT()') instead of direct field access ('t') for Timestamp objects across various components, including UI schedule logic, adapters, and utility functions. This change enhances data encapsulation and prepares the codebase for more robust handling of real-time trip information.

Highlights

  • Standardized Timestamp Access: Replaced direct access to the 't' field of Timestamp objects with the 'getDepartureT()' method across multiple Java files, ensuring consistent and encapsulated access to departure times.
  • Kotlin Property Update: Updated Kotlin code in 'ScheduleAdapter.kt' to use the 'departureT' property instead of 't' for Timestamp objects, aligning with the Java changes.
  • Removed Unused Imports: Cleaned up 'UISchedule.java' by removing imports for 'Direction' and 'UIDirectionUtils', indicating a potential streamlining of dependencies or relocation of related logic.
  • Updated Unit Tests: Modified existing unit tests in 'UIScheduleTest.java' to reflect the change in timestamp access, ensuring test compatibility with the new 'getDepartureT()' method.
Changelog
  • app-android/src/main/java/org/mtransit/android/data/UISchedule.java
    • Removed unused imports for 'Direction' and 'UIDirectionUtils'.
    • Updated all instances of 'timestamp.t' to 'timestamp.getDepartureT()'.
  • app-android/src/main/java/org/mtransit/android/ui/schedule/ScheduleAdapter.kt
    • Replaced direct access to 'timestamp.t' with 'timestamp.departureT' for consistency with the updated Timestamp data structure.
  • app-android/src/main/java/org/mtransit/android/util/UITimeUtils.java
    • Modified methods to use 'timestamp.getDepartureT()' instead of 'timestamp.getT()' when formatting or comparing timestamps.
  • app-android/src/test/java/org/mtransit.android.data/UIScheduleTest.java
    • Updated assertions in 'getStatusNextTimestamps' test methods to verify 'getDepartureT()' values.
Activity
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 makes the app compatible with trip updates by replacing direct access to the Timestamp.t field with the getDepartureT() method. The changes are consistent across the codebase. My review focuses on improving performance by suggesting caching the result of getDepartureT() in local variables inside loops to avoid redundant calls, which is important for UI-related code.

@mmathieum mmathieum marked this pull request as ready for review March 10, 2026 18:29
@mmathieum mmathieum merged commit c467f98 into master Mar 10, 2026
7 of 8 checks passed
@mmathieum mmathieum deleted the mm/gtfs_rt_trip_updates branch March 10, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant