#6948 color change

This commit is contained in:
madwasp79 2019-06-27 18:17:10 +03:00
parent b4c3efd657
commit 590e9d4541

View file

@ -1,5 +1,6 @@
package net.osmand.plus.views;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@ -17,6 +18,7 @@ import java.util.Map;
import java.util.TreeMap;
import gnu.trove.set.hash.TIntHashSet;
import net.osmand.plus.R;
public class MapTextLayer extends OsmandMapLayer {
@ -145,15 +147,19 @@ public class MapTextLayer extends OsmandMapLayer {
}
private void drawShadowText(Canvas cv, String text, float centerX, float centerY, boolean nightMode) {
int c = paintTextIcon.getColor();
Resources r = view.getApplication().getResources();
paintTextIcon.setStyle(Style.STROKE);
paintTextIcon.setColor(nightMode ? Color.WHITE : Color.DKGRAY);
paintTextIcon.setColor(nightMode
? r.getColor(R.color.widgettext_shadow_night)
: r.getColor(R.color.map_widget_dark_stroke));
paintTextIcon.setStrokeWidth(2);
cv.drawText(text, centerX, centerY, paintTextIcon);
// reset
paintTextIcon.setStrokeWidth(2);
paintTextIcon.setStyle(Style.FILL);
paintTextIcon.setColor(nightMode ? c : Color.WHITE);
paintTextIcon.setColor(nightMode
? r.getColor(R.color.widgettext_night )
: r.getColor(R.color.color_black));
cv.drawText(text, centerX, centerY, paintTextIcon);
}