Skip to content

Android Widget - Limit train changes#548

Merged
guytepper merged 12 commits intobetter-rail:mainfrom
drehelis:widget_limit_train_changes
Jan 23, 2026
Merged

Android Widget - Limit train changes#548
guytepper merged 12 commits intobetter-rail:mainfrom
drehelis:widget_limit_train_changes

Conversation

@drehelis
Copy link
Copy Markdown
Member

@drehelis drehelis commented Jan 11, 2026

image

@drehelis drehelis requested a review from guytepper January 11, 2026 21:41
@drehelis drehelis marked this pull request as ready for review January 11, 2026 21:41
Copilot AI review requested due to automatic review settings January 11, 2026 21:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a user-configurable filter to limit the maximum number of train changes displayed in the Android widget. Users can select "No limit", "Direct trains only", or "Up to 1 change" through a collapsible "Advanced" section in the widget configuration.

Changes:

  • Added UI for configuring maximum train changes filter in widget settings
  • Implemented filtering logic in the repository layer to apply the changes limit
  • Enhanced the data model to track the number of changes per train route
  • Updated click targets in widget layouts to improve touch area for route reversal

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
android/app/src/main/res/values/strings.xml Added English strings for advanced section and max changes options
android/app/src/main/res/values-ru/strings.xml Added Russian translations for new strings
android/app/src/main/res/values-iw/strings.xml Added Hebrew translations for new strings
android/app/src/main/res/layout/widget_compact_4x2.xml Added ID to destination container and padding for improved click target
android/app/src/main/res/layout/widget_compact_2x2.xml Added ID to destination container and padding for improved click target
android/app/src/main/res/layout/activity_widget_config.xml Added collapsible advanced section with max changes spinner
android/app/src/main/java/com/betterrail/widget/state/WidgetState.kt Fixed arrival time display for error states in 4x2 widget
android/app/src/main/java/com/betterrail/widget/repository/TrainScheduleRepository.kt Applied changes filter to API responses before caching
android/app/src/main/java/com/betterrail/widget/repository/ModernWidgetPreferencesRepository.kt Added persistence for maxChanges preference and removed unused batch save
android/app/src/main/java/com/betterrail/widget/repository/ModernCacheRepository.kt Enhanced cache validation to handle empty filtered results
android/app/src/main/java/com/betterrail/widget/data/TrainModels.kt Added numberOfChanges field to WidgetTrainItem and maxChanges to WidgetData
android/app/src/main/java/com/betterrail/widget/api/RailApiService.kt Enhanced API parsing to calculate numberOfChanges and format changes text
android/app/src/main/java/com/betterrail/widget/ModernBaseWidgetProvider.kt Updated click targets to use destination container for better UX
android/app/src/main/java/com/betterrail/widget/BaseWidgetConfigActivity.kt Added UI logic for advanced section and max changes spinner

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@drehelis
Copy link
Copy Markdown
Member Author

@guytepper בזמנך הפנוי 🙏🏻

@guytepper
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46db47c85b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread android/app/src/main/res/values/strings.xml Outdated
Comment thread android/app/src/main/res/values-iw/strings.xml Outdated
drehelis and others added 2 commits January 23, 2026 14:46
@drehelis drehelis requested a review from guytepper January 23, 2026 13:32
Comment thread android/app/src/main/res/values/strings.xml Outdated
@guytepper guytepper merged commit 1a39482 into better-rail:main Jan 23, 2026
1 check passed
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.

3 participants