Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddPlaygroundAccess [finished, ready for merging] #1134

Merged
merged 1 commit into from
Jul 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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;

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<String, String> tags)
{
return R.string.quest_playground_access_title;
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -609,5 +609,6 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards
<string name="quest_address_answer_no_housenumber_message2">Is this correct and is it not just part of a building?</string>

<string name="notification_channel_download">"Download"</string>
<string name="quest_playground_access_title">Is this playground publicly accessible?</string>

</resources>