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

Add new quest for parking fee #825

Merged
merged 6 commits into from
Feb 6, 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 @@ -22,6 +22,7 @@
import de.westnordost.streetcomplete.quests.diet_type.AddVegetarian;
import de.westnordost.streetcomplete.quests.fire_hydrant.AddFireHydrantType;
import de.westnordost.streetcomplete.quests.internet_access.AddInternetAccess;
import de.westnordost.streetcomplete.quests.parking_fee.AddParkingFee;
import de.westnordost.streetcomplete.quests.parking_type.AddParkingType;
import de.westnordost.streetcomplete.quests.powerpoles_material.AddPowerPolesMaterial;
import de.westnordost.streetcomplete.quests.orchard_produce.AddOrchardProduce;
Expand Down Expand Up @@ -79,6 +80,7 @@ public class QuestModule
new AddVegetarian(o),
new AddVegan(o),
new AddInternetAccess(o),
new AddParkingFee(o),

// ↓ 4. definitely shown as errors in QA tools

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This quest was generated by the StreetComplete QuestCreator (https://github.com/ENT8R/StreetCompleteQuestCreator)
*/

package de.westnordost.streetcomplete.quests.parking_fee;

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 AddParkingFee extends SimpleOverpassQuestType
{
@Inject public AddParkingFee(OverpassMapDataDao overpassServer) { super(overpassServer); }

@Override protected String getTagFilters() { return "nodes, ways with amenity=parking and access ~ yes|customers|public and !fee"; }

public AbstractQuestAnswerFragment createForm() { return new YesNoQuestAnswerFragment(); }

public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes)
{
String yesno = answer.getBoolean(YesNoQuestAnswerFragment.ANSWER) ? "yes" : "no";
changes.add("fee", yesno);
}

@Override public String getCommitMessage() { return "Add whether there is a parking fee"; }
@Override public int getIcon() { return R.drawable.ic_quest_parking_fee; }
@Override public int getTitle(@NonNull Map<String, String> tags) { return R.string.quest_parking_fee_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 @@ -478,4 +478,5 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards
<string name="quest_religion_caodaist">Caodaism</string>
<string name="quest_religion_chinese_folk">Chinese folk religion</string>
<string name="quest_religion_for_wayside_shrine_title">What religion is represented at this shrine?</string>
<string name="quest_parking_fee_title">Is there a fee to park here?</string>
</resources>