Skip to content
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

feat: Integrate Recent Stops Data into External Surveys #1234

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

amrhossamdev
Copy link
Member

@amrhossamdev amrhossamdev commented Sep 2, 2024

Added functionality to include recent stop information in external survey forms.

  • Apply the AndroidStyle.xml style template to your code in Android Studio.

  • Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)

- Added functionality to include recent stop information in external survey forms.

Signed-off-by: Amr Hossam <[email protected]>
Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

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

couple questions, small change requests. generally, though, this looks fantastic!

object RecentStopsManager {

// Maximum stops count to save
private var MAX_STOP_COUNT = 5
Copy link
Member

Choose a reason for hiding this comment

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

👍


withContext(Dispatchers.IO) {
val existingRegion = regionDao.getRegionByID(regionId)
if (existingRegion == null) {
Copy link
Member

Choose a reason for hiding this comment

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

what happens when properties of a region change? (e.g. the server URL changes or the support email address changes?)

Copy link
Member Author

@amrhossamdev amrhossamdev Sep 2, 2024

Choose a reason for hiding this comment

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

I don't save any of them I only save the region ID, currently, this table is customized for the survey feature only and can be extended in the future.

@@ -231,6 +232,7 @@ public IntentBuilder(Context context, String stopId) {
public IntentBuilder(Context context, ObaStop stop, HashMap<String, ObaRoute> routes) {
mIntent = new Intent(context, ArrivalsListFragment.class);
mIntent.setData(Uri.withAppendedPath(ObaContract.Stops.CONTENT_URI, stop.getId()));
RecentStopsManager.saveStop(context,stop);
Copy link
Member

Choose a reason for hiding this comment

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

<3

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

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

great work! 🚢

@aaronbrethorst aaronbrethorst merged commit c5fd5a2 into main Sep 3, 2024
2 checks passed
@aaronbrethorst aaronbrethorst deleted the survey-feature-recent-stops branch September 3, 2024 02:51
@amrhossamdev amrhossamdev mentioned this pull request Sep 3, 2024
5 tasks
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.

2 participants