Fix small issues
This commit is contained in:
parent
6bd0671f01
commit
a581218f8b
3 changed files with 11 additions and 6 deletions
|
@ -29,6 +29,7 @@ import net.osmand.plus.TargetPointsHelper;
|
||||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
import net.osmand.plus.base.FavoriteImageDrawable;
|
||||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
import net.osmand.plus.dialogs.DirectionsDialogs;
|
||||||
import net.osmand.plus.helpers.ColorDialogs;
|
import net.osmand.plus.helpers.ColorDialogs;
|
||||||
|
import net.osmand.plus.helpers.WaypointDialogHelper;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
|
|
@ -14,6 +14,7 @@ import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
import net.osmand.plus.TargetPointsHelper;
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||||
|
import net.osmand.plus.helpers.WaypointDialogHelper;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
@ -41,7 +42,8 @@ public class IntermediatePointsDialog {
|
||||||
|
|
||||||
|
|
||||||
public static void openIntermediatePointsDialog(MapActivity mapActivity){
|
public static void openIntermediatePointsDialog(MapActivity mapActivity){
|
||||||
openIntermediatePointsDialog(mapActivity, (OsmandApplication) mapActivity.getApplication(), false);
|
// openIntermediatePointsDialog(mapActivity, (OsmandApplication) mapActivity.getApplication(), false);
|
||||||
|
WaypointDialogHelper.showWaypointsDialog(mapActivity, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openIntermediatePointsDialog(final Activity activity,
|
public static void openIntermediatePointsDialog(final Activity activity,
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void updatePointInfoView(final OsmandApplication app, final MapActivity ctx,
|
private static void updatePointInfoView(final OsmandApplication app, final Activity ctx,
|
||||||
View localView, final LocationPointWrapper ps, final DialogFragment dialog) {
|
View localView, final LocationPointWrapper ps, final DialogFragment dialog) {
|
||||||
WaypointHelper wh = app.getWaypointHelper();
|
WaypointHelper wh = app.getWaypointHelper();
|
||||||
final LocationPoint point = ps.getPoint();
|
final LocationPoint point = ps.getPoint();
|
||||||
|
@ -147,8 +147,10 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
((ImageView) localView.findViewById(R.id.waypoint_icon)).setImageDrawable(ps.getDrawable(ctx));
|
((ImageView) localView.findViewById(R.id.waypoint_icon)).setImageDrawable(ps.getDrawable(ctx));
|
||||||
int dist = -1;
|
int dist = -1;
|
||||||
if (!wh.isRouteCalculated()) {
|
if (!wh.isRouteCalculated()) {
|
||||||
dist = (int) MapUtils.getDistance(ctx.getMapView().getLatitude(), ctx.getMapView().getLongitude(),
|
if (ctx instanceof MapActivity) {
|
||||||
point.getLatitude(), point.getLongitude());
|
dist = (int) MapUtils.getDistance(((MapActivity) ctx).getMapView().getLatitude(), ((MapActivity) ctx)
|
||||||
|
.getMapView().getLongitude(), point.getLatitude(), point.getLongitude());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dist = wh.getRouteDistance(ps);
|
dist = wh.getRouteDistance(ps);
|
||||||
}
|
}
|
||||||
|
@ -357,7 +359,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
if (v == null || v.findViewById(R.id.waypoint_icon) == null) {
|
if (v == null || v.findViewById(R.id.waypoint_icon) == null) {
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
||||||
}
|
}
|
||||||
updatePointInfoView(app, (MapActivity) ctx, v, getItem(position), WaypointDialogFragment.this);
|
updatePointInfoView(app, ctx, v, getItem(position), WaypointDialogFragment.this);
|
||||||
View remove = v.findViewById(R.id.info_close);
|
View remove = v.findViewById(R.id.info_close);
|
||||||
if(!edit) {
|
if(!edit) {
|
||||||
remove.setVisibility(View.GONE);
|
remove.setVisibility(View.GONE);
|
||||||
|
@ -434,7 +436,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
if(v == null || v.findViewById(R.id.info_close) == null) {
|
if(v == null || v.findViewById(R.id.info_close) == null) {
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
||||||
}
|
}
|
||||||
updatePointInfoView(app, (MapActivity) ctx, v, (LocationPointWrapper) getItem(position), WaypointDialogFragment.this);
|
updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), WaypointDialogFragment.this);
|
||||||
View remove = v.findViewById(R.id.info_close);
|
View remove = v.findViewById(R.id.info_close);
|
||||||
if (!edit) {
|
if (!edit) {
|
||||||
remove.setVisibility(View.GONE);
|
remove.setVisibility(View.GONE);
|
||||||
|
|
Loading…
Reference in a new issue