@Override public void onSuccess(StopsForRouteBean stopsForRoute) { TabBarController rootController = MobileApplicationContext.getRootController(); rootController.setSelectedIndex(0); System.out.println("showing stops for route"); MapViewController map = MobileApplicationContext.getMapViewController(); map.showStopsForRoute(_route, stopsForRoute); }
private static CoordinateBounds getSearchBounds(double radius) { LocationManager locationManager = MobileApplicationContext.getLocationManager(); LatLng p = locationManager.getCurrentSearchLocation(); CoordinateBounds bounds = SphericalGeometryLibrary.bounds(p.getLatitude(), p.getLongitude(), radius); System.out.println(bounds); return bounds; }
@Override public void onSuccess(RoutesBean routesBean) { List<RouteBean> routes = routesBean.getRoutes(); if (routes.size() == 1) { RouteBean route = routes.get(0); System.out.println("route found: " + route.getShortName() + " " + route.getLongName()); _service.getStopsForRoute(route.getId(), new StopsForRouteHandler(route)); } else { TabBarController rootController = MobileApplicationContext.getRootController(); rootController.setSelectedIndex(0); } }
@Override public void onSuccess(JsArray<Placemark> locations) { List<Place> places = new ArrayList<Place>(); for (int i = 0; i < locations.length(); i++) places.add(new PlacemarkPlaceImpl(locations.get(i))); MapViewController map = MobileApplicationContext.getMapViewController(); if (places.size() == 0) { } else if (places.size() == 1) { map.showPlace(places.get(0)); } else { map.showPlaces(places); } }
/** ** Private Methods ** */ private static void switchToMapView() { TabBarController rootController = MobileApplicationContext.getRootController(); rootController.setSelectedIndex(0); }