Giter Club home page Giter Club logo

Comments (4)

droundy avatar droundy commented on May 24, 2024

I'm also wondering whether if I figure out how to make this change and send a pull request that would be appreciated and pushed to the play store?

from corvallis-bus-android.

RikkiGibson avatar RikkiGibson commented on May 24, 2024

Ah, this is something I didn't anticipate at all when I designed the favorites list. The content of it comes basically straight from the web API (see https://github.com/rikkigibson/corvallis-bus-server#favorites). This makes it easy to consistently present the information in the Android, iOS and web apps.

I think the simplest way to prevent the confusion is to add a modest timeout (maybe one second?) after making a request for new favorites list content which clears the favorites list. I think I'd prefer this because the estimates tend to fluctuate (i.e. going from 4 minutes to 1 minute over an actual period of 30 seconds). I would be happy to accept a PR for this and publish to Google Play.

If you really want to make the extrapolation happen, I can give suggestions on how to go about it, but it will either involve reimplementing some stuff from the server on the client side or doing some kinda hacky stuff.

from corvallis-bus-android.

droundy avatar droundy commented on May 24, 2024

Thanks for the rapid response!

I don't care for the idea of adding a timeout, which would presumably cause the out-of-date information to simply disappear. That would be a significant improvement, but would still leave me waiting to get the new estimate.

Would extrapolation be something perhaps better handled on the server side, by changing the returned value to a time estimate rather than a minutes left estimate?

from corvallis-bus-android.

RikkiGibson avatar RikkiGibson commented on May 24, 2024

The most reasonable way probably involves pushing the arrival time "rendering" back over to the client side, which means reimplementing some part of what I did here on the client. You might also expose a new API endpoint which gives the favorites data in a more machine-friendly format. Maybe write out the List<FavoriteStop> instead of the List<FavoriteStopViewModel>? Then you can cache the response on the client side and re-render the human-friendly relative time strings as needed.

Let me know if there's anything I can do to help you spin up on dev'ing this.

from corvallis-bus-android.

Related Issues (5)

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.