Получение необработанного значения ячейки выбранной строки в сетке

* Я уже работал над обновлением пути полилинии без удаления полилинии. Мы можем это сделать, изменив точки этой полилинии. Проверить код ниже.

Это логика установки новых точек на полилинию.

/*Here the routes contain the points(latitude and longitude)*/
for (int i = 0; i < routes.size(); i++) {
            Route route = routes.get(i);
            if(polyline_path != null){
                polyline_path.setPoints(route.points);
            }
        }

Подробное объяснение:

private GoogleMap map_object;
private Marker marker_driver;
private Marker marker_drop_off;
private Polyline polyline_path;
private PolylineOptions polylineOptions_path;

...
...
...

/*HelperDirectionFinder is a class that I create to call google API and I used this 
  class to get directions routes*/

/*I have created Service, and I'm calling this lines below after 5 sec. to get the 
  updated routes from google API.*/

HelperDirectionFinder directionFinder = new HelperDirectionFinder(
            JobEndScreen.this, source, destinations);
    try {
        directionFinder.showDirection();
    } catch (UnsupportedEncodingException e) {
        HelperProgressDialog.closeDialog();
    }

...
...
...

@Override
public void onDirectionFinderStart() {
    if(polylineOptions_path == null){
        HelperProgressDialog.showDialog(getActivity(), "", getString(R.string.text_loading));
    }
}


/*This interface method is called after getting routes from google API.*/
/*Here the routes contains the list of path or routes returned by Google Api*/
@Override
public void onDirectionFinderSuccess(List<Route> routes) {
    HelperProgressDialog.closeDialog();


    /*When polylineOptions_path is null it means the polyline is not drawn.*/
    /*If the polylineOptions_path is not null it means the polyline is drawn on map*/
    if(polylineOptions_path == null){
        for (Route route : routes) {
            polylineOptions_path = new PolylineOptions().
                    geodesic(true).
                    color(ContextCompat.getColor(getActivity(), R.color.color_bg_gray_dark)).
                    width(10);

            for (int i = 0; i < route.points.size(); i++)
                polylineOptions_path.add(route.points.get(i));

            polyline_path = map_object.addPolyline(polylineOptions_path);
        }
    }
    else {
        for (int i = 0; i < routes.size(); i++) {
            Route route = routes.get(i);
            if(polyline_path != null){
                polyline_path.setPoints(route.points);
            }
        }
    }
}
0
задан ilhan 25 June 2012 в 10:52
поделиться