From f5974f7cf3213c1f094d4c68677f569348a97bf6 Mon Sep 17 00:00:00 2001 From: cepprice Date: Sun, 18 Apr 2021 14:33:42 +0500 Subject: [PATCH] Small refactoring --- OsmAnd/src/net/osmand/plus/views/Renderable.java | 14 ++++---------- .../src/net/osmand/plus/views/layers/GPXLayer.java | 4 +--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/Renderable.java b/OsmAnd/src/net/osmand/plus/views/Renderable.java index 992bc06a8f..2dbf1eb3aa 100644 --- a/OsmAnd/src/net/osmand/plus/views/Renderable.java +++ b/OsmAnd/src/net/osmand/plus/views/Renderable.java @@ -95,16 +95,10 @@ public class Renderable { } } - public void setBorderPaint(@NonNull Paint paint) { - borderPaint = paint; - } - - public void setGradientScaleType(GradientScaleType type) { - this.scaleType = type; - } - - public void shouldDrawBorder(boolean drawBorder) { - this.drawBorder = drawBorder; + public void setGradientTrackParams(GradientScaleType gradientScaleType, @NonNull Paint borderPaint, boolean shouldDrawBorder) { + this.scaleType = gradientScaleType; + this.borderPaint = borderPaint; + this.drawBorder = shouldDrawBorder; } public GpxGeometryWay getGeometryWay() { diff --git a/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java index 7873dcbbab..7185fbc7c7 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java @@ -726,9 +726,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM updatePaints(color, width, selectedGpxFile.isRoutePoints(), currentTrack, settings, tileBox); if (ts.renderer instanceof Renderable.RenderableSegment) { Renderable.RenderableSegment renderableSegment = (Renderable.RenderableSegment) ts.renderer; - renderableSegment.setBorderPaint(borderPaint); - renderableSegment.setGradientScaleType(scaleType); - renderableSegment.shouldDrawBorder(true); + renderableSegment.setGradientTrackParams(scaleType, borderPaint, true); renderableSegment.drawSegment(view.getZoom(), paint, canvas, tileBox); } }