Prepare for 0.8.3 release
This commit is contained in:
parent
26e80f5c90
commit
18b1cf4e45
2 changed files with 45 additions and 29 deletions
|
@ -540,7 +540,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
} else {
|
} else {
|
||||||
// view.findViewById(R.id.TextView).setVisibility(View.GONE);
|
// view.findViewById(R.id.TextView).setVisibility(View.GONE);
|
||||||
builder.setPositiveButton(R.string.follow, followCall);
|
builder.setPositiveButton(R.string.follow, followCall);
|
||||||
builder.setNegativeButton(R.string.only_show, onlyShowCall);
|
builder.setNeutralButton(R.string.only_show, onlyShowCall);
|
||||||
builder.setNegativeButton(R.string.default_buttons_cancel, null);
|
builder.setNegativeButton(R.string.default_buttons_cancel, null);
|
||||||
}
|
}
|
||||||
builder.show();
|
builder.show();
|
||||||
|
@ -1064,7 +1064,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
return optionsMenuHelper.onClick(item);
|
return optionsMenuHelper.onClick(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openIntermediatePointsDialog(){
|
public void openIntermediatePointsDialog(){
|
||||||
Builder builder = new AlertDialog.Builder(mapActivity);
|
Builder builder = new AlertDialog.Builder(mapActivity);
|
||||||
final ArrayList<LatLon> intermediates = new ArrayList<LatLon>(mapActivity.getIntermediatePoints());
|
final ArrayList<LatLon> intermediates = new ArrayList<LatLon>(mapActivity.getIntermediatePoints());
|
||||||
final int targetPointInd = mapActivity.getPointToNavigate() == null ? -1 : intermediates.size();
|
final int targetPointInd = mapActivity.getPointToNavigate() == null ? -1 : intermediates.size();
|
||||||
|
@ -1220,36 +1220,37 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
qa.addActionItem(showOnMap);
|
qa.addActionItem(showOnMap);
|
||||||
// ActionItem setAsDestination = new ActionItem();
|
ActionItem setAsDestination = new ActionItem();
|
||||||
// setAsDestination.setIcon(activity.getResources().getDrawable(R.drawable.list_view_set_destination));
|
setAsDestination.setIcon(activity.getResources().getDrawable(R.drawable.list_view_set_destination));
|
||||||
// setAsDestination.setTitle(activity.getString(R.string.navigate_to));
|
setAsDestination.setTitle(activity.getString(R.string.navigate_to));
|
||||||
// setAsDestination.setOnClickListener(new OnClickListener() {
|
setAsDestination.setOnClickListener(new OnClickListener() {
|
||||||
// @Override
|
|
||||||
// public void onClick(View v) {
|
|
||||||
// if(onShow != null) {
|
|
||||||
// onShow.onClick(v);
|
|
||||||
// }
|
|
||||||
// app.getSettings().setPointToNavigate(location.getLatitude(), location.getLongitude(), name);
|
|
||||||
// MapActivity.launchMapActivityMoveToTop(activity);
|
|
||||||
// qa.dismiss();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// qa.addActionItem(setAsDestination);
|
|
||||||
|
|
||||||
ActionItem directionsTo = new ActionItem();
|
|
||||||
directionsTo.setIcon(activity.getResources().getDrawable(R.drawable.list_activities_directions_to_here));
|
|
||||||
directionsTo.setTitle(activity.getString(R.string.context_menu_item_directions));
|
|
||||||
directionsTo.setOnClickListener(new OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if(onShow != null) {
|
if(onShow != null) {
|
||||||
onShow.onClick(v);
|
onShow.onClick(v);
|
||||||
}
|
}
|
||||||
navigateToPoint(activity, location.getLatitude(), location.getLongitude(), name);
|
navigateToPoint(activity, location.getLatitude(), location.getLongitude(), name);
|
||||||
|
// app.getSettings().setPointToNavigate(location.getLatitude(), location.getLongitude(), name);
|
||||||
|
// MapActivity.launchMapActivityMoveToTop(activity);
|
||||||
qa.dismiss();
|
qa.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
qa.addActionItem(directionsTo);
|
qa.addActionItem(setAsDestination);
|
||||||
|
|
||||||
|
// ActionItem directionsTo = new ActionItem();
|
||||||
|
// directionsTo.setIcon(activity.getResources().getDrawable(R.drawable.list_activities_directions_to_here));
|
||||||
|
// directionsTo.setTitle(activity.getString(R.string.context_menu_item_directions));
|
||||||
|
// directionsTo.setOnClickListener(new OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(View v) {
|
||||||
|
// if(onShow != null) {
|
||||||
|
// onShow.onClick(v);
|
||||||
|
// }
|
||||||
|
// navigateToPoint(activity, location.getLatitude(), location.getLongitude(), name);
|
||||||
|
// qa.dismiss();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// qa.addActionItem(directionsTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void navigateToPoint(final Context activity, final double lat, final double lon, final String name){
|
public static void navigateToPoint(final Context activity, final double lat, final double lon, final String name){
|
||||||
|
|
|
@ -355,15 +355,20 @@ public class RouteInfoControls {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
AnimateDraggingMapThread thread = view.getAnimatedDraggingThread();
|
onClick(view);
|
||||||
LatLon pointToNavigate = getPointToNavigate();
|
|
||||||
if (pointToNavigate != null) {
|
|
||||||
float fZoom = view.getFloatZoom() < 15 ? 15 : view.getFloatZoom();
|
|
||||||
thread.startMoving(pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), fZoom, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void onClick(final OsmandMapTileView view) {
|
||||||
|
AnimateDraggingMapThread thread = view.getAnimatedDraggingThread();
|
||||||
|
LatLon pointToNavigate = getPointToNavigate();
|
||||||
|
if (pointToNavigate != null) {
|
||||||
|
float fZoom = view.getFloatZoom() < 15 ? 15 : view.getFloatZoom();
|
||||||
|
thread.startMoving(pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), fZoom, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateInfo() {
|
public boolean updateInfo() {
|
||||||
int d = getDistance();
|
int d = getDistance();
|
||||||
|
@ -423,6 +428,16 @@ public class RouteInfoControls {
|
||||||
final OsmandMapTileView view = map.getMapView();
|
final OsmandMapTileView view = map.getMapView();
|
||||||
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map, 0, paintText, paintSubText, map.getResources()
|
DistanceToPointInfoControl distanceControl = new DistanceToPointInfoControl(map, 0, paintText, paintSubText, map.getResources()
|
||||||
.getDrawable(R.drawable.info_intermediate), view) {
|
.getDrawable(R.drawable.info_intermediate), view) {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onClick(OsmandMapTileView view) {
|
||||||
|
if(map.getIntermediatePoints().size() > 1) {
|
||||||
|
map.getMapActions().openIntermediatePointsDialog();
|
||||||
|
} else {
|
||||||
|
super.onClick(view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LatLon getPointToNavigate() {
|
public LatLon getPointToNavigate() {
|
||||||
return map.getFirstIntermediatePoint();
|
return map.getFirstIntermediatePoint();
|
||||||
|
|
Loading…
Reference in a new issue