Comments (4)
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corvallis-bus-android.