Merge branch 'master' of https://github.com/osmandapp/Osmand into 9055_allow_to_edit_address
This commit is contained in:
commit
f353e22edf
10 changed files with 65 additions and 28 deletions
|
@ -341,13 +341,20 @@ public abstract class MapRenderingTypes {
|
|||
}
|
||||
|
||||
String nmts = parser.getAttributeValue("", "nameTags");
|
||||
if(nmts != null) {
|
||||
String namePrefix = parser.getAttributeValue("", "namePrefix"); //$NON-NLS-1$
|
||||
if (namePrefix == null) {
|
||||
namePrefix = "";
|
||||
if (nmts != null) {
|
||||
if (rtype.relation || rtype.relationGroup) {
|
||||
String namePrefix = parser.getAttributeValue("", "namePrefix"); //$NON-NLS-1$
|
||||
if (namePrefix == null) {
|
||||
namePrefix = "";
|
||||
}
|
||||
rtype.relationNames = new LinkedHashMap<String, String>();
|
||||
putNameTags(nmts, rtype.relationNames, namePrefix);
|
||||
} else {
|
||||
String[] nameSplit = nmts.split(",");
|
||||
for (String nameTag : nameSplit) {
|
||||
checkOrCreateTextRule(nameTag, null);
|
||||
}
|
||||
}
|
||||
rtype.relationNames = new LinkedHashMap<String, String>();
|
||||
putNameTags(nmts, rtype.relationNames, namePrefix);
|
||||
}
|
||||
String rnmts = parser.getAttributeValue("", "relationGroupNameTags");
|
||||
if (rnmts != null) {
|
||||
|
|
|
@ -189,7 +189,7 @@
|
|||
<color name="gpx_time_span_color">#0080FF</color>
|
||||
|
||||
<color name="color_favorite">#eecc22</color>
|
||||
<color name="color_favorite_gray">#b3b3b3</color>
|
||||
<color name="color_favorite_gray">#727272</color>
|
||||
<color name="parking_icon_background">#244DBD</color>
|
||||
<color name="transport_stop_icon_background">#5870FE</color>
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
Thx - Hardy
|
||||
|
||||
-->
|
||||
<string name="street_level_imagery">Street-level imagery</string>
|
||||
<string name="rourte_between_points_add_track_desc">Select a track file for which a new segment will be added.</string>
|
||||
<string name="navigation_profile">Navigation profile</string>
|
||||
<string name="threshold_distance">Threshold distance</string>
|
||||
|
|
|
@ -117,7 +117,7 @@ public abstract class ContextMenuScrollFragment extends ContextMenuFragment impl
|
|||
MapControlsLayer mapControlsLayer = mapLayers.getMapControlsLayer();
|
||||
mapControlsLayer.setupZoomInButton(zoomInButtonView, longClickListener, ZOOM_IN_BUTTON_ID);
|
||||
mapControlsLayer.setupZoomOutButton(zoomOutButtonView, longClickListener, ZOOM_OUT_BUTTON_ID);
|
||||
mapControlsLayer.setupBackToLocationButton(myLocButtonView, BACK_TO_LOC_BUTTON_ID);
|
||||
mapControlsLayer.setupBackToLocationButton(myLocButtonView, false, BACK_TO_LOC_BUTTON_ID);
|
||||
|
||||
MapInfoLayer mapInfoLayer = mapLayers.getMapInfoLayer();
|
||||
rulerWidget = mapInfoLayer.setupRulerWidget(mapRulerView);
|
||||
|
|
|
@ -78,7 +78,7 @@ public class PointImageDrawable extends Drawable {
|
|||
mapIconBackgroundCenterSmall = backgroundType.getMapBackgroundIconId(ctx, "center", true);
|
||||
mapIconBackgroundBottomSmall = backgroundType.getMapBackgroundIconId(ctx, "bottom", true);
|
||||
colorFilter = new PorterDuffColorFilter(col, PorterDuff.Mode.SRC_IN);
|
||||
grayFilter = new PorterDuffColorFilter(res.getColor(R.color.color_favorite_gray), PorterDuff.Mode.MULTIPLY);
|
||||
grayFilter = new PorterDuffColorFilter(res.getColor(R.color.color_favorite_gray), PorterDuff.Mode.SRC_IN);
|
||||
dp_12_px = AndroidUtils.dpToPx(pointInfo.ctx, 12);
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,8 @@ public class MapillaryPlugin extends OsmandPlugin {
|
|||
}
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setId(MAPILLARY)
|
||||
.setTitleId(R.string.mapillary, mapActivity)
|
||||
.setTitleId(R.string.street_level_imagery, mapActivity)
|
||||
.setDescription("Mapillary")
|
||||
.setSelected(settings.SHOW_MAPILLARY.get())
|
||||
.setColor(settings.SHOW_MAPILLARY.get() ? R.color.osmand_orange : ContextMenuItem.INVALID_ID)
|
||||
.setIcon(R.drawable.ic_action_mapillary)
|
||||
|
|
|
@ -162,7 +162,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public static final int[] SECONDS = new int[] {0, 1, 2, 3, 5, 10, 15, 30, 60, 90};
|
||||
public static final int[] SECONDS = new int[] {0, 1, 2, 3, 5, 10, 15, 20, 30, 60, 90};
|
||||
public static final int[] MINUTES = new int[] {2, 3, 5};
|
||||
public static final int[] MAX_INTERVAL_TO_SEND_MINUTES = new int[] {1, 2, 5, 10, 15, 20, 30, 60};
|
||||
|
||||
|
|
|
@ -526,13 +526,9 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
String getFormattedTime(long timeInMillis) {
|
||||
Time time = new Time();
|
||||
time.set(timeInMillis);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd.MM.yyyy", Locale.getDefault());
|
||||
if (!DateFormat.is24HourFormat(app)) {
|
||||
sdf = new SimpleDateFormat("hh:mm a dd.MM.yyyy", Locale.getDefault());
|
||||
}
|
||||
return sdf.format(new Date(time.toMillis(false)));
|
||||
java.text.DateFormat dateFormat = DateFormat.getMediumDateFormat(app);
|
||||
java.text.DateFormat timeFormat = DateFormat.getTimeFormat(app);
|
||||
return timeFormat.format(timeInMillis) + " " + dateFormat.format(timeInMillis);
|
||||
}
|
||||
|
||||
String getFormattedTimeInterval(long timeInMillis, Activity ctx) {
|
||||
|
|
|
@ -376,7 +376,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
|
|||
|
||||
mapControlsLayer.setupZoomInButton(zoomInButton, longClickListener, ZOOM_IN_BUTTON_ID);
|
||||
mapControlsLayer.setupZoomOutButton(zoomOutButton, longClickListener, ZOOM_OUT_BUTTON_ID);
|
||||
mapControlsLayer.setupBackToLocationButton(backToLocation, BACK_TO_LOC_BUTTON_ID);
|
||||
mapControlsLayer.setupBackToLocationButton(backToLocation, false, BACK_TO_LOC_BUTTON_ID);
|
||||
|
||||
AndroidUiHelper.updateVisibility(zoomButtonsView, true);
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
|
||||
private void initControls() {
|
||||
View backToLocation = mapActivity.findViewById(R.id.map_my_location_button);
|
||||
backToLocationControl = setupBackToLocationButton(backToLocation, BACK_TO_LOC_HUD_ID);
|
||||
backToLocationControl = setupBackToLocationButton(backToLocation, true, BACK_TO_LOC_HUD_ID);
|
||||
|
||||
View backToMenuButton = mapActivity.findViewById(R.id.map_menu_button);
|
||||
|
||||
|
@ -397,7 +397,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
});
|
||||
}
|
||||
|
||||
public MapHudButton setupBackToLocationButton(View backToLocation, String buttonId) {
|
||||
public MapHudButton setupBackToLocationButton(View backToLocation, boolean showContextMenu, String buttonId) {
|
||||
MapHudButton backToLocationButton = createHudButton(backToLocation, R.drawable.ic_my_location, buttonId)
|
||||
.setIconColorId(R.color.map_button_icon_color_light, R.color.map_button_icon_color_dark)
|
||||
.setBg(R.drawable.btn_circle_blue);
|
||||
|
@ -405,20 +405,52 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
backToLocation.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (OsmAndLocationProvider.isLocationPermissionAvailable(mapActivity)) {
|
||||
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(mapActivity,
|
||||
new String[] {Manifest.permission.ACCESS_FINE_LOCATION},
|
||||
OsmAndLocationProvider.REQUEST_LOCATION_PERMISSION);
|
||||
}
|
||||
onBackToLocation(false);
|
||||
}
|
||||
});
|
||||
|
||||
if (showContextMenu) {
|
||||
backToLocation.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
onBackToLocation(true);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
controls.add(backToLocationButton);
|
||||
|
||||
return backToLocationButton;
|
||||
}
|
||||
|
||||
private void onBackToLocation(boolean showLocationMenu) {
|
||||
if (OsmAndLocationProvider.isLocationPermissionAvailable(mapActivity)) {
|
||||
if (showLocationMenu) {
|
||||
showContextMenuForMyLocation();
|
||||
} else if (!mapActivity.getContextMenu().isVisible()) {
|
||||
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
|
||||
}
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(mapActivity,
|
||||
new String[] {Manifest.permission.ACCESS_FINE_LOCATION},
|
||||
OsmAndLocationProvider.REQUEST_LOCATION_PERMISSION);
|
||||
}
|
||||
}
|
||||
|
||||
private void showContextMenuForMyLocation() {
|
||||
OsmAndLocationProvider lp = app.getLocationProvider();
|
||||
Location lastKnownLocation = lp.getLastKnownLocation();
|
||||
Location lastStaleKnownLocation = lp.getLastStaleKnownLocation();
|
||||
Location location = lastKnownLocation != null ? lastKnownLocation : lastStaleKnownLocation;
|
||||
if (location != null) {
|
||||
ContextMenuLayer cml = mapActivity.getMapView().getLayerByClass(ContextMenuLayer.class);
|
||||
if (cml != null) {
|
||||
cml.showContextMenu(location.getLatitude(), location.getLongitude(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void doRoute(boolean hasTargets) {
|
||||
this.hasTargets = hasTargets;
|
||||
onNavigationClick();
|
||||
|
|
Loading…
Reference in a new issue