Rename method; fix index out of bounds exception

This commit is contained in:
Alexander Sytnyk 2017-10-02 11:45:11 +03:00
parent 09678d4d7a
commit 74572b3772
2 changed files with 6 additions and 3 deletions

View file

@ -210,6 +210,9 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
@Override
public void onItemClick(View view) {
int pos = markersRv.getChildAdapterPosition(view);
if (pos == RecyclerView.NO_POSITION) {
return;
}
if (pos == 0) {
markersHelper.setStartFromMyLocation(!mapActivity.getMyApplication().getSettings().ROUTE_MAP_MARKERS_START_MY_LOC.get());
} else {
@ -358,7 +361,7 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
private MapActivity mapActivity = getMapActivity();
@Override
public void doorByDoorOnClick() {
public void doorToDoorOnClick() {
if (mapActivity != null) {
Toast.makeText(mapActivity, "Door to Door", Toast.LENGTH_SHORT).show();
}

View file

@ -56,7 +56,7 @@ public class PlanRouteSortByBottomSheetDialogFragment extends BottomSheetDialogF
@Override
public void onClick(View view) {
if (listener != null) {
listener.doorByDoorOnClick();
listener.doorToDoorOnClick();
dismiss();
}
}
@ -135,7 +135,7 @@ public class PlanRouteSortByBottomSheetDialogFragment extends BottomSheetDialogF
interface PlanRouteSortByFragmentListener {
void doorByDoorOnClick();
void doorToDoorOnClick();
void reverseOrderOnClick();
}