smurfy / fahrplan

QT Application for Public transportation
GNU General Public License v2.0
58 stars 32 forks source link

[Ubuntu Touch] Provide views to filter timetable results by transportation types #203

Open krnekhelesh opened 9 years ago

krnekhelesh commented 9 years ago

In my personal opinion, the 9292ov.nl app is one of the best designed apps on Android when it comes to transportation apps. You should give a try if you have some time to see what I mean. Anyway, in the timetable page, they provide filters based on the transportation type which I think is rather nifty.

I want to implement something like this in the ubuntu touch port. While I can implement most of it quite easily, I am stuck on one part which is knowing what the different types of transportation types available.

Filtering the listview data is as simple as using the SortFilterModel (provided by the Ubuntu SDK) and then setting the filter property as "train", "bus" etc etc..but I am unable to figure out which transportation types are included in the results in the first place.

Is there any variable in the fahrplan backend that exposes this? If not do you guys have any ideas on how to do this?

screenshot_2015-05-21-15-38-04

smurfy commented 9 years ago

you have the following fields to your disposal:

roles.insert(CurrentStation, "currentStation");
roles.insert(DestinationStation, "destinationStation");
roles.insert(TrainType, "trainType");
roles.insert(Platform, "platform");
roles.insert(Time, "time");
roles.insert(MiscInfo, "miscInfo");
roles.insert(Latitude, "latitude");
roles.insert(Longitude, "longitude");

(but not all on all backends are filled) I think if you want to have a list of all available trainTypes you need to iterate the model in qml and gather them at the moment.