Add constant for default width multiplier

This commit is contained in:
Vitaliy 2020-07-13 12:11:10 +03:00
parent b7c1fe6ba7
commit 4d81d797db
2 changed files with 4 additions and 3 deletions

View file

@ -3,7 +3,7 @@ package net.osmand.plus;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import net.osmand.GPXUtilities; import net.osmand.GPXUtilities.GPXFile;
import net.osmand.GPXUtilities.GPXFile.GradientScaleType; import net.osmand.GPXUtilities.GPXFile.GradientScaleType;
import net.osmand.GPXUtilities.GPXTrackAnalysis; import net.osmand.GPXUtilities.GPXTrackAnalysis;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
@ -199,7 +199,7 @@ public class GPXDatabase {
this.color = color; this.color = color;
} }
public GpxDataItem(File file, @NonNull GPXUtilities.GPXFile gpxFile) { public GpxDataItem(File file, @NonNull GPXFile gpxFile) {
this.file = file; this.file = file;
color = gpxFile.getColor(0); color = gpxFile.getColor(0);
width = gpxFile.getWidth(null); width = gpxFile.getWidth(null);

View file

@ -75,6 +75,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
private static final Log log = PlatformUtil.getLog(GPXLayer.class); private static final Log log = PlatformUtil.getLog(GPXLayer.class);
private static final double TOUCH_RADIUS_MULTIPLIER = 1.5; private static final double TOUCH_RADIUS_MULTIPLIER = 1.5;
private static final int DEFAULT_WIDTH_MULTIPLIER = 7;
private static final int START_ZOOM = 7; private static final int START_ZOOM = 7;
private OsmandMapTileView view; private OsmandMapTileView view;
@ -225,7 +226,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
if (hash != cachedHash) { if (hash != cachedHash) {
cachedHash = hash; cachedHash = hash;
cachedColor = ContextCompat.getColor(view.getApplication(), R.color.gpx_track); cachedColor = ContextCompat.getColor(view.getApplication(), R.color.gpx_track);
defaultTrackWidth = 7 * view.getDensity(); defaultTrackWidth = DEFAULT_WIDTH_MULTIPLIER * view.getDensity();
if (rrs != null) { if (rrs != null) {
RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs); RenderingRuleSearchRequest req = new RenderingRuleSearchRequest(rrs);
req.setBooleanFilter(rrs.PROPS.R_NIGHT_MODE, nightMode); req.setBooleanFilter(rrs.PROPS.R_NIGHT_MODE, nightMode);