Merge branch 'master' of ssh://github.com/osmandapp/Osmand into SearchImprovement

# Conflicts:
#	OsmAnd/res/values/strings.xml
This commit is contained in:
Chumva 2018-09-27 17:36:57 +03:00
commit 51565df935
11 changed files with 233 additions and 74 deletions

View file

@ -407,7 +407,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding"
android:background="?attr/bg_card" android:background="?attr/bg_card"
android:orientation="vertical"> android:orientation="vertical">
@ -463,6 +462,65 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding"
android:background="?attr/bg_card"
android:orientation="vertical">
<LinearLayout
android:id="@+id/keep_passed_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_title_height"
android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/keep_passed_markers"
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/keep_passed_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginLeft="@dimen/bottom_sheet_content_margin_small"
android:layout_marginStart="@dimen/bottom_sheet_content_margin_small"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:background="?attr/dashboard_divider"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:paddingBottom="@dimen/content_padding_small"
android:paddingTop="@dimen/content_padding_small"
android:text="@string/keep_passed_markers_descr"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView> </com.github.ksoichiro.android.observablescrollview.ObservableScrollView>

View file

@ -458,6 +458,65 @@
<include layout="@layout/list_item_divider"/> <include layout="@layout/list_item_divider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<LinearLayout
android:id="@+id/keep_passed_row"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_title_height"
android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/keep_passed_markers"
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/keep_passed_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginLeft="@dimen/bottom_sheet_content_margin_small"
android:layout_marginStart="@dimen/bottom_sheet_content_margin_small"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:background="?attr/dashboard_divider"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:paddingBottom="@dimen/content_padding_small"
android:paddingTop="@dimen/content_padding_small"
android:text="@string/keep_passed_markers_descr"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout>
<include layout="@layout/list_item_divider"/>
</LinearLayout> </LinearLayout>
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView> </com.github.ksoichiro.android.observablescrollview.ObservableScrollView>

View file

@ -200,6 +200,7 @@
<color name="gpx_time_span_color">#0080FF</color> <color name="gpx_time_span_color">#0080FF</color>
<color name="color_favorite">#eecc22</color> <color name="color_favorite">#eecc22</color>
<color name="color_favorite_gray">#b3b3b3</color>
<!-- Themed color list items --> <!-- Themed color list items -->
<!-- invalid -red, localindex not supported, --> <!-- invalid -red, localindex not supported, -->

View file

@ -13,6 +13,9 @@
<string name="search_street">Search street</string> <string name="search_street">Search street</string>
<string name="start_search_from_city">Start search from city</string> <string name="start_search_from_city">Start search from city</string>
<string name="shared_string_restore">Restore</string>
<string name="keep_passed_markers_descr">Markers added as a group of Favorites or GPX waypoints marked "Passed" will remain on the map. If the group is not active, the markers will disappear from the map.</string>
<string name="keep_passed_markers">Keep passed markers on the map</string>
<string name="more_transport_on_stop_hint">There is more transport on this stop.</string> <string name="more_transport_on_stop_hint">There is more transport on this stop.</string>
<string name="ask_for_location_permission">Please give OsmAnd permission for location to continue.</string> <string name="ask_for_location_permission">Please give OsmAnd permission for location to continue.</string>
<string name="thank_you_for_feedback">Thank you for feedback</string> <string name="thank_you_for_feedback">Thank you for feedback</string>

View file

@ -580,7 +580,7 @@ public class MapMarkersHelper {
@Nullable @Nullable
public MapMarker getMapMarker(WptPt wptPt) { public MapMarker getMapMarker(WptPt wptPt) {
for (MapMarker marker : mapMarkers) { for (MapMarker marker : getMarkers()) {
if (marker.wptPt == wptPt) { if (marker.wptPt == wptPt) {
return marker; return marker;
} }
@ -590,7 +590,7 @@ public class MapMarkersHelper {
@Nullable @Nullable
public MapMarker getMapMarker(FavouritePoint favouritePoint) { public MapMarker getMapMarker(FavouritePoint favouritePoint) {
for (MapMarker marker : mapMarkers) { for (MapMarker marker : getMarkers()) {
if (marker.favouritePoint == favouritePoint) { if (marker.favouritePoint == favouritePoint) {
return marker; return marker;
} }
@ -600,7 +600,7 @@ public class MapMarkersHelper {
@Nullable @Nullable
public MapMarker getMapMarker(@NonNull LatLon latLon) { public MapMarker getMapMarker(@NonNull LatLon latLon) {
for (MapMarker marker : mapMarkers) { for (MapMarker marker : getMarkers()) {
if (marker.point != null && marker.point.equals(latLon)) { if (marker.point != null && marker.point.equals(latLon)) {
return marker; return marker;
} }
@ -608,6 +608,14 @@ public class MapMarkersHelper {
return null; return null;
} }
private List<MapMarker> getMarkers() {
List<MapMarker> res = new ArrayList<>(mapMarkers);
if (settings.KEEP_PASSED_MARKERS_ON_MAP.get()) {
res.addAll(mapMarkersHistory);
}
return res;
}
@Nullable @Nullable
public MapMarker getMapMarker(@NonNull String mapObjectName, @NonNull LatLon latLon) { public MapMarker getMapMarker(@NonNull String mapObjectName, @NonNull LatLon latLon) {
for (MapMarker marker : mapMarkers) { for (MapMarker marker : mapMarkers) {

View file

@ -723,6 +723,7 @@ public class OsmandSettings {
public final CommonPreference<WikiArticleShowImages> WIKI_ARTICLE_SHOW_IMAGES = new EnumIntPreference<>("wikivoyage_show_imgs", WikiArticleShowImages.OFF, WikiArticleShowImages.values()).makeGlobal(); public final CommonPreference<WikiArticleShowImages> WIKI_ARTICLE_SHOW_IMAGES = new EnumIntPreference<>("wikivoyage_show_imgs", WikiArticleShowImages.OFF, WikiArticleShowImages.values()).makeGlobal();
public final CommonPreference<Boolean> SELECT_MARKER_ON_SINGLE_TAP = new BooleanPreference("select_marker_on_single_tap", false).makeProfile(); public final CommonPreference<Boolean> SELECT_MARKER_ON_SINGLE_TAP = new BooleanPreference("select_marker_on_single_tap", false).makeProfile();
public final CommonPreference<Boolean> KEEP_PASSED_MARKERS_ON_MAP = new BooleanPreference("keep_passed_markers_on_map", true).makeProfile();
public final CommonPreference<Boolean> COORDS_INPUT_USE_RIGHT_SIDE = new BooleanPreference("coords_input_use_right_side", true).makeGlobal(); public final CommonPreference<Boolean> COORDS_INPUT_USE_RIGHT_SIDE = new BooleanPreference("coords_input_use_right_side", true).makeGlobal();
public final OsmandPreference<Format> COORDS_INPUT_FORMAT = new EnumIntPreference<>("coords_input_format", Format.DD_MM_MMM, Format.values()).makeGlobal(); public final OsmandPreference<Format> COORDS_INPUT_FORMAT = new EnumIntPreference<>("coords_input_format", Format.DD_MM_MMM, Format.values()).makeGlobal();

View file

@ -13,61 +13,59 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter; import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v4.content.res.ResourcesCompat; import android.support.v4.content.res.ResourcesCompat;
import net.osmand.plus.R; import net.osmand.plus.R;
import java.util.TreeMap; import java.util.TreeMap;
public class FavoriteImageDrawable extends Drawable { public class FavoriteImageDrawable extends Drawable {
private int color; private boolean withShadow;
private Paint paintIcon; private boolean synced;
private Paint paintBackground; private boolean history;
private Bitmap favIcon; private Bitmap favIcon;
private Bitmap favBackground; private Bitmap favBackground;
private Bitmap syncedStroke; private Bitmap syncedStroke;
private Bitmap syncedColor; private Bitmap syncedColor;
private Bitmap syncedShadow; private Bitmap syncedShadow;
private Bitmap syncedIcon; private Bitmap syncedIcon;
private Resources resources;
private boolean withShadow;
private boolean synced;
private Paint paintOuter;
private Paint paintInnerCircle;
private Drawable listDrawable; private Drawable listDrawable;
private Paint paintIcon = new Paint();
private Paint paintBackground = new Paint();
private Paint paintOuter = new Paint();
private Paint paintInnerCircle = new Paint();
private ColorFilter colorFilter;
private ColorFilter grayFilter;
public FavoriteImageDrawable(Context ctx, int color, boolean withShadow, boolean synced) { public FavoriteImageDrawable(Context ctx, int color, boolean withShadow, boolean synced) {
this.withShadow = withShadow; this.withShadow = withShadow;
this.synced = synced; this.synced = synced;
this.resources = ctx.getResources(); Resources res = ctx.getResources();
this.color = color; int col = color == 0 || color == Color.BLACK ? res.getColor(R.color.color_favorite) : color;
paintBackground = new Paint(); favIcon = BitmapFactory.decodeResource(res, R.drawable.map_favorite);
int col = color == 0 || color == Color.BLACK ? getResources().getColor(R.color.color_favorite) : color; favBackground = BitmapFactory.decodeResource(res, R.drawable.map_white_favorite_shield);
paintBackground.setColorFilter(new PorterDuffColorFilter(col, PorterDuff.Mode.MULTIPLY)); syncedStroke = BitmapFactory.decodeResource(res, R.drawable.map_shield_marker_point_stroke);
paintIcon = new Paint(); syncedColor = BitmapFactory.decodeResource(res, R.drawable.map_shield_marker_point_color);
favIcon = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_favorite); syncedShadow = BitmapFactory.decodeResource(res, R.drawable.map_shield_marker_point_shadow);
favBackground = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_white_favorite_shield); syncedIcon = BitmapFactory.decodeResource(res, R.drawable.map_marker_point_14dp);
syncedStroke = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_shield_marker_point_stroke); listDrawable = ResourcesCompat.getDrawable(res, R.drawable.ic_action_fav_dark, null).mutate();
syncedColor = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_shield_marker_point_color); initSimplePaint(paintOuter, color == 0 || color == Color.BLACK ? 0x88555555 : color);
syncedShadow = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_shield_marker_point_shadow); initSimplePaint(paintInnerCircle, col);
syncedIcon = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_marker_point_14dp); colorFilter = new PorterDuffColorFilter(col, PorterDuff.Mode.MULTIPLY);
listDrawable = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_action_fav_dark, null).mutate(); grayFilter = new PorterDuffColorFilter(res.getColor(R.color.color_favorite_gray), PorterDuff.Mode.MULTIPLY);
}
paintOuter = new Paint(); private void initSimplePaint(Paint paint, int color) {
paintOuter.setAntiAlias(true); paint.setAntiAlias(true);
paintOuter.setStyle(Style.FILL_AND_STROKE); paint.setStyle(Style.FILL_AND_STROKE);
paintInnerCircle = new Paint(); paint.setColor(color);
paintInnerCircle.setStyle(Style.FILL_AND_STROKE);
paintOuter.setColor(color == 0 || color == Color.BLACK ? 0x88555555 : color);
paintInnerCircle.setColor(color == 0 || color == Color.BLACK ? getResources().getColor(R.color.color_favorite)
: color);
paintInnerCircle.setAntiAlias(true);
} }
@Override @Override
protected void onBoundsChange(Rect bounds) { protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds); super.onBoundsChange(bounds);
if (!withShadow && !synced) { if (!withShadow && !synced) {
Rect bs = new Rect(bounds); Rect bs = new Rect(bounds);
//bs.inset((int) (4 * density), (int) (4 * density)); //bs.inset((int) (4 * density), (int) (4 * density));
@ -86,16 +84,9 @@ public class FavoriteImageDrawable extends Drawable {
return synced ? syncedShadow.getWidth() : favBackground.getWidth(); return synced ? syncedShadow.getWidth() : favBackground.getWidth();
} }
public int getColor() {
return color;
}
public Resources getResources() {
return resources;
}
@Override @Override
public void draw(Canvas canvas) { public void draw(@NonNull Canvas canvas) {
paintBackground.setColorFilter(history ? grayFilter : colorFilter);
Rect bs = getBounds(); Rect bs = getBounds();
if (synced) { if (synced) {
canvas.drawBitmap(syncedShadow, bs.exactCenterX() - syncedShadow.getWidth() / 2f, bs.exactCenterY() - syncedShadow.getHeight() / 2f, paintBackground); canvas.drawBitmap(syncedShadow, bs.exactCenterX() - syncedShadow.getWidth() / 2f, bs.exactCenterY() - syncedShadow.getHeight() / 2f, paintBackground);
@ -115,7 +106,8 @@ public class FavoriteImageDrawable extends Drawable {
} }
} }
public void drawBitmapInCenter(Canvas canvas, float x, float y) { public void drawBitmapInCenter(Canvas canvas, float x, float y, boolean history) {
this.history = history;
float dx = x - getIntrinsicWidth() / 2f; float dx = x - getIntrinsicWidth() / 2f;
float dy = y - getIntrinsicHeight() / 2f; float dy = y - getIntrinsicHeight() / 2f;
canvas.translate(dx, dy); canvas.translate(dx, dy);

View file

@ -38,15 +38,21 @@ public class MapMarkerMenuController extends MenuController {
MapActivity activity = getMapActivity(); MapActivity activity = getMapActivity();
if (activity != null) { if (activity != null) {
MapMarkersHelper markersHelper = activity.getMyApplication().getMapMarkersHelper(); MapMarkersHelper markersHelper = activity.getMyApplication().getMapMarkersHelper();
markersHelper.moveMapMarkerToHistory(getMapMarker()); MapMarker marker = getMapMarker();
if (marker.history) {
markersHelper.restoreMarkerFromHistory(marker, 0);
} else {
markersHelper.moveMapMarkerToHistory(marker);
}
activity.getContextMenu().close(); activity.getContextMenu().close();
} }
} }
}; };
leftTitleButtonController.caption = mapActivity.getString(R.string.mark_passed); leftTitleButtonController.caption = mapActivity.getString(mapMarker.history ? R.string.shared_string_restore : R.string.mark_passed);
leftTitleButtonController.leftIcon = useStateList ? createStateListPassedIcon() leftTitleButtonController.leftIcon = useStateList ? createStateListPassedIcon()
: createPassedIcon(getPassedIconBgNormalColorId(), 0); : createPassedIcon(getPassedIconBgNormalColorId(), 0);
if (!mapMarker.history) {
rightTitleButtonController = new TitleButtonController() { rightTitleButtonController = new TitleButtonController() {
@Override @Override
public void buttonPressed() { public void buttonPressed() {
@ -68,6 +74,7 @@ public class MapMarkerMenuController extends MenuController {
rightTitleButtonController.leftIcon = useStateList ? createStateListShowOnTopbarIcon() rightTitleButtonController.leftIcon = useStateList ? createStateListShowOnTopbarIcon()
: createShowOnTopbarIcon(getDeviceTopNormalColorId(), R.color.dashboard_blue); : createShowOnTopbarIcon(getDeviceTopNormalColorId(), R.color.dashboard_blue);
} }
}
private int getPassedIconBgNormalColorId() { private int getPassedIconBgNormalColorId() {
return isLight() ? R.color.map_widget_blue : R.color.osmand_orange; return isLight() ? R.color.map_widget_blue : R.color.osmand_orange;

View file

@ -193,6 +193,15 @@ public class DirectionIndicationDialogFragment extends BaseOsmAndDialogFragment
} }
}); });
final CompoundButton keepPassedToggle = (CompoundButton) mainView.findViewById(R.id.keep_passed_switch);
keepPassedToggle.setChecked(settings.KEEP_PASSED_MARKERS_ON_MAP.get());
mainView.findViewById(R.id.keep_passed_row).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
updateChecked(settings.KEEP_PASSED_MARKERS_ON_MAP, keepPassedToggle);
}
});
return mainView; return mainView;
} }

View file

@ -46,7 +46,10 @@ public class FavouritesLayer extends OsmandMapLayer implements ContextMenuLayer.
private MapTextLayer textLayer; private MapTextLayer textLayer;
private Paint paintIcon; private Paint paintIcon;
private Bitmap pointSmall; private Bitmap pointSmall;
@ColorInt
private int defaultColor; private int defaultColor;
@ColorInt
private int grayColor;
private OsmandSettings settings; private OsmandSettings settings;
@ -70,6 +73,7 @@ public class FavouritesLayer extends OsmandMapLayer implements ContextMenuLayer.
paintIcon = new Paint(); paintIcon = new Paint();
pointSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_white_shield_small); pointSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_white_shield_small);
defaultColor = ContextCompat.getColor(view.getContext(), R.color.color_favorite); defaultColor = ContextCompat.getColor(view.getContext(), R.color.color_favorite);
grayColor = ContextCompat.getColor(view.getContext(), R.color.color_favorite_gray);
contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class); contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);
} }
@ -135,8 +139,13 @@ public class FavouritesLayer extends OsmandMapLayer implements ContextMenuLayer.
if (intersects(boundIntersections, x, y, iconSize, iconSize)) { if (intersects(boundIntersections, x, y, iconSize, iconSize)) {
@ColorInt @ColorInt
int col = o.getColor() == 0 || o.getColor() == Color.BLACK ? defaultColor : o.getColor(); int color;
paintIcon.setColorFilter(new PorterDuffColorFilter(col, PorterDuff.Mode.MULTIPLY)); if (marker != null && marker.history) {
color = grayColor;
} else {
color = o.getColor() == 0 || o.getColor() == Color.BLACK ? defaultColor : o.getColor();
}
paintIcon.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY));
canvas.drawBitmap(pointSmall, x - pointSmall.getWidth() / 2, y - pointSmall.getHeight() / 2, paintIcon); canvas.drawBitmap(pointSmall, x - pointSmall.getWidth() / 2, y - pointSmall.getHeight() / 2, paintIcon);
smallObjectsLatLon.add(new LatLon(lat, lon)); smallObjectsLatLon.add(new LatLon(lat, lon));
} else { } else {
@ -164,12 +173,14 @@ public class FavouritesLayer extends OsmandMapLayer implements ContextMenuLayer.
private void drawBigPoint(Canvas canvas, FavouritePoint o, float x, float y, @Nullable MapMarker marker) { private void drawBigPoint(Canvas canvas, FavouritePoint o, float x, float y, @Nullable MapMarker marker) {
FavoriteImageDrawable fid; FavoriteImageDrawable fid;
boolean history = false;
if (marker != null) { if (marker != null) {
fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), o.getColor()); fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), o.getColor());
history = marker.history;
} else { } else {
fid = FavoriteImageDrawable.getOrCreate(view.getContext(), o.getColor(), true); fid = FavoriteImageDrawable.getOrCreate(view.getContext(), o.getColor(), true);
} }
fid.drawBitmapInCenter(canvas, x, y); fid.drawBitmapInCenter(canvas, x, y, history);
} }

View file

@ -106,6 +106,8 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
private int visitedColor; private int visitedColor;
@ColorInt @ColorInt
private int defPointColor; private int defPointColor;
@ColorInt
private int grayColor;
@Override @Override
public void initLayer(OsmandMapTileView view) { public void initLayer(OsmandMapTileView view) {
@ -174,6 +176,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
visitedColor = ContextCompat.getColor(view.getApplication(), R.color.color_ok); visitedColor = ContextCompat.getColor(view.getApplication(), R.color.color_ok);
defPointColor = ContextCompat.getColor(view.getApplication(), R.color.gpx_color_point); defPointColor = ContextCompat.getColor(view.getApplication(), R.color.gpx_color_point);
grayColor = ContextCompat.getColor(view.getApplication(), R.color.color_favorite_gray);
} }
@Override @Override
@ -381,8 +384,13 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
if (intersects(boundIntersections, x, y, iconSize, iconSize)) { if (intersects(boundIntersections, x, y, iconSize, iconSize)) {
@ColorInt @ColorInt
int pointColor = getPointColor(o, fileColor); int color;
paintIcon.setColorFilter(new PorterDuffColorFilter(pointColor, PorterDuff.Mode.MULTIPLY)); if (marker != null && marker.history) {
color = grayColor;
} else {
color = getPointColor(o, fileColor);
}
paintIcon.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY));
canvas.drawBitmap(pointSmall, x - pointSmall.getWidth() / 2, y - pointSmall.getHeight() / 2, paintIcon); canvas.drawBitmap(pointSmall, x - pointSmall.getWidth() / 2, y - pointSmall.getHeight() / 2, paintIcon);
smallObjectsLatLon.add(new LatLon(o.lat, o.lon)); smallObjectsLatLon.add(new LatLon(o.lat, o.lon));
} else { } else {
@ -464,12 +472,14 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
private void drawBigPoint(Canvas canvas, WptPt o, int fileColor, float x, float y, @Nullable MapMarker marker) { private void drawBigPoint(Canvas canvas, WptPt o, int fileColor, float x, float y, @Nullable MapMarker marker) {
int pointColor = getPointColor(o, fileColor); int pointColor = getPointColor(o, fileColor);
FavoriteImageDrawable fid; FavoriteImageDrawable fid;
boolean history = false;
if (marker != null) { if (marker != null) {
fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), pointColor); fid = FavoriteImageDrawable.getOrCreateSyncedIcon(view.getContext(), pointColor);
history = marker.history;
} else { } else {
fid = FavoriteImageDrawable.getOrCreate(view.getContext(), pointColor, true); fid = FavoriteImageDrawable.getOrCreate(view.getContext(), pointColor, true);
} }
fid.drawBitmapInCenter(canvas, x, y); fid.drawBitmapInCenter(canvas, x, y, history);
} }
@ColorInt @ColorInt