Giter Club home page Giter Club logo

Comments (3)

1ec5 avatar 1ec5 commented on August 31, 2024

Sounds great. It’s a sprawling method that should be refactored on the Swift side too.

from mapbox-navigation-android.

cammace avatar cammace commented on August 31, 2024

I've been looking over best solutions for splitting up the monitorStepProgress, here are the steps I'm thinking of taking to refactor it.

  • Move logic into it's own class and get rid of LocationUpdateThread (see #19).
  • Have routeProgress handle more logic, currently in monitorStepProgress() we are doing conversions and calculations that seem fit for handling inside the routeProgress model instead such as calculating the users location truePosition, secondsToEndOfStep, etc. This would require building a new routeProgress object before determining what alert level the users on and invoking the callbacks appropriately.
  • Each alert level check moved into separate methods. This can help remove unnecessary checks such as whether the user just departed or not, which only needs to be called once. This also makes testing of each method significantly easier.

from mapbox-navigation-android.

cammace avatar cammace commented on August 31, 2024

Refactoring of this took place in #30. Closing.

from mapbox-navigation-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.