Skip to content

Commit 96f4a5c

Browse files
authored
Fixes commons-app#3355 : Do not display pins at all when "Needs Photo" is selected (commons-app#3407)
* ic_custom_greyed_out_marker: removing grey marker * NearbyParentFragment: changing function name and description * change method name to hideAllMarkers
1 parent af97e40 commit 96f4a5c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ public void updateMapMarkers(List<NearbyBaseMarker> nearbyBaseMarkers, Marker se
10501050

10511051
@Override
10521052
public void filterOutAllMarkers() {
1053-
greyOutAllMarkers();
1053+
hideAllMArkers();
10541054
}
10551055

10561056
/**
@@ -1077,7 +1077,8 @@ public void filterMarkersByLabels(List<Label> selectedLabels, boolean displayExi
10771077
boolean filterForPlaceState,
10781078
boolean filterForAllNoneType) {
10791079
if (selectedLabels.size() == 0 && filterForPlaceState) { // If nothing is selected, display all
1080-
greyOutAllMarkers();
1080+
// remove the previous markers before updating them
1081+
hideAllMArkers();
10811082
for (MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) {
10821083
if (displayExists && displayNeedsPhoto) {
10831084
// Exists and needs photo
@@ -1101,8 +1102,8 @@ public void filterMarkersByLabels(List<Label> selectedLabels, boolean displayExi
11011102

11021103
}
11031104
} else {
1104-
// First greyed out all markers
1105-
greyOutAllMarkers();
1105+
// First remove all the markers
1106+
hideAllMArkers();
11061107
for (MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) {
11071108
for (Label label : selectedLabels) {
11081109
if (markerPlaceGroup.getPlace().getLabel().toString().equals(label.toString())) {
@@ -1186,9 +1187,11 @@ public void updateMarker(boolean isBookmarked, Place place, @Nullable fr.free.nr
11861187
}
11871188

11881189
/**
1189-
* Greys out all markers except current location marker
1190+
* Removes all markers except current location marker, an icon has been used
1191+
* but it is transparent more than grey(as the name of the icon might suggest)
1192+
* since grey icon may lead the users to believe that it is disabled or prohibited contribution
11901193
*/
1191-
private void greyOutAllMarkers() {
1194+
private void hideAllMArkers() {
11921195
if(currentLocationMarker==null){
11931196
return;
11941197
}

app/src/main/res/drawable/ic_custom_greyed_out_marker.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
android:viewportWidth="24.0"
55
android:viewportHeight="28.0">
66
<path
7-
android:fillAlpha="0.1"
7+
android:fillAlpha="0.01"
88
android:fillColor="#48000000"
99
android:pathData="M6.072,22.223a6.031,3.672 0,1 0,12.062 0a6.031,3.672 0,1 0,-12.062 0z"
1010
android:strokeWidth="1" />
1111
<path
12-
android:fillAlpha="1"
13-
android:fillColor="#4D000000"
12+
android:fillAlpha="0.01"
13+
android:fillColor="#48000000"
1414
android:pathData="M11.575,11.62C10.689,11.462 9.902,10.759 9.625,9.878 9.553,9.65 9.535,9.499 9.538,9.14c0.004,-0.397 0.019,-0.492 0.13,-0.787 0.236,-0.631 0.646,-1.099 1.212,-1.382 0.386,-0.193 0.709,-0.272 1.116,-0.272 0.676,0 1.263,0.247 1.744,0.734 0.355,0.359 0.541,0.682 0.657,1.136 0.327,1.278 -0.442,2.611 -1.723,2.987 -0.282,0.083 -0.817,0.114 -1.099,0.063z"
1515
android:strokeWidth="1" />
1616
<path
17-
android:fillAlpha="1"
18-
android:fillColor="#7CE4E0D9"
17+
android:fillAlpha="0.01"
18+
android:fillColor="#48000000"
1919
android:pathData="M11.617,21.707C10.518,20.424 9.338,18.864 8.395,17.449 6.524,14.641 5.455,12.305 5.102,10.255 5.014,9.744 5.006,8.628 5.088,8.137 5.348,6.561 6.043,5.221 7.158,4.148 9.148,2.231 12.016,1.668 14.593,2.688c2.043,0.809 3.607,2.581 4.162,4.719 0.174,0.67 0.204,0.933 0.203,1.761 -0.001,0.81 -0.035,1.098 -0.22,1.857 -0.614,2.524 -2.571,5.977 -5.383,9.501 -0.645,0.809 -1.321,1.61 -1.358,1.61 -0.008,0 -0.179,-0.193 -0.381,-0.428zM12.617,11.603c0.783,-0.188 1.457,-0.795 1.738,-1.564 0.516,-1.415 -0.317,-2.962 -1.783,-3.312 -0.216,-0.052 -0.317,-0.059 -0.661,-0.047 -0.354,0.012 -0.441,0.025 -0.682,0.104 -0.673,0.221 -1.205,0.695 -1.506,1.344 -0.176,0.38 -0.218,0.584 -0.217,1.054 0.001,0.324 0.014,0.452 0.064,0.635 0.266,0.97 1.077,1.689 2.079,1.844 0.243,0.038 0.68,0.012 0.968,-0.057z"
2020
android:strokeAlpha="1"
2121
android:strokeColor="#54003B59"
22-
android:strokeWidth="1" />
22+
android:strokeWidth="0.001" />
2323
</vector>

0 commit comments

Comments
 (0)