From 96f4a5c08fac4f884f04a9e74222bc621e85bd37 Mon Sep 17 00:00:00 2001 From: Kshitij Bhardwaj <44129798+kbhardwaj123@users.noreply.github.com> Date: Wed, 19 Feb 2020 13:43:19 -0500 Subject: [PATCH] Fixes #3355 : Do not display pins at all when "Needs Photo" is selected (#3407) * ic_custom_greyed_out_marker: removing grey marker * NearbyParentFragment: changing function name and description * change method name to hideAllMarkers --- .../nearby/fragments/NearbyParentFragment.java | 15 +++++++++------ .../res/drawable/ic_custom_greyed_out_marker.xml | 12 ++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java index e88be2626..c823fc05a 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java @@ -1050,7 +1050,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment @Override public void filterOutAllMarkers() { - greyOutAllMarkers(); + hideAllMArkers(); } /** @@ -1077,7 +1077,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment boolean filterForPlaceState, boolean filterForAllNoneType) { if (selectedLabels.size() == 0 && filterForPlaceState) { // If nothing is selected, display all - greyOutAllMarkers(); + // remove the previous markers before updating them + hideAllMArkers(); for (MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) { if (displayExists && displayNeedsPhoto) { // Exists and needs photo @@ -1101,8 +1102,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment } } else { - // First greyed out all markers - greyOutAllMarkers(); + // First remove all the markers + hideAllMArkers(); for (MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) { for (Label label : selectedLabels) { if (markerPlaceGroup.getPlace().getLabel().toString().equals(label.toString())) { @@ -1186,9 +1187,11 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment } /** - * Greys out all markers except current location marker + * Removes all markers except current location marker, an icon has been used + * but it is transparent more than grey(as the name of the icon might suggest) + * since grey icon may lead the users to believe that it is disabled or prohibited contribution */ - private void greyOutAllMarkers() { + private void hideAllMArkers() { if(currentLocationMarker==null){ return; } diff --git a/app/src/main/res/drawable/ic_custom_greyed_out_marker.xml b/app/src/main/res/drawable/ic_custom_greyed_out_marker.xml index 70521cbe9..e57db5f0c 100644 --- a/app/src/main/res/drawable/ic_custom_greyed_out_marker.xml +++ b/app/src/main/res/drawable/ic_custom_greyed_out_marker.xml @@ -4,20 +4,20 @@ android:viewportWidth="24.0" android:viewportHeight="28.0"> + android:strokeWidth="0.001" />