diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.java b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.java index aecf58b865e..3fc769ea868 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.java +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.java @@ -34,6 +34,7 @@ import de.westnordost.streetcomplete.quests.parking_access.AddParkingAccess; import de.westnordost.streetcomplete.quests.parking_fee.AddParkingFee; import de.westnordost.streetcomplete.quests.parking_type.AddParkingType; +import de.westnordost.streetcomplete.quests.playground_access.AddPlaygroundAccess; import de.westnordost.streetcomplete.quests.postbox_collection_times.AddPostboxCollectionTimes; import de.westnordost.streetcomplete.quests.powerpoles_material.AddPowerPolesMaterial; import de.westnordost.streetcomplete.quests.orchard_produce.AddOrchardProduce; @@ -102,6 +103,7 @@ public class QuestModule new AddParkingFee(o), new AddBusStopName(o), new AddPathSurface(o), + new AddPlaygroundAccess(o), //late as in many areas all needed access=private is already mapped // ↓ 4. definitely shown as errors in QA tools diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/playground_access/AddPlaygroundAccess.java b/app/src/main/java/de/westnordost/streetcomplete/quests/playground_access/AddPlaygroundAccess.java new file mode 100644 index 00000000000..b10158af679 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/playground_access/AddPlaygroundAccess.java @@ -0,0 +1,46 @@ +package de.westnordost.streetcomplete.quests.playground_access; + +import android.os.Bundle; +import android.support.annotation.NonNull; + +import java.util.Map; + +import javax.inject.Inject; + +import de.westnordost.streetcomplete.R; +import de.westnordost.streetcomplete.data.osm.SimpleOverpassQuestType; +import de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder; +import de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao; +import de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment; +import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment; +import de.westnordost.streetcomplete.quests.parking_access.AddParkingAccessForm; + +public class AddPlaygroundAccess extends SimpleOverpassQuestType +{ + @Inject public AddPlaygroundAccess(OverpassMapDataDao overpassServer) { super(overpassServer); } + + @Override protected String getTagFilters() + { + return "nodes, ways, relations with leisure=playground and (!access or access=unknown)"; + } + + public AbstractQuestAnswerFragment createForm() + { + return new YesNoQuestAnswerFragment(); + } + + public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes) + { + if(answer.getBoolean(YesNoQuestAnswerFragment.ANSWER)){ + changes.add("access", "yes"); + } else { + changes.add("access", "private"); + } + } + @Override public String getCommitMessage() { return "Add playground access"; } + @Override public int getIcon() { return R.drawable.ic_quest_playground; } + @Override public int getTitle(@NonNull Map tags) + { + return R.string.quest_playground_access_title; + } +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5bf6558b813..70bd12acf9f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -609,5 +609,6 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards Is this correct and is it not just part of a building? "Download" + Is this playground publicly accessible?