Skip to content

Conversation

@Guardiola31337
Copy link
Contributor

Description

Removes ArrivalObserver default implementations

  • I have added any issue links
  • I have added all related labels (bug, feature, new API(s), SEMVER, etc.)
  • I have added the appropriate milestone and project boards

Goal

ArrivalObserver is currently an interface with default implementations for onStopArrival and onRouteArrival, so because we're supporting Java 7 (as of now 😁), it'll be unnecessarily converted to an abstract class on the Java side. The idea behind this was that as a client you don't need to override both if you don’t want to e.g.

private val arrivalObserver = object : ArrivalObserver {
    override fun onRouteArrival(routeProgress: RouteProgress) {
        findViewById<Button>(R.id.navigateNextRouteLeg).visibility = View.GONE
    }
}

Only in Kolin though because in Java 7 you'd be forced to implement both. Interface segregation principle is another option to fix this.

We can revisit and bring this back when we support Java 8 (hopefully soon 😅).

Implementation

Remove default implementations ({}) from onStopArrival and onRouteArrival (ArrivalObserver)

Testing

  • I have tested locally (including SNAPSHOT upstream dependencies if needed) through testapp/demo app and run all activities to avoid regressions
  • I have tested via a test drive, or a simulation/mock location app
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have updated the CHANGELOG including this PR

cc @kmadsen @abhishek1508 @LukasPaczos @langsmith

@Guardiola31337 Guardiola31337 added ✓ ready for review Core Work related to core navigation and integrations. labels May 7, 2020
@Guardiola31337 Guardiola31337 added this to the v1.0.0 milestone May 7, 2020
@Guardiola31337 Guardiola31337 self-assigned this May 7, 2020
@Guardiola31337
Copy link
Contributor Author

cc @JunDai as you're working on #2928

@Guardiola31337 Guardiola31337 merged commit 6d56a16 into master May 7, 2020
@Guardiola31337 Guardiola31337 deleted the pg-remove-arrival-observer-default branch May 7, 2020 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Work related to core navigation and integrations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants