diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-hdpi/map_bicycle_bearing.png
deleted file mode 100644
index 4a3ea967ad..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index aa15798537..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location.png
deleted file mode 100644
index 5fb9d3f902..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost.png
deleted file mode 100644
index bebc1fa6ac..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index 9ded796ac4..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_night.png
deleted file mode 100644
index 5b9bb8558d..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index a3bcf1a835..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing.png b/OsmAnd/res/drawable-hdpi/map_car_bearing.png
deleted file mode 100644
index 9cb7a8bdeb..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_car_bearing_night.png
deleted file mode 100644
index 4a1f583170..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location.png b/OsmAnd/res/drawable-hdpi/map_car_location.png
deleted file mode 100644
index 6b1c783ccf..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_lost.png b/OsmAnd/res/drawable-hdpi/map_car_location_lost.png
deleted file mode 100644
index 7b80f695ae..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_car_location_lost_night.png
deleted file mode 100644
index fba15e4b75..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_night.png b/OsmAnd/res/drawable-hdpi/map_car_location_night.png
deleted file mode 100644
index 5ee3fa3054..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index bae7aa9e95..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location.png b/OsmAnd/res/drawable-hdpi/map_default_location.png
deleted file mode 100644
index c07988087a..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_lost.png b/OsmAnd/res/drawable-hdpi/map_default_location_lost.png
deleted file mode 100644
index 4ff643f9cd..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_default_location_lost_night.png
deleted file mode 100644
index 7d097bbc6a..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_night.png b/OsmAnd/res/drawable-hdpi/map_default_location_night.png
deleted file mode 100644
index 80b7f18d5e..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index f852001c23..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-hdpi/map_nautical_bearing.png
deleted file mode 100644
index 72e427c437..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_nautical_bearing_night.png
deleted file mode 100644
index c7d4e436be..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location.png b/OsmAnd/res/drawable-hdpi/map_nautical_location.png
deleted file mode 100644
index 4a8b8aebc5..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-hdpi/map_nautical_location_night.png
deleted file mode 100644
index 80baedcf73..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index 6940b54e60..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index 744054c178..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing.png
deleted file mode 100644
index de606621f1..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 35dfdc4cbc..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location.png
deleted file mode 100644
index b7704ef9d7..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index cce0ef4dda..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index 5d3ec7b8c5..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_night.png
deleted file mode 100644
index b6a70a93ea..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index a97d40ba4f..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index 24175e4361..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-mdpi/map_bicycle_bearing.png
deleted file mode 100644
index 62859e38e8..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index 1afc4fd220..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location.png
deleted file mode 100644
index f75b8d6c36..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost.png
deleted file mode 100644
index 6cc51190e7..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index aea1ded6a8..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_night.png
deleted file mode 100644
index 93701bbefd..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index 72bf3e9096..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing.png b/OsmAnd/res/drawable-mdpi/map_car_bearing.png
deleted file mode 100644
index 1abb480e56..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_car_bearing_night.png
deleted file mode 100644
index ee70f4dcda..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location.png b/OsmAnd/res/drawable-mdpi/map_car_location.png
deleted file mode 100644
index 90c9699bf3..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_lost.png b/OsmAnd/res/drawable-mdpi/map_car_location_lost.png
deleted file mode 100644
index 683b71d211..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_car_location_lost_night.png
deleted file mode 100644
index 4bcae2b836..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_night.png b/OsmAnd/res/drawable-mdpi/map_car_location_night.png
deleted file mode 100644
index d0f0a6c887..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index 091e1c6a41..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location.png b/OsmAnd/res/drawable-mdpi/map_default_location.png
deleted file mode 100644
index 9c868ee438..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_lost.png b/OsmAnd/res/drawable-mdpi/map_default_location_lost.png
deleted file mode 100644
index 2282c4a44f..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_default_location_lost_night.png
deleted file mode 100644
index 9319b73dbd..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_night.png b/OsmAnd/res/drawable-mdpi/map_default_location_night.png
deleted file mode 100644
index cf722851ad..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index 6cb0d7799d..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-mdpi/map_nautical_bearing.png
deleted file mode 100644
index f5226ce658..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_nautical_bearing_night.png
deleted file mode 100644
index 1cac77b7c5..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location.png b/OsmAnd/res/drawable-mdpi/map_nautical_location.png
deleted file mode 100644
index ccf25980c1..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-mdpi/map_nautical_location_night.png
deleted file mode 100644
index 0ab169798e..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index ec345eb578..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index b51a6fcee2..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing.png
deleted file mode 100644
index a98dfca003..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 871e03b2c3..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location.png
deleted file mode 100644
index 484250a849..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index 508891f25a..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index d49881be8a..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_night.png
deleted file mode 100644
index 3b6ce6b62e..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index 52017305cf..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index 033d44960b..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing.png
deleted file mode 100644
index 4ae946f120..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index db4067d686..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location.png
deleted file mode 100644
index 5c7c7c69f5..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost.png
deleted file mode 100644
index fcaabf6ad0..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index bab8271450..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_night.png
deleted file mode 100644
index 2f1e763b2d..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index cc9d043ada..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing.png b/OsmAnd/res/drawable-xhdpi/map_car_bearing.png
deleted file mode 100644
index ec0255883c..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_car_bearing_night.png
deleted file mode 100644
index 5254993ee9..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location.png b/OsmAnd/res/drawable-xhdpi/map_car_location.png
deleted file mode 100644
index 7286a3b653..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_car_location_lost.png
deleted file mode 100644
index 3d8b63d148..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_car_location_lost_night.png
deleted file mode 100644
index 0ce19dc964..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_night.png b/OsmAnd/res/drawable-xhdpi/map_car_location_night.png
deleted file mode 100644
index cec82e2a7e..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index 65f4e655c9..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location.png b/OsmAnd/res/drawable-xhdpi/map_default_location.png
deleted file mode 100644
index e353ebff84..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_default_location_lost.png
deleted file mode 100644
index 224ab74273..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_default_location_lost_night.png
deleted file mode 100644
index b9db6a188c..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_night.png b/OsmAnd/res/drawable-xhdpi/map_default_location_night.png
deleted file mode 100644
index 4312481b95..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index 9ed2f18387..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-xhdpi/map_nautical_bearing.png
deleted file mode 100644
index 84492536d2..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_night.png
deleted file mode 100644
index 4a5d566a9f..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location.png
deleted file mode 100644
index eb4ee41d99..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location_night.png
deleted file mode 100644
index 5925133490..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index db4d3d4a75..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index 908e52b411..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing.png
deleted file mode 100644
index 37b064a8b7..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 37fba19f8b..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location.png
deleted file mode 100644
index c2cdd3879d..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index dfd5c4c658..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index 0aef4663d1..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_night.png
deleted file mode 100644
index 3eba24a741..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index b448d1c0d6..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index e433ed7e0b..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing.png
deleted file mode 100644
index a7d11cd28d..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index d20656fced..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location.png
deleted file mode 100644
index 292fb260c4..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost.png
deleted file mode 100644
index 35f3ecb1a4..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index 79b685dcc7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_night.png
deleted file mode 100644
index 7281c69a60..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index c3e2a1d2f7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_car_bearing.png
deleted file mode 100644
index c89f205923..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_bearing_night.png
deleted file mode 100644
index 6a57c27d92..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location.png b/OsmAnd/res/drawable-xxhdpi/map_car_location.png
deleted file mode 100644
index 8b12c334f2..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_lost.png
deleted file mode 100644
index bfd71b27a2..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_lost_night.png
deleted file mode 100644
index 46a316ec88..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_night.png
deleted file mode 100644
index a7d730da0e..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index 3eb0592c29..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location.png b/OsmAnd/res/drawable-xxhdpi/map_default_location.png
deleted file mode 100644
index 13061d7682..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_lost.png
deleted file mode 100644
index 5ad2db4c02..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_lost_night.png
deleted file mode 100644
index e396e0e66c..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_night.png
deleted file mode 100644
index 3473c7d99e..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index 165f484907..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing.png
deleted file mode 100644
index 01533ae4f7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_night.png
deleted file mode 100644
index e6687ff69a..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location.png
deleted file mode 100644
index 4e19b38778..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location_night.png
deleted file mode 100644
index 8800e0c2b8..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index 28f4b540fe..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index c1b505218b..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing.png
deleted file mode 100644
index 812436c026..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 9ec8b8e195..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location.png
deleted file mode 100644
index 702898ca17..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index 5724c476a9..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index 1a4dd14e4a..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_night.png
deleted file mode 100644
index 9bab37fd86..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index 304d21fe3d..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index 615088cf0a..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable/bg_select_icon_button.xml b/OsmAnd/res/drawable/bg_select_icon_button.xml
new file mode 100644
index 0000000000..f037ae97e1
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_select_icon_button.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/bg_select_icon_button_outline.xml b/OsmAnd/res/drawable/bg_select_icon_button_outline.xml
new file mode 100644
index 0000000000..b0af330779
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_select_icon_button_outline.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_bicycle_location_xml.xml b/OsmAnd/res/drawable/map_bicycle_location_xml.xml
new file mode 100644
index 0000000000..0065008710
--- /dev/null
+++ b/OsmAnd/res/drawable/map_bicycle_location_xml.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_car_location_xml.xml b/OsmAnd/res/drawable/map_car_location_xml.xml
new file mode 100644
index 0000000000..7fec9f8839
--- /dev/null
+++ b/OsmAnd/res/drawable/map_car_location_xml.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_car_navigation_xml.xml b/OsmAnd/res/drawable/map_car_navigation_xml.xml
new file mode 100644
index 0000000000..17336e0c72
--- /dev/null
+++ b/OsmAnd/res/drawable/map_car_navigation_xml.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_default_location_xml.xml b/OsmAnd/res/drawable/map_default_location_xml.xml
new file mode 100644
index 0000000000..ed1f37c833
--- /dev/null
+++ b/OsmAnd/res/drawable/map_default_location_xml.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_nautical_navigation_xml.xml b/OsmAnd/res/drawable/map_nautical_navigation_xml.xml
new file mode 100644
index 0000000000..86204ce6e3
--- /dev/null
+++ b/OsmAnd/res/drawable/map_nautical_navigation_xml.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/plan_route_info.xml b/OsmAnd/res/layout/plan_route_info.xml
index 37da3bafa0..6c62f16368 100644
--- a/OsmAnd/res/layout/plan_route_info.xml
+++ b/OsmAnd/res/layout/plan_route_info.xml
@@ -110,7 +110,7 @@
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:layout_marginBottom="@dimen/list_header_text_left_margin"
- android:src="@drawable/map_default_location" />
+ android:src="@drawable/ic_action_location_color" />
+ android:src="@drawable/ic_action_location_color" />
+ android:src="@drawable/ic_action_location_color" />
+ android:padding="7dp">
+ android:layout_margin="4dp" />
\ No newline at end of file
diff --git a/OsmAnd/res/layout/preference_select_icon_button.xml b/OsmAnd/res/layout/preference_select_icon_button.xml
new file mode 100644
index 0000000000..ac80040512
--- /dev/null
+++ b/OsmAnd/res/layout/preference_select_icon_button.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index eef24cac63..93da10b6a0 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -202,15 +202,6 @@
#0080FF
-
- #320000FF
-
- #88536dfe
- #280000FF
-
- #66536dfe
- #707CDC
-
#B4B319FF
#B400FFFF
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 89b6bd1019..9cc50e7897 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -11,6 +11,9 @@
Thx - Hardy
-->
+ OSM
+ You will see the icon only while navigation or while moving.
+ Map icon appears only on the map, and changing while navigation to navigation icon.
%1$s %2$s
%1$s: %2$s
By clicking %1$s, you will lose all your changes.
diff --git a/OsmAnd/res/xml/profile_appearance.xml b/OsmAnd/res/xml/profile_appearance.xml
index 067429aaa9..9c042ddeaa 100644
--- a/OsmAnd/res/xml/profile_appearance.xml
+++ b/OsmAnd/res/xml/profile_appearance.xml
@@ -49,15 +49,15 @@
android:layout="@layout/simple_divider_item"
android:selectable="false" />
-
+ android:selectable="false"/>
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java
index b1bae228da..1e16a7ee38 100644
--- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java
+++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java
@@ -72,64 +72,87 @@ public class ApplicationMode {
private String routingProfile = "";
private RouteService routeService = RouteService.OSMAND;
-
private float defaultSpeed = 10f;
private float initialDefaultSpeed = defaultSpeed;
private int minDistanceForTurn = 50;
private int arrivalDistance = 90;
private int offRouteDistance = 350;
- private int bearingIconDay = R.drawable.map_pedestrian_bearing;
- private int bearingIconNight = R.drawable.map_pedestrian_bearing_night;
- private int headingIconDay = R.drawable.map_pedestrian_location_view_angle;
- private int headingIconNight = R.drawable.map_pedestrian_location_view_angle_night;
- private int locationIconDay = R.drawable.map_pedestrian_location;
- private int locationIconNight = R.drawable.map_pedestrian_location_night;
- private int locationIconDayLost = R.drawable.map_pedestrian_location_lost;
- private int locationIconNightLost = R.drawable.map_pedestrian_location_lost_night;
+ private NavigationIcon navigationIcon = NavigationIcon.CAR;
+ private LocationIcon locationIcon = LocationIcon.DEFAULT;
private ApplicationMode(int key, String stringKey) {
this.keyName = key;
this.stringKey = stringKey;
}
-
/*
* DEFAULT("Browse map"), CAR("Car"), BICYCLE("Bicycle"), PEDESTRIAN("Pedestrian"); NAUTICAL("boat"); PUBLIC_TRANSPORT("Public transport"); AIRCRAFT("Aircraft")
*/
- public static final ApplicationMode DEFAULT = createBase(R.string.app_mode_default, "default").speed(1.5f, 5).arrivalDistance(90).defLocation().
- icon(R.drawable.ic_world_globe_dark, R.drawable.map_world_globe_dark, "ic_world_globe_dark").reg();
+ public static final ApplicationMode DEFAULT = createBase(R.string.app_mode_default, "default")
+ .speed(1.5f, 5).arrivalDistance(90)
+ .locationIcon(LocationIcon.DEFAULT).navigationIcon(NavigationIcon.CAR)
+ .icon(R.drawable.ic_world_globe_dark, R.drawable.map_world_globe_dark, "ic_world_globe_dark").reg();
- public static final ApplicationMode CAR = createBase(R.string.app_mode_car, "car").speed(12.5f, 35).carLocation().
- icon(R.drawable.ic_action_car_dark, R.drawable.map_action_car_dark, "ic_action_car_dark").setRoutingProfile("car").description(R.string.base_profile_descr_car).reg();
+ public static final ApplicationMode CAR = createBase(R.string.app_mode_car, "car")
+ .speed(12.5f, 35)
+ .locationIcon(LocationIcon.CAR).navigationIcon(NavigationIcon.CAR)
+ .icon(R.drawable.ic_action_car_dark, R.drawable.map_action_car_dark, "ic_action_car_dark")
+ .setRoutingProfile("car").description(R.string.base_profile_descr_car).reg();
- public static final ApplicationMode BICYCLE = createBase(R.string.app_mode_bicycle, "bicycle").speed(2.77f, 15).arrivalDistance(60).offRouteDistance(50).bicycleLocation().
- icon(R.drawable.ic_action_bicycle_dark, R.drawable.map_action_bicycle_dark,"ic_action_bicycle_dark").setRoutingProfile("bicycle").description(R.string.base_profile_descr_bicycle).reg();
+ public static final ApplicationMode BICYCLE = createBase(R.string.app_mode_bicycle, "bicycle")
+ .speed(2.77f, 15).arrivalDistance(60).offRouteDistance(50)
+ .locationIcon(LocationIcon.BICYCLE).navigationIcon(NavigationIcon.CAR)
+ .icon(R.drawable.ic_action_bicycle_dark, R.drawable.map_action_bicycle_dark, "ic_action_bicycle_dark")
+ .setRoutingProfile("bicycle").description(R.string.base_profile_descr_bicycle).reg();
- public static final ApplicationMode PEDESTRIAN = createBase(R.string.app_mode_pedestrian, "pedestrian").speed(1.11f, 5).arrivalDistance(45).offRouteDistance(20).
- icon(R.drawable.ic_action_pedestrian_dark, R.drawable.map_action_pedestrian_dark, "ic_action_pedestrian_dark").setRoutingProfile("pedestrian").description(R.string.base_profile_descr_pedestrian).reg();
+ public static final ApplicationMode PEDESTRIAN = createBase(R.string.app_mode_pedestrian, "pedestrian")
+ .speed(1.11f, 5).arrivalDistance(45).offRouteDistance(20)
+ .icon(R.drawable.ic_action_pedestrian_dark, R.drawable.map_action_pedestrian_dark, "ic_action_pedestrian_dark")
+ .setRoutingProfile("pedestrian").description(R.string.base_profile_descr_pedestrian).reg();
- public static final ApplicationMode PUBLIC_TRANSPORT = createBase(R.string.app_mode_public_transport, "public_transport").
- icon(R.drawable.ic_action_bus_dark, R.drawable.map_action_bus_dark,"ic_action_bus_dark").setRoutingProfile("public_transport").description(R.string.base_profile_descr_public_transport).reg();
+ public static final ApplicationMode PUBLIC_TRANSPORT = createBase(R.string.app_mode_public_transport, "public_transport")
+ .icon(R.drawable.ic_action_bus_dark, R.drawable.map_action_bus_dark, "ic_action_bus_dark")
+ .setRoutingProfile("public_transport").description(R.string.base_profile_descr_public_transport).reg();
- public static final ApplicationMode BOAT = createBase(R.string.app_mode_boat, "boat").speed(1.38f, 20).nauticalLocation().
- icon(R.drawable.ic_action_sail_boat_dark, R.drawable.map_action_sail_boat_dark, "ic_action_sail_boat_dark").setRoutingProfile("boat").description(R.string.base_profile_descr_boat).reg();
+ public static final ApplicationMode BOAT = createBase(R.string.app_mode_boat, "boat")
+ .speed(1.38f, 20)
+ .locationIcon(LocationIcon.DEFAULT).navigationIcon(NavigationIcon.NAUTICAL)
+ .icon(R.drawable.ic_action_sail_boat_dark, R.drawable.map_action_sail_boat_dark, "ic_action_sail_boat_dark")
+ .setRoutingProfile("boat").description(R.string.base_profile_descr_boat).reg();
- public static final ApplicationMode AIRCRAFT = createBase(R.string.app_mode_aircraft, "aircraft").speed(40f, 100).carLocation().
- icon(R.drawable.ic_action_aircraft, R.drawable.map_action_aircraft,"ic_action_aircraft").setRouteService(RouteService.STRAIGHT).setRoutingProfile("STRAIGHT_LINE_MODE").description(R.string.base_profile_descr_aircraft).reg();
-
- public static final ApplicationMode SKI = createBase(R.string.app_mode_skiing, "ski").speed(1.38f, 15).arrivalDistance(60).offRouteDistance(50).bicycleLocation().
- icon(R.drawable.ic_action_skiing, R.drawable.ic_action_skiing,"ic_action_skiing").setRoutingProfile("ski").description(R.string.base_profile_descr_ski).reg();
+ public static final ApplicationMode AIRCRAFT = createBase(R.string.app_mode_aircraft, "aircraft")
+ .speed(40f, 100)
+ .locationIcon(LocationIcon.CAR).navigationIcon(NavigationIcon.CAR)
+ .icon(R.drawable.ic_action_aircraft, R.drawable.map_action_aircraft, "ic_action_aircraft").setRouteService(RouteService.STRAIGHT)
+ .setRoutingProfile("STRAIGHT_LINE_MODE").description(R.string.base_profile_descr_aircraft).reg();
+ public static final ApplicationMode SKI = createBase(R.string.app_mode_skiing, "ski")
+ .speed(1.38f, 15).arrivalDistance(60).offRouteDistance(50)
+ .locationIcon(LocationIcon.BICYCLE).navigationIcon(NavigationIcon.CAR)
+ .icon(R.drawable.ic_action_skiing, R.drawable.map_action_skiing, "ic_action_skiing")
+ .setRoutingProfile("ski").description(R.string.base_profile_descr_ski).reg();
private static class ApplicationModeBean {
- @Expose String stringKey;
- @Expose String userProfileName;
- @Expose String parent;
- @Expose String iconName = "map_world_globe_dark";
- @Expose ProfileIconColors iconColor = ProfileIconColors.DEFAULT;
- @Expose String routingProfile = null;
- @Expose RouteService routeService = RouteService.OSMAND;
- @Expose int order;
+ @Expose
+ String stringKey;
+ @Expose
+ String userProfileName;
+ @Expose
+ String parent;
+ @Expose
+ String iconName = "map_world_globe_dark";
+ @Expose
+ ProfileIconColors iconColor = ProfileIconColors.DEFAULT;
+ @Expose
+ String routingProfile = null;
+ @Expose
+ RouteService routeService = RouteService.OSMAND;
+ @Expose
+ LocationIcon locationIcon = LocationIcon.DEFAULT;
+ @Expose
+ NavigationIcon navigationIcon = NavigationIcon.CAR;
+ @Expose
+ int order;
}
private static void initRegVisibility() {
@@ -165,7 +188,6 @@ public class ApplicationMode {
regWidgetAvailability(WIDGET_MAX_SPEED, CAR);
regWidgetAvailability(WIDGET_ALTITUDE, all);
-
// all = null everything
regWidgetAvailability(WIDGET_COMPASS, all);
regWidgetAvailability(WIDGET_MARKER_1, none);
@@ -182,7 +204,6 @@ public class ApplicationMode {
// regWidgetAvailability(WIDGET_STREET_NAME, all);
}
-
public static class ApplicationModeBuilder {
private ApplicationMode applicationMode;
@@ -206,14 +227,8 @@ public class ApplicationMode {
m.minDistanceForTurn = m.parentAppMode.minDistanceForTurn;
m.arrivalDistance = m.parentAppMode.arrivalDistance;
m.offRouteDistance = m.parentAppMode.offRouteDistance;
- m.bearingIconDay = m.parentAppMode.bearingIconDay;
- m.bearingIconNight = m.parentAppMode.bearingIconNight;
- m.headingIconDay = m.parentAppMode.headingIconDay;
- m.headingIconNight = m.parentAppMode.headingIconNight;
- m.locationIconDay = m.parentAppMode.locationIconDay;
- m.locationIconNight = m.parentAppMode.locationIconNight;
- m.locationIconDayLost = m.parentAppMode.locationIconDayLost;
- m.locationIconNightLost = m.parentAppMode.locationIconNightLost;
+ m.navigationIcon = m.parentAppMode.navigationIcon;
+ m.locationIcon = m.parentAppMode.locationIcon;
values.add(applicationMode);
if (applicationMode.getOrder() == 0 && !values.isEmpty()) {
applicationMode.setOrder(values.size());
@@ -250,61 +265,16 @@ public class ApplicationMode {
public ApplicationModeBuilder parent(ApplicationMode parent) {
applicationMode.parentAppMode = parent;
- if (parent == CAR || parent == AIRCRAFT) {
- this.carLocation();
- } else if (parent == BICYCLE || parent == SKI) {
- this.bicycleLocation();
- } else if (parent == BOAT) {
- this.nauticalLocation();
- } else {
- this.defLocation();
- }
return this;
}
- public ApplicationModeBuilder carLocation() {
- applicationMode.bearingIconDay = R.drawable.map_car_bearing;
- applicationMode.bearingIconNight = R.drawable.map_car_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_car_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_car_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_car_location;
- applicationMode.locationIconNight = R.drawable.map_car_location_night;
- applicationMode.locationIconDayLost = R.drawable.map_car_location_lost;
- applicationMode.locationIconNightLost = R.drawable.map_car_location_lost_night;
+ public ApplicationModeBuilder locationIcon(LocationIcon locationIcon) {
+ applicationMode.locationIcon = locationIcon;
return this;
}
- public ApplicationModeBuilder bicycleLocation() {
- applicationMode.bearingIconDay = R.drawable.map_bicycle_bearing;
- applicationMode.bearingIconNight = R.drawable.map_bicycle_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_bicycle_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_bicycle_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_bicycle_location;
- applicationMode.locationIconNight = R.drawable.map_bicycle_location_night;
- applicationMode.locationIconDayLost = R.drawable.map_bicycle_location_lost;
- applicationMode.locationIconNightLost = R.drawable.map_bicycle_location_lost_night;
- return this;
- }
-
- public ApplicationModeBuilder defLocation() {
- applicationMode.bearingIconDay = R.drawable.map_pedestrian_bearing;
- applicationMode.bearingIconNight = R.drawable.map_pedestrian_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_default_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_default_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_pedestrian_location;
- applicationMode.locationIconNight = R.drawable.map_pedestrian_location_night;
- applicationMode.locationIconDayLost = R.drawable.map_pedestrian_location_lost;
- applicationMode.locationIconNightLost = R.drawable.map_pedestrian_location_lost_night;
- return this;
- }
-
- public ApplicationModeBuilder nauticalLocation() {
- applicationMode.bearingIconDay = R.drawable.map_nautical_bearing;
- applicationMode.bearingIconNight = R.drawable.map_nautical_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_nautical_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_nautical_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_nautical_location;
- applicationMode.locationIconNight = R.drawable.map_nautical_location_night;
+ public ApplicationModeBuilder navigationIcon(NavigationIcon navigationIcon) {
+ applicationMode.navigationIcon = navigationIcon;
return this;
}
@@ -508,36 +478,12 @@ public class ApplicationMode {
return getDefaultSpeed() > 10;
}
- public int getResourceBearingDay() {
- return bearingIconDay;
+ public NavigationIcon getNavigationIcon() {
+ return navigationIcon;
}
- public int getResourceBearingNight() {
- return bearingIconNight;
- }
-
- public int getResourceHeadingDay() {
- return headingIconDay;
- }
-
- public int getResourceHeadingNight() {
- return headingIconNight;
- }
-
- public int getResourceLocationDay() {
- return locationIconDay;
- }
-
- public int getResourceLocationNight() {
- return locationIconNight;
- }
-
- public int getResourceLocationDayLost() {
- return locationIconDayLost;
- }
-
- public int getResourceLocationNightLost() {
- return locationIconNightLost;
+ public LocationIcon getLocationIcon() {
+ return locationIcon;
}
public String getStringKey() {
@@ -548,7 +494,6 @@ public class ApplicationMode {
return keyName;
}
-
public String getCustomProfileName() {
return userProfileName;
}
@@ -619,12 +564,13 @@ public class ApplicationMode {
return routingProfile;
}
-
- @DrawableRes public int getIconRes() {
+ @DrawableRes
+ public int getIconRes() {
return iconRes;
}
- @DrawableRes public int getMapIconRes() {
+ @DrawableRes
+ public int getMapIconRes() {
return iconMapRes;
}
@@ -655,9 +601,9 @@ public class ApplicationMode {
}
private static void initDefaultSpeed(OsmandApplication app) {
- for(ApplicationMode m : values) {
+ for (ApplicationMode m : values) {
float spd = app.getSettings().DEFAULT_SPEED.getModeValue(m);
- if(spd > 0) {
+ if (spd > 0) {
m.defaultSpeed = spd;
}
}
@@ -693,6 +639,8 @@ public class ApplicationMode {
b.icon(app, mb.iconName);
b.setColor(mb.iconColor);
b.setOrder(mb.order);
+ b.locationIcon(mb.locationIcon);
+ b.navigationIcon(mb.navigationIcon);
return b;
}
@@ -705,6 +653,8 @@ public class ApplicationMode {
mb.stringKey = stringKey;
mb.routeService = routeService;
mb.routingProfile = routingProfile;
+ mb.locationIcon = locationIcon;
+ mb.navigationIcon = navigationIcon;
mb.order = order;
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
return gson.toJson(mb);
@@ -712,7 +662,8 @@ public class ApplicationMode {
private static void initDefaultModesParams(OsmandApplication app) {
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
- Type t = new TypeToken>() {}.getType();
+ Type t = new TypeToken>() {
+ }.getType();
List defaultAppModeBeans = gson.fromJson(app.getSettings().DEFAULT_APP_PROFILES.get(), t);
if (!Algorithms.isEmpty(defaultAppModeBeans)) {
@@ -724,15 +675,18 @@ public class ApplicationMode {
applicationMode.iconColor = modeBean.iconColor;
applicationMode.routingProfile = modeBean.routingProfile;
applicationMode.routeService = modeBean.routeService;
+ applicationMode.locationIcon = modeBean.locationIcon;
+ applicationMode.navigationIcon = modeBean.navigationIcon;
applicationMode.order = modeBean.order;
}
}
}
}
- private static void initCustomModes(OsmandApplication app){
+ private static void initCustomModes(OsmandApplication app) {
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
- Type t = new TypeToken>() {}.getType();
+ Type t = new TypeToken>() {
+ }.getType();
List customProfiles = gson.fromJson(app.getSettings().CUSTOM_APP_PROFILES.get(), t);
if (!Algorithms.isEmpty(customProfiles)) {
@@ -743,6 +697,8 @@ public class ApplicationMode {
.setRoutingProfile(m.routingProfile)
.icon(app, m.iconName)
.setColor(m.iconColor)
+ .locationIcon(m.locationIcon)
+ .navigationIcon(m.navigationIcon)
.setOrder(m.order)
.customReg();
}
@@ -787,9 +743,10 @@ public class ApplicationMode {
mb.routeService = mode.routeService;
mb.routingProfile = mode.routingProfile;
mb.order = mode.order;
+ mb.locationIcon = mode.locationIcon;
+ mb.navigationIcon = mode.navigationIcon;
modeBeans.add(mb);
}
-
return modeBeans;
}
@@ -804,13 +761,14 @@ public class ApplicationMode {
mode.routingProfile = builder.applicationMode.routingProfile;
mode.routeService = builder.applicationMode.routeService;
mode.iconColor = builder.applicationMode.iconColor;
+ mode.locationIcon = builder.applicationMode.locationIcon;
+ mode.navigationIcon = builder.applicationMode.navigationIcon;
mode.order = builder.applicationMode.order;
} else {
mode = builder.customReg();
initRegVisibility();
}
saveAppModesToSettings(app.getSettings(), mode.isCustomProfile());
-
return mode;
}
@@ -860,17 +818,20 @@ public class ApplicationMode {
}
public enum ProfileIconColors {
- DEFAULT(R.string.rendering_value_default_name, R.color.profile_icon_color_blue_light_default, R.color.profile_icon_color_blue_dark_default),
+ DEFAULT(R.string.rendering_value_default_name, R.color.profile_icon_color_blue_light_default, R.color.profile_icon_color_blue_dark_default),
PURPLE(R.string.rendering_value_purple_name, R.color.profile_icon_color_purple_light, R.color.profile_icon_color_purple_dark),
- GREEN(R.string.rendering_value_green_name, R.color.profile_icon_color_green_light, R.color.profile_icon_color_green_dark),
- BLUE(R.string.rendering_value_blue_name, R.color.profile_icon_color_blue_light, R.color.profile_icon_color_blue_dark),
+ GREEN(R.string.rendering_value_green_name, R.color.profile_icon_color_green_light, R.color.profile_icon_color_green_dark),
+ BLUE(R.string.rendering_value_blue_name, R.color.profile_icon_color_blue_light, R.color.profile_icon_color_blue_dark),
RED(R.string.rendering_value_red_name, R.color.profile_icon_color_red_light, R.color.profile_icon_color_red_dark),
DARK_YELLOW(R.string.rendering_value_darkyellow_name, R.color.profile_icon_color_yellow_light, R.color.profile_icon_color_yellow_dark),
MAGENTA(R.string.shared_string_color_magenta, R.color.profile_icon_color_magenta_light, R.color.profile_icon_color_magenta_dark);
- @StringRes private int name;
- @ColorRes private int dayColor;
- @ColorRes private int nightColor;
+ @StringRes
+ private int name;
+ @ColorRes
+ private int dayColor;
+ @ColorRes
+ private int nightColor;
ProfileIconColors(@StringRes int name, @ColorRes int dayColor, @ColorRes int nightColor) {
this.name = name;
@@ -888,6 +849,7 @@ public class ApplicationMode {
}
public enum ProfileIcons {
+ DEFAULT(R.drawable.ic_world_globe_dark, R.string.app_mode_default, "ic_world_globe_dark"),
CAR(R.drawable.ic_action_car_dark, R.string.app_mode_car, "ic_action_car_dark"),
TAXI(R.drawable.ic_action_taxi, R.string.app_mode_taxi, "ic_action_taxi"),
TRUCK(R.drawable.ic_action_truck_dark, R.string.app_mode_truck, "ic_action_truck_dark"),
@@ -912,7 +874,8 @@ public class ApplicationMode {
CAMPER(R.drawable.ic_action_camper, R.string.app_mode_camper, "ic_action_camper"),
PICKUP_TRUCK(R.drawable.ic_action_pickup_truck, R.string.app_mode_pickup_truck, "ic_action_pickup_truck"),
WAGON(R.drawable.ic_action_wagon, R.string.app_mode_wagon, "ic_action_wagon"),
- UTV(R.drawable.ic_action_utv, R.string.app_mode_utv, "ic_action_utv");
+ UTV(R.drawable.ic_action_utv, R.string.app_mode_utv, "ic_action_utv"),
+ OSM(R.drawable.ic_action_osmand_logo, R.string.app_mode_osm, "ic_action_osmand_logo");
@DrawableRes
private int resId;
@@ -952,7 +915,47 @@ public class ApplicationMode {
return pi.resStringId;
}
}
- return CAR.getResStringId();
+ return DEFAULT.getResStringId();
+ }
+ }
+
+ public enum LocationIcon {
+ DEFAULT(R.drawable.map_default_location_xml, R.drawable.map_default_location_view_angle),
+ CAR(R.drawable.map_car_location_xml, R.drawable.map_car_location_view_angle),
+ BICYCLE(R.drawable.map_bicycle_location_xml, R.drawable.map_bicycle_location_view_angle);
+
+ LocationIcon(@DrawableRes int iconId, @DrawableRes int headingIconId) {
+ this.iconId = iconId;
+ this.headingIconId = headingIconId;
+ }
+
+ @DrawableRes
+ private final int iconId;
+ @DrawableRes
+ private final int headingIconId;
+
+ public int getIconId() {
+ return iconId;
+ }
+
+ public int getHeadingIconId() {
+ return headingIconId;
+ }
+ }
+
+ public enum NavigationIcon {
+ CAR(R.drawable.map_car_navigation_xml),
+ NAUTICAL(R.drawable.map_nautical_navigation_xml);
+
+ NavigationIcon(@DrawableRes int iconId) {
+ this.iconId = iconId;
+ }
+
+ @DrawableRes
+ private final int iconId;
+
+ public int getIconId() {
+ return iconId;
}
}
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java
index 4ebcdbafca..19f48003c9 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java
@@ -154,7 +154,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter(ApplicationMode.allPossibleValues());
- allAppModes.remove(ApplicationMode.DEFAULT);
availableAppModes = new LinkedHashSet<>(ApplicationMode.values(getMyApplication()));
- availableAppModes.remove(ApplicationMode.DEFAULT);
Preference globalSettings = findPreference("global_settings");
globalSettings.setIcon(getContentIcon(R.drawable.ic_action_settings));
PreferenceCategory selectedProfile = (PreferenceCategory) findPreference(SELECTED_PROFILE);
diff --git a/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java
index d90ae9a914..48a420f268 100644
--- a/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java
@@ -4,13 +4,17 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
+import android.graphics.Matrix;
import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
+import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
@@ -60,14 +64,18 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
private static final String SELECT_ICON = "select_icon";
private static final String COLOR_ITEMS = "color_items";
private static final String ICON_ITEMS = "icon_items";
-// private static final String SELECT_MAP_ICON = "select_map_icon";
-// private static final String SELECT_NAV_ICON = "select_nav_icon";
+ private static final String SELECT_LOCATION_ICON = "select_location_icon";
+ private static final String LOCATION_ICON_ITEMS = "location_icon_items";
+ private static final String SELECT_NAV_ICON = "select_nav_icon";
+ private static final String NAV_ICON_ITEMS = "nav_icon_items";
public static final String PROFILE_NAME_KEY = "profile_name_key";
public static final String PROFILE_STRINGKEY_KEY = "profile_stringkey_key";
public static final String PROFILE_ICON_RES_KEY = "profile_icon_res_key";
public static final String PROFILE_COLOR_KEY = "profile_color_key";
public static final String PROFILE_PARENT_KEY = "profile_parent_key";
+ public static final String PROFILE_LOCATION_ICON_KEY = "profile_location_icon_key";
+ public static final String PROFILE_NAVIGATION_ICON_KEY = "profile_navigation_icon_key";
public static final String BASE_PROFILE_FOR_NEW = "base_profile_for_new";
private SelectProfileBottomSheetDialogFragment.SelectProfileListener parentProfileListener;
private EditText baseProfileName;
@@ -76,6 +84,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
private EditText profileName;
private FlowLayout colorItems;
private FlowLayout iconItems;
+ private FlowLayout locationIconItems;
+ private FlowLayout navIconItems;
private OsmandTextFieldBoxes profileNameOtfb;
private View saveButton;
@@ -102,6 +112,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
profile.iconRes = baseModeForNewProfile.getIconRes();
profile.routingProfile = baseModeForNewProfile.getRoutingProfile();
profile.routeService = baseModeForNewProfile.getRouteService();
+ profile.locationIcon = baseModeForNewProfile.getLocationIcon();
+ profile.navigationIcon = baseModeForNewProfile.getNavigationIcon();
} else {
profile.stringKey = getSelectedAppMode().getStringKey();
profile.parent = getSelectedAppMode().getParent();
@@ -110,6 +122,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
profile.iconRes = getSelectedAppMode().getIconRes();
profile.routingProfile = getSelectedAppMode().getRoutingProfile();
profile.routeService = getSelectedAppMode().getRouteService();
+ profile.locationIcon = getSelectedAppMode().getLocationIcon();
+ profile.navigationIcon = getSelectedAppMode().getNavigationIcon();
}
changedProfile = new ApplicationProfileObject();
if (savedInstanceState != null) {
@@ -126,6 +140,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
changedProfile.iconRes = profile.iconRes;
changedProfile.routingProfile = profile.routingProfile;
changedProfile.routeService = profile.routeService;
+ changedProfile.locationIcon = profile.locationIcon;
+ changedProfile.navigationIcon = profile.navigationIcon;
}
}
@@ -166,8 +182,12 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
protected void setupPreferences() {
findPreference(SELECT_COLOR).setIconSpaceReserved(false);
findPreference(SELECT_ICON).setIconSpaceReserved(false);
-// findPreference(SELECT_MAP_ICON).setIconSpaceReserved(false);
-// findPreference(SELECT_NAV_ICON).setIconSpaceReserved(false);
+ findPreference(SELECT_LOCATION_ICON).setIconSpaceReserved(false);
+ findPreference(SELECT_NAV_ICON).setIconSpaceReserved(false);
+ if (getSelectedAppMode().equals(ApplicationMode.DEFAULT)) {
+ findPreference(SELECT_ICON).setVisible(false);
+ findPreference(ICON_ITEMS).setVisible(false);
+ }
}
@SuppressLint("InlinedApi")
@@ -249,6 +269,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (changedProfile.parent != null) {
outState.putString(PROFILE_PARENT_KEY, changedProfile.parent.getStringKey());
}
+ outState.putSerializable(PROFILE_LOCATION_ICON_KEY, changedProfile.locationIcon);
+ outState.putSerializable(PROFILE_NAVIGATION_ICON_KEY, changedProfile.navigationIcon);
}
private void restoreState(Bundle savedInstanceState) {
@@ -258,6 +280,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
changedProfile.color = (ApplicationMode.ProfileIconColors) savedInstanceState.getSerializable(PROFILE_COLOR_KEY);
String parentStringKey = savedInstanceState.getString(PROFILE_PARENT_KEY);
changedProfile.parent = ApplicationMode.valueOfStringKey(parentStringKey, null);
+ changedProfile.locationIcon = (ApplicationMode.LocationIcon) savedInstanceState.getSerializable(PROFILE_LOCATION_ICON_KEY);
+ changedProfile.navigationIcon = (ApplicationMode.NavigationIcon) savedInstanceState.getSerializable(PROFILE_NAVIGATION_ICON_KEY);
}
@Override
@@ -278,11 +302,6 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
}
}
- @Override
- protected void updatePreference(Preference preference) {
- super.updatePreference(preference);
- }
-
@Override
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {
super.onBindPreferenceViewHolder(preference, holder);
@@ -312,6 +331,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
}
}
});
+ if (getSelectedAppMode().equals(ApplicationMode.DEFAULT)) {
+ profileName.setFocusable(false);
+ }
profileNameOtfb = (OsmandTextFieldBoxes) holder.findViewById(R.id.profile_name_otfb);
} else if (MASTER_PROFILE.equals(preference.getKey())) {
baseProfileName = (EditText) holder.findViewById(R.id.master_profile_et);
@@ -347,16 +369,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
for (ApplicationMode.ProfileIconColors color : ApplicationMode.ProfileIconColors.values()) {
View colorItem = createColorItemView(color, colorItems);
colorItems.addView(colorItem, new FlowLayout.LayoutParams(0, 0));
- ImageView outlineCircle = colorItem.findViewById(R.id.outlineCircle);
- ImageView checkMark = colorItem.findViewById(R.id.checkMark);
- GradientDrawable gradientDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.circle_contour_bg_light);
- if (gradientDrawable != null) {
- gradientDrawable.setStroke(AndroidUtils.dpToPx(app, 2),
- UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, color.getColor(isNightMode())), 0.3f));
- outlineCircle.setImageDrawable(gradientDrawable);
- }
- checkMark.setVisibility(View.GONE);
- outlineCircle.setVisibility(View.GONE);
+
}
updateColorSelector(changedProfile.color);
} else if (ICON_ITEMS.equals(preference.getKey())) {
@@ -366,10 +379,24 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
for (int iconRes : icons) {
View iconItem = createIconItemView(iconRes, iconItems);
iconItems.addView(iconItem, new FlowLayout.LayoutParams(0, 0));
- ImageView outlineCircle = iconItem.findViewById(R.id.outlineCircle);
- outlineCircle.setVisibility(View.GONE);
}
setIconNewColor(changedProfile.iconRes);
+ } else if (LOCATION_ICON_ITEMS.equals(preference.getKey())) {
+ locationIconItems = (FlowLayout) holder.findViewById(R.id.color_items);
+ locationIconItems.removeAllViews();
+ for (ApplicationMode.LocationIcon locationIcon : ApplicationMode.LocationIcon.values()) {
+ View iconItemView = createLocationIconView(locationIcon, locationIconItems);
+ locationIconItems.addView(iconItemView, new FlowLayout.LayoutParams(0, 0));
+ }
+ updateLocationIconSelector(changedProfile.locationIcon);
+ } else if (NAV_ICON_ITEMS.equals(preference.getKey())) {
+ navIconItems = (FlowLayout) holder.findViewById(R.id.color_items);
+ navIconItems.removeAllViews();
+ for (ApplicationMode.NavigationIcon navigationIcon : ApplicationMode.NavigationIcon.values()) {
+ View iconItemView = createNavigationIconView(navigationIcon, navIconItems);
+ navIconItems.addView(iconItemView, new FlowLayout.LayoutParams(0, 0));
+ }
+ updateNavigationIconSelector(changedProfile.navigationIcon);
}
}
@@ -385,9 +412,23 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
public void onClick(View v) {
if (colorRes != changedProfile.color) {
updateColorSelector(colorRes);
+ updatePreference(findPreference(MASTER_PROFILE));
+ updatePreference(findPreference(LOCATION_ICON_ITEMS));
+ updatePreference(findPreference(NAV_ICON_ITEMS));
}
}
});
+
+ ImageView outlineCircle = colorItemView.findViewById(R.id.outlineCircle);
+ ImageView checkMark = colorItemView.findViewById(R.id.checkMark);
+ GradientDrawable gradientDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.circle_contour_bg_light);
+ if (gradientDrawable != null) {
+ gradientDrawable.setStroke(AndroidUtils.dpToPx(app, 2),
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, colorRes.getColor(isNightMode())), 0.3f));
+ outlineCircle.setImageDrawable(gradientDrawable);
+ }
+ checkMark.setVisibility(View.GONE);
+ outlineCircle.setVisibility(View.GONE);
colorItemView.setTag(colorRes);
return colorItemView;
}
@@ -403,8 +444,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (iconItems != null) {
setIconNewColor(changedProfile.iconRes);
}
- int selectedColor = ContextCompat.getColor(app,
- changedProfile.color.getColor(isNightMode()));
+ int selectedColor = ContextCompat.getColor(app, changedProfile.color.getColor(isNightMode()));
profileNameOtfb.setPrimaryColor(selectedColor);
profileName.getBackground().mutate().setColorFilter(selectedColor, PorterDuff.Mode.SRC_ATOP);
updateProfileButton();
@@ -427,6 +467,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
}
}
});
+ iconItemView.findViewById(R.id.outlineCircle).setVisibility(View.GONE);
iconItemView.setTag(iconRes);
return iconItemView;
}
@@ -439,11 +480,99 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
checkMark.setImageDrawable(app.getUIUtilities().getIcon(changedProfile.iconRes, R.color.icon_color_default_light));
AndroidUtils.setBackground(iconItem.findViewById(R.id.backgroundCircle),
UiUtilities.tintDrawable(ContextCompat.getDrawable(app, R.drawable.circle_background_light),
- UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
changedProfile.iconRes = iconRes;
updateProfileButton();
}
+ private View createLocationIconView(final ApplicationMode.LocationIcon locationIcon, ViewGroup rootView) {
+ FrameLayout locationIconView = (FrameLayout) UiUtilities.getInflater(getContext(), isNightMode())
+ .inflate(R.layout.preference_select_icon_button, rootView, false);
+ int changedProfileColor = ContextCompat.getColor(app, changedProfile.color.getColor(
+ app.getDaynightHelper().isNightModeForMapControls()));
+ LayerDrawable locationIconDrawable = (LayerDrawable) app.getResources().getDrawable(locationIcon.getIconId());
+ DrawableCompat.setTint(DrawableCompat.wrap(locationIconDrawable.getDrawable(1)), changedProfileColor);
+ locationIconView.findViewById(R.id.icon).setImageDrawable(locationIconDrawable);
+ ImageView headingIcon = locationIconView.findViewById(R.id.headingIcon);
+ headingIcon.setImageDrawable(ContextCompat.getDrawable(app, locationIcon.getHeadingIconId()));
+ headingIcon.setColorFilter(new PorterDuffColorFilter(changedProfileColor, PorterDuff.Mode.SRC_IN));
+ ImageView coloredRect = locationIconView.findViewById(R.id.backgroundRect);
+ AndroidUtils.setBackground(coloredRect,
+ UiUtilities.tintDrawable(ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button),
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
+ coloredRect.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (locationIcon != changedProfile.locationIcon) {
+ updateLocationIconSelector(locationIcon);
+ }
+ }
+ });
+ ImageView outlineRect = locationIconView.findViewById(R.id.outlineRect);
+ GradientDrawable rectContourDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button_outline);
+ if (rectContourDrawable != null) {
+ rectContourDrawable.setStroke(AndroidUtils.dpToPx(app, 2), changedProfileColor);
+ }
+ outlineRect.setImageDrawable(rectContourDrawable);
+ outlineRect.setVisibility(View.GONE);
+ locationIconView.setTag(locationIcon);
+ return locationIconView;
+ }
+
+ private void updateLocationIconSelector(ApplicationMode.LocationIcon locationIcon) {
+ View viewWithTag = locationIconItems.findViewWithTag(changedProfile.locationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.GONE);
+ viewWithTag = locationIconItems.findViewWithTag(locationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.VISIBLE);
+ changedProfile.locationIcon = locationIcon;
+ }
+
+ private View createNavigationIconView(final ApplicationMode.NavigationIcon navigationIcon, ViewGroup rootView) {
+ FrameLayout navigationIconView = (FrameLayout) UiUtilities.getInflater(getContext(), isNightMode())
+ .inflate(R.layout.preference_select_icon_button, rootView, false);
+ LayerDrawable navigationIconDrawable = (LayerDrawable) app.getResources().getDrawable(navigationIcon.getIconId());
+ DrawableCompat.setTint(DrawableCompat.wrap(navigationIconDrawable.getDrawable(1)),
+ ContextCompat.getColor(app, changedProfile.color.getColor(app.getDaynightHelper().isNightModeForMapControls())));
+ ImageView imageView = navigationIconView.findViewById(R.id.icon);
+ imageView.setImageDrawable(navigationIconDrawable);
+ Matrix matrix = new Matrix();
+ imageView.setScaleType(ImageView.ScaleType.MATRIX);
+ matrix.postRotate((float) -90, imageView.getDrawable().getIntrinsicWidth() / 2,
+ imageView.getDrawable().getIntrinsicHeight() / 2);
+ imageView.setImageMatrix(matrix);
+ ImageView coloredRect = navigationIconView.findViewById(R.id.backgroundRect);
+ AndroidUtils.setBackground(coloredRect,
+ UiUtilities.tintDrawable(ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button),
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
+ coloredRect.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (navigationIcon != changedProfile.navigationIcon) {
+ updateNavigationIconSelector(navigationIcon);
+ }
+ }
+ });
+ ImageView outlineRect = navigationIconView.findViewById(R.id.outlineRect);
+ GradientDrawable rectContourDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button_outline);
+ int changedProfileColor = ContextCompat.getColor(app, changedProfile.color.getColor(
+ app.getDaynightHelper().isNightModeForMapControls()));
+ if (rectContourDrawable != null) {
+ rectContourDrawable.setStroke(AndroidUtils.dpToPx(app, 2), changedProfileColor);
+ }
+ outlineRect.setImageDrawable(rectContourDrawable);
+ outlineRect.setVisibility(View.GONE);
+ navigationIconView.setTag(navigationIcon);
+ return navigationIconView;
+ }
+
+ private void updateNavigationIconSelector(ApplicationMode.NavigationIcon navigationIcon) {
+ View viewWithTag = navIconItems.findViewWithTag(changedProfile.navigationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.GONE);
+ viewWithTag = navIconItems.findViewWithTag(navigationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.VISIBLE);
+ changedProfile.navigationIcon = navigationIcon;
+ }
+
private void setIconNewColor(int iconRes) {
int changedProfileColor = ContextCompat.getColor(app, changedProfile.color.getColor(
app.getDaynightHelper().isNightModeForMapControls()));
@@ -517,7 +646,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
.icon(app, ApplicationMode.ProfileIcons.getResStringByResId(changedProfile.iconRes))
.setRouteService(changedProfile.routeService)
.setRoutingProfile(changedProfile.routingProfile)
- .setColor(changedProfile.color);
+ .setColor(changedProfile.color)
+ .locationIcon(changedProfile.locationIcon)
+ .navigationIcon(changedProfile.navigationIcon);
ApplicationMode mode = ApplicationMode.saveProfile(builder, getMyApplication());
if (!ApplicationMode.values(app).contains(mode)) {
@@ -594,6 +725,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
int iconRes;
String routingProfile;
RouteProvider.RouteService routeService;
+ ApplicationMode.NavigationIcon navigationIcon;
+ ApplicationMode.LocationIcon locationIcon;
@Override
public boolean equals(Object o) {
@@ -610,7 +743,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (color != that.color) return false;
if (routingProfile != null ? !routingProfile.equals(that.routingProfile) : that.routingProfile != null)
return false;
- return routeService == that.routeService;
+ if (routeService != that.routeService) return false;
+ if (navigationIcon != that.navigationIcon) return false;
+ return locationIcon == that.locationIcon;
}
@Override
@@ -622,6 +757,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
result = 31 * result + iconRes;
result = 31 * result + (routingProfile != null ? routingProfile.hashCode() : 0);
result = 31 * result + (routeService != null ? routeService.hashCode() : 0);
+ result = 31 * result + (navigationIcon != null ? navigationIcon.hashCode() : 0);
+ result = 31 * result + (locationIcon != null ? locationIcon.hashCode() : 0);
return result;
}
}
diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java
index 461a1a1410..e412378fc3 100644
--- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java
@@ -176,7 +176,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
paintIcon = new Paint();
pointSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_white_shield_small);
- selectedPoint = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_default_location);
+ selectedPoint = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_default_location_xml);
contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);
diff --git a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
index 01f73e39a3..f505e51639 100644
--- a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
@@ -1,13 +1,17 @@
package net.osmand.plus.views;
-
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.PointF;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
import android.graphics.RectF;
+import android.graphics.drawable.LayerDrawable;
+import android.support.v4.content.ContextCompat;
+import android.support.v4.graphics.drawable.DrawableCompat;
import net.osmand.Location;
import net.osmand.PlatformUtil;
@@ -17,28 +21,32 @@ import net.osmand.data.RotatedTileBox;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
import net.osmand.plus.base.MapViewTrackingUtilities;
import org.apache.commons.logging.Log;
import java.util.List;
+import static android.graphics.Paint.ANTI_ALIAS_FLAG;
+import static android.graphics.Paint.FILTER_BITMAP_FLAG;
+
public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {
private static final Log LOG = PlatformUtil.getLog(PointLocationLayer.class);
-
protected final static int RADIUS = 7;
- private Paint locationPaint;
+ private Paint headingPaint;
private Paint area;
private Paint aroundArea;
private OsmandMapTileView view;
private ApplicationMode appMode;
- private Bitmap bearingIcon;
+ private int colorId;
+ private LayerDrawable navigationIcon;
+ private LayerDrawable locationIcon;
private Bitmap headingIcon;
- private Bitmap locationIcon;
private OsmAndLocationProvider locationProvider;
private MapViewTrackingUtilities mapViewTrackingUtilities;
private boolean nm;
@@ -49,19 +57,12 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
}
private void initUI() {
- locationPaint = new Paint();
- locationPaint.setAntiAlias(true);
- locationPaint.setFilterBitmap(true);
-
+ headingPaint = new Paint(ANTI_ALIAS_FLAG | FILTER_BITMAP_FLAG);
area = new Paint();
- area.setColor(view.getResources().getColor(R.color.pos_area));
-
aroundArea = new Paint();
- aroundArea.setColor(view.getResources().getColor(R.color.pos_around));
aroundArea.setStyle(Style.STROKE);
aroundArea.setStrokeWidth(1);
aroundArea.setAntiAlias(true);
-
locationProvider = view.getApplication().getLocationProvider();
updateIcons(view.getSettings().getApplicationMode(), false, locationProvider.getLastKnownLocation() == null);
}
@@ -115,73 +116,66 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
Float heading = locationProvider.getHeading();
if (!locationOutdated && heading != null && mapViewTrackingUtilities.isShowViewAngle()) {
-
canvas.save();
canvas.rotate(heading - 180, locationX, locationY);
canvas.drawBitmap(headingIcon, locationX - headingIcon.getWidth() / 2,
- locationY - headingIcon.getHeight() / 2, locationPaint);
+ locationY - headingIcon.getHeight() / 2, headingPaint);
canvas.restore();
-
}
// Issue 5538: Some devices return positives for hasBearing() at rest, hence add 0.0 check:
boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0);
if (!locationOutdated && isBearing) {
float bearing = lastKnownLocation.getBearing();
canvas.rotate(bearing - 90, locationX, locationY);
- canvas.drawBitmap(bearingIcon, locationX - bearingIcon.getWidth() / 2,
- locationY - bearingIcon.getHeight() / 2, locationPaint);
+ navigationIcon.setBounds(locationX - navigationIcon.getIntrinsicWidth() / 2,
+ locationY - navigationIcon.getIntrinsicHeight() / 2,
+ locationX + navigationIcon.getIntrinsicWidth() / 2,
+ locationY + navigationIcon.getIntrinsicHeight() / 2);
+ navigationIcon.draw(canvas);
} else {
- canvas.drawBitmap(locationIcon, locationX - locationIcon.getWidth() / 2,
- locationY - locationIcon.getHeight() / 2, locationPaint);
+ locationIcon.setBounds(locationX - locationIcon.getIntrinsicWidth() / 2,
+ locationY - locationIcon.getIntrinsicHeight() / 2,
+ locationX + locationIcon.getIntrinsicWidth() / 2,
+ locationY + locationIcon.getIntrinsicHeight() / 2);
+ locationIcon.draw(canvas);
}
-
}
}
- public boolean isLocationVisible(RotatedTileBox tb, Location l) {
+ private boolean isLocationVisible(RotatedTileBox tb, Location l) {
return l != null && tb.containsLatLon(l.getLatitude(), l.getLongitude());
}
-
@Override
public void destroyLayer() {
-
}
- public void updateIcons(ApplicationMode appMode, boolean nighMode, boolean locationOutdated) {
- if (appMode != this.appMode || this.nm != nighMode || this.locationOutdated != locationOutdated) {
+
+ private void updateIcons(ApplicationMode appMode, boolean nighMode, boolean locationOutdated) {
+ if (appMode != this.appMode || this.nm != nighMode || this.locationOutdated != locationOutdated
+ || colorId != appMode.getIconColorInfo().getColor(nighMode)
+ || locationIcon != view.getResources().getDrawable(appMode.getLocationIcon().getIconId())
+ || navigationIcon != view.getResources().getDrawable(appMode.getNavigationIcon().getIconId())) {
this.appMode = appMode;
+ this.colorId = appMode.getIconColorInfo().getColor(nighMode);
this.nm = nighMode;
this.locationOutdated = locationOutdated;
- final int resourceBearingDay = appMode.getResourceBearingDay();
- final int resourceBearingNight = appMode.getResourceBearingNight();
- final int resourceBearing = nighMode ? resourceBearingNight : resourceBearingDay;
- bearingIcon = BitmapFactory.decodeResource(view.getResources(), resourceBearing);
-
- final int resourceHeadingDay = appMode.getResourceHeadingDay();
- final int resourceHeadingNight = appMode.getResourceHeadingNight();
- final int resourceHeading = nighMode ? resourceHeadingNight : resourceHeadingDay;
- headingIcon = BitmapFactory.decodeResource(view.getResources(), resourceHeading);
-
- final int resourceLocationDay;
- final int resourceLocationNight;
- if (locationOutdated) {
- resourceLocationDay = appMode.getResourceLocationDayLost();
- resourceLocationNight = appMode.getResourceLocationNightLost();
- } else {
- resourceLocationDay = appMode.getResourceLocationDay();
- resourceLocationNight = appMode.getResourceLocationNight();
- }
- final int resourceLocation = nighMode ? resourceLocationNight : resourceLocationDay;
- locationIcon = BitmapFactory.decodeResource(view.getResources(), resourceLocation);
- area.setColor(view.getResources().getColor(!nm ? R.color.pos_area : R.color.pos_area_night));
+ int color = ContextCompat.getColor(view.getContext(), colorId);
+ navigationIcon = (LayerDrawable) view.getResources().getDrawable(appMode.getNavigationIcon().getIconId());
+ DrawableCompat.setTint(navigationIcon.getDrawable(1), color);
+ headingIcon = BitmapFactory.decodeResource(view.getResources(), appMode.getLocationIcon().getHeadingIconId());
+ headingPaint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
+ locationIcon = (LayerDrawable) view.getResources().getDrawable(appMode.getLocationIcon().getIconId());
+ DrawableCompat.setTint(DrawableCompat.wrap(locationIcon.getDrawable(1)), color);
+ area.setColor(UiUtilities.getColorWithAlpha(color, 0.16f));
+ aroundArea.setColor(color);
}
}
+
@Override
public boolean drawInScreenPixels() {
return false;
}
-
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List