Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8b5a37d838
3 changed files with 43 additions and 37 deletions
|
@ -23,6 +23,7 @@ public class AudioVideoNoteMenuController extends MenuController {
|
|||
private Recording recording;
|
||||
|
||||
private DateFormat dateFormat;
|
||||
private DateFormat timeFormat;
|
||||
private AudioVideoNotesPlugin plugin;
|
||||
|
||||
public AudioVideoNoteMenuController(OsmandApplication app, MapActivity mapActivity, final Recording recording) {
|
||||
|
@ -30,6 +31,7 @@ public class AudioVideoNoteMenuController extends MenuController {
|
|||
this.recording = recording;
|
||||
plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
|
||||
dateFormat = android.text.format.DateFormat.getMediumDateFormat(mapActivity);
|
||||
timeFormat = android.text.format.DateFormat.getTimeFormat(mapActivity);
|
||||
|
||||
if (!recording.isPhoto()) {
|
||||
titleButtonController = new TitleButtonController() {
|
||||
|
@ -71,7 +73,7 @@ public class AudioVideoNoteMenuController extends MenuController {
|
|||
String recName = recording.getName(getMapActivity());
|
||||
if (file != null && recType.equals(recName)) {
|
||||
Date date = new Date(recording.getFile().lastModified());
|
||||
return dateFormat.format(date);
|
||||
return dateFormat.format(date) + " " + timeFormat.format(date);
|
||||
} else {
|
||||
return recording.getName(getMapActivity());
|
||||
}
|
||||
|
|
|
@ -123,19 +123,19 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
}
|
||||
private static int ZOOM_TO_SHOW_BORDERS_ST = 5;
|
||||
private static int ZOOM_TO_SHOW_BORDERS = 7;
|
||||
private static int ZOOM_TO_SHOW_SELECTION_ST = 3;
|
||||
private static int ZOOM_TO_SHOW_SELECTION = 10;
|
||||
|
||||
@Override
|
||||
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {
|
||||
final int zoom = tileBox.getZoom();
|
||||
if(zoom < ZOOM_TO_SHOW_BORDERS_ST) {
|
||||
if(zoom < ZOOM_TO_SHOW_SELECTION_ST) {
|
||||
return;
|
||||
}
|
||||
// draw objects
|
||||
final List<BinaryMapDataObject> currentObjects = data.results;
|
||||
final List<BinaryMapDataObject> selectedObjects = this.selectedObjects;
|
||||
if (zoom >= ZOOM_TO_SHOW_BORDERS_ST && zoom < ZOOM_TO_SHOW_BORDERS && osmandRegions.isInitialized() &&
|
||||
(currentObjects != null || selectedObjects != null)) {
|
||||
if (currentObjects != null) {
|
||||
currentObjects != null) {
|
||||
path.reset();
|
||||
for (BinaryMapDataObject o : currentObjects) {
|
||||
String downloadName = osmandRegions.getDownloadName(o);
|
||||
|
@ -154,7 +154,10 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
}
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
if (selectedObjects != null) {
|
||||
|
||||
final List<BinaryMapDataObject> selectedObjects = this.selectedObjects;
|
||||
if (zoom >= ZOOM_TO_SHOW_SELECTION_ST && zoom < ZOOM_TO_SHOW_SELECTION && osmandRegions.isInitialized() &&
|
||||
selectedObjects != null) {
|
||||
pathSelected.reset();
|
||||
for (BinaryMapDataObject o : selectedObjects) {
|
||||
double lat = MapUtils.get31LatitudeY(o.getPoint31YTile(0));
|
||||
|
@ -169,7 +172,6 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
canvas.drawPath(pathSelected, paintSelected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -370,7 +372,7 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe
|
|||
|
||||
private void getWorldRegionFromPoint(RotatedTileBox tb, PointF point, List<? super BinaryMapDataObject> dataObjects) {
|
||||
int zoom = tb.getZoom();
|
||||
if (zoom >= ZOOM_TO_SHOW_BORDERS_ST && zoom < ZOOM_TO_SHOW_BORDERS && osmandRegions.isInitialized()) {
|
||||
if (zoom >= ZOOM_TO_SHOW_SELECTION_ST && zoom < ZOOM_TO_SHOW_SELECTION && osmandRegions.isInitialized()) {
|
||||
LatLon pointLatLon = tb.getLatLonFromPixel(point.x, point.y);
|
||||
int point31x = MapUtils.get31TileNumberX(pointLatLon.getLongitude());
|
||||
int point31y = MapUtils.get31TileNumberY(pointLatLon.getLatitude());
|
||||
|
|
|
@ -188,8 +188,10 @@ public class FavoritesLayer extends OsmandMapLayer implements ContextMenuLayer.
|
|||
|
||||
@Override
|
||||
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List<Object> res) {
|
||||
if (this.settings.SHOW_FAVORITES.get()) {
|
||||
getFavoriteFromPoint(tileBox, point, res);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LatLon getObjectLocation(Object o) {
|
||||
|
|
Loading…
Reference in a new issue