Remove redundant callback
This commit is contained in:
parent
2f4ed4a311
commit
370fded329
2 changed files with 4 additions and 12 deletions
|
@ -44,7 +44,7 @@ public class AvoidSpecificRoads {
|
||||||
public void initPreservedData() {
|
public void initPreservedData() {
|
||||||
List<LatLon> impassibleRoads = app.getSettings().getImpassableRoadPoints();
|
List<LatLon> impassibleRoads = app.getSettings().getImpassableRoadPoints();
|
||||||
for (LatLon impassibleRoad : impassibleRoads) {
|
for (LatLon impassibleRoad : impassibleRoads) {
|
||||||
addImpassableRoad(null, impassibleRoad, false, null, true);
|
addImpassableRoad(null, impassibleRoad, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ public class AvoidSpecificRoads {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean processResult(LatLon result) {
|
public boolean processResult(LatLon result) {
|
||||||
addImpassableRoad(mapActivity, result, true, null, false);
|
addImpassableRoad(mapActivity, result, true, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,6 @@ public class AvoidSpecificRoads {
|
||||||
public void addImpassableRoad(@Nullable final MapActivity activity,
|
public void addImpassableRoad(@Nullable final MapActivity activity,
|
||||||
@NonNull final LatLon loc,
|
@NonNull final LatLon loc,
|
||||||
final boolean showDialog,
|
final boolean showDialog,
|
||||||
@Nullable final AvoidSpecificRoadsCallback callback,
|
|
||||||
final boolean skipWritingSettings) {
|
final boolean skipWritingSettings) {
|
||||||
final Location ll = new Location("");
|
final Location ll = new Location("");
|
||||||
ll.setLatitude(loc.getLatitude());
|
ll.setLatitude(loc.getLatitude());
|
||||||
|
@ -177,22 +176,15 @@ public class AvoidSpecificRoads {
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
Toast.makeText(activity, R.string.error_avoid_specific_road, Toast.LENGTH_LONG).show();
|
Toast.makeText(activity, R.string.error_avoid_specific_road, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
if (callback != null) {
|
|
||||||
callback.onAddImpassableRoad(false, null);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
addImpassableRoadInternal(object, ll, showDialog, activity, loc);
|
addImpassableRoadInternal(object, ll, showDialog, activity, loc);
|
||||||
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onAddImpassableRoad(true, object);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return callback != null && callback.isCancelled();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class PointDescriptionMenuController extends MenuController {
|
||||||
MapActivity activity = getMapActivity();
|
MapActivity activity = getMapActivity();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
AvoidSpecificRoads roads = activity.getMyApplication().getAvoidSpecificRoads();
|
AvoidSpecificRoads roads = activity.getMyApplication().getAvoidSpecificRoads();
|
||||||
roads.addImpassableRoad(activity, getLatLon(), false, null, false);
|
roads.addImpassableRoad(activity, getLatLon(), false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue