Search in sources :

Example 26 with BusStop

use of cl.smartcities.isci.transportinspector.backend.BusStop in project androidApp by InspectorIncognito.

the class CameraMoveHandler method getNearBusStops.

private List<BusStop> getNearBusStops(double latitude, double longitude) {
    Context context = this.context.get();
    if (context == null)
        return null;
    GridHelper helper = new GridHelper(context);
    List<BusStop> busStops = helper.getNearBusStops(latitude, longitude);
    helper.close();
    return busStops;
}
Also used : Context(android.content.Context) GridHelper(cl.smartcities.isci.transportinspector.database.GridHelper) BusStop(cl.smartcities.isci.transportinspector.backend.BusStop)

Example 27 with BusStop

use of cl.smartcities.isci.transportinspector.backend.BusStop in project androidApp by InspectorIncognito.

the class FavouriteActivity method onItemClick.

@Override
public void onItemClick(Suggestion item) {
    BusStop busStop = getBusStop(item);
    if (busStop == null) {
        return;
    }
    Intent intent = new Intent(this, MainActivity.class);
    intent.putExtra(MainActivity.SEARCH_BUS_STOP_LAT, busStop.getLat());
    intent.putExtra(MainActivity.SEARCH_BUS_STOP_LNG, busStop.getLon());
    intent.putExtra(MainActivity.SEARCH_BUS_STOP_ID, busStop.getId());
    startActivity(intent);
    finish();
}
Also used : Intent(android.content.Intent) BusStop(cl.smartcities.isci.transportinspector.backend.BusStop)

Aggregations

BusStop (cl.smartcities.isci.transportinspector.backend.BusStop)27 ArrayList (java.util.ArrayList)13 Feature (com.mapbox.services.commons.geojson.Feature)8 BusStopMarker (cl.smartcities.isci.transportinspector.map.model.busStop.BusStopMarker)6 BusStopHelper (cl.smartcities.isci.transportinspector.database.BusStopHelper)5 Cursor (android.database.Cursor)4 View (android.view.View)3 Bus (cl.smartcities.isci.transportinspector.backend.Bus)3 Test (org.junit.Test)3 Bitmap (android.graphics.Bitmap)2 Nullable (android.support.annotation.Nullable)2 TextView (android.widget.TextView)2 FavoriteHelper (cl.smartcities.isci.transportinspector.database.FavoriteHelper)2 GridHelper (cl.smartcities.isci.transportinspector.database.GridHelper)2 DetectedActivity (com.google.android.gms.location.DetectedActivity)2 Context (android.content.Context)1 Intent (android.content.Intent)1 Typeface (android.graphics.Typeface)1 Location (android.location.Location)1 Pair (android.support.v4.util.Pair)1