Search in sources :

Example 6 with BusStopHelper

use of cl.smartcities.isci.transportinspector.database.BusStopHelper in project androidApp by InspectorIncognito.

the class BusSearchResultActivity method setRouteLists.

private void setRouteLists(Service service) {
    RouteHelper routeHelper = new RouteHelper(this);
    ServiceHelper serviceHelper = new ServiceHelper(this);
    BusStopHelper busStopHelper = new BusStopHelper(this);
    activePoints = routeHelper.getRoute(service.getName(), "I");
    if (activePoints == null) {
        activePoints = new ArrayList<>();
    }
    inactivePoints = routeHelper.getRoute(service.getName(), "R");
    if (inactivePoints == null) {
        inactivePoints = new ArrayList<>();
    }
    String busStopByService = serviceHelper.getBusStopByService(service.getName(), "I");
    if (busStopByService == null || busStopByService.equals("")) {
        activeBusStops = new ArrayList<>();
    } else {
        activeBusStops = busStopHelper.getAllBusStopsIn(busStopByService.split("-"));
    }
    busStopByService = serviceHelper.getBusStopByService(service.getName(), "R");
    if (busStopByService == null || busStopByService.equals("")) {
        inactiveBusStops = new ArrayList<>();
    } else {
        inactiveBusStops = busStopHelper.getAllBusStopsIn(busStopByService.split("-"));
    }
}
Also used : BusStopHelper(cl.smartcities.isci.transportinspector.database.BusStopHelper) RouteHelper(cl.smartcities.isci.transportinspector.database.RouteHelper) ServiceHelper(cl.smartcities.isci.transportinspector.database.ServiceHelper)

Aggregations

BusStopHelper (cl.smartcities.isci.transportinspector.database.BusStopHelper)6 BusStop (cl.smartcities.isci.transportinspector.backend.BusStop)5 ArrayList (java.util.ArrayList)3 Nullable (android.support.annotation.Nullable)2 ServiceHelper (cl.smartcities.isci.transportinspector.database.ServiceHelper)2 Service (cl.smartcities.isci.transportinspector.backend.Service)1 FavoriteHelper (cl.smartcities.isci.transportinspector.database.FavoriteHelper)1 RouteHelper (cl.smartcities.isci.transportinspector.database.RouteHelper)1 BusStopClickHandler (cl.smartcities.isci.transportinspector.map.model.busStop.BusStopClickHandler)1 Feature (com.mapbox.services.commons.geojson.Feature)1 HashMap (java.util.HashMap)1