Skip to content

Commit

Permalink
Merge pull request #404 from krzyk/362
Browse files Browse the repository at this point in the history
#362 Added fire hydrant type quest
  • Loading branch information
westnordost authored Jul 18, 2017
2 parents fdcc320 + 8cb481d commit 9efbacd
Show file tree
Hide file tree
Showing 25 changed files with 319 additions and 14 deletions.
Binary file modified app/src/main/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/src/main/assets/streetcomplete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ textures:
ferry: [1152,384,192,192]
fuel: [1344,384,192,192]
parking_maxstay: [1536,384,192,192]
fire_hydrant_type: [1728,384,192,192]
# 4th row
street: [0,576,192,192]
max_width: [192,576,192,192]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import de.westnordost.streetcomplete.quests.bike_parking_cover.AddBikeParkingCover;
import de.westnordost.streetcomplete.quests.building_levels.AddBuildingLevels;
import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter;
import de.westnordost.streetcomplete.quests.fire_hydrant.AddFireHydrantType;
import de.westnordost.streetcomplete.quests.recycling.AddRecyclingType;
import de.westnordost.streetcomplete.quests.tactile_paving.AddTactilePavingBusStop;
import de.westnordost.streetcomplete.quests.tactile_paving.AddTactilePavingCrosswalk;
Expand Down Expand Up @@ -43,6 +44,7 @@ public class QuestModule
new AddBusStopShelter(o),
new AddToiletsFee(o),
new AddBabyChangingTable(o),
new AddFireHydrantType(o),
new AddHousenumber(o),
new AddBikeParkingCapacity(o),
new AddSport(o),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package de.westnordost.streetcomplete.quests.fire_hydrant;

import android.os.Bundle;

import java.util.List;

import javax.inject.Inject;

import de.westnordost.streetcomplete.data.QuestImportance;
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;

public class AddFireHydrantType extends SimpleOverpassQuestType
{
@Inject public AddFireHydrantType(OverpassMapDataDao overpassServer)
{
super(overpassServer);
}

@Override
protected String getTagFilters()
{
return "nodes with emergency=fire_hydrant and !fire_hydrant:type";
}

@Override
public int importance()
{
return QuestImportance.MINOR;
}

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

public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes)
{
List<String> values = answer.getStringArrayList(AddFireHydrantTypeForm.OSM_VALUES);
if(values != null && values.size() == 1)
{
changes.add("fire_hydrant:type", values.get(0));
}
}

@Override public String getCommitMessage()
{
return "Add fire hydrant type";
}

@Override public String getIconName() {
return "fire_hydrant_type";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package de.westnordost.streetcomplete.quests.fire_hydrant;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.quests.ImageListQuestAnswerFragment;

public class AddFireHydrantTypeForm extends ImageListQuestAnswerFragment
{
private final OsmItem[] TYPES = new OsmItem[] {
new OsmItem("pillar", R.drawable.fire_hydrant_pillar, R.string.quest_fireHydrant_type_pillar),
new OsmItem("underground", R.drawable.fire_hydrant_underground, R.string.quest_fireHydrant_type_underground),
new OsmItem("wall", R.drawable.fire_hydrant_wall, R.string.quest_fireHydrant_type_wall),
new OsmItem("pond", R.drawable.fire_hydrant_pond, R.string.quest_fireHydrant_type_pond)
};

@Override protected OsmItem[] getItems()
{
return TYPES;
}

@Override protected int getItemsPerRow()
{
return 2;
}

@Override protected int getMaxNumberOfInitiallyShownItems()
{
return 2;
}

@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
View view = super.onCreateView(inflater, container, savedInstanceState);
setTitle(R.string.quest_fireHydrant_type_title);
return view;
}
}
8 changes: 7 additions & 1 deletion app/src/main/res/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ tactile_paving_illustration.jpg https://www.flickr.com/photos/jeanlouis_zimmerma

recycling_centre.jpg http://www.afgsc.af.mil/News/Art/igphoto/2000375277/
recycling_container_underground.jpg https://commons.wikimedia.org/wiki/File:San_Fernando_de_Henares_-_reciclaje_de_residuos_urbanos_04.JPG
recycling_container.jpg https://commons.wikimedia.org/wiki/File:Vitoria_-_Contenedores_de_reciclaje_en_la_Avenida_de_Gasteiz.jpg
recycling_container.jpg https://commons.wikimedia.org/wiki/File:Vitoria_-_Contenedores_de_reciclaje_en_la_Avenida_de_Gasteiz.jpg

fire_hydrant_pillar.jpg https://commons.wikimedia.org/wiki/File:W%C3%ABntreng,_Hydrant.jpg
fire_hydrant_wall.jpg https://commons.wikimedia.org/wiki/File:Guentherscheid_Tunnel_Rescue4.jpg
fire_hydrant_underground.jpg https://commons.wikimedia.org/wiki/File:Hydrant_MPWiK.jpg
fire_hydrant_pond.jpg https://commons.wikimedia.org/wiki/File:Dry_hydrant.jpg

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,9 @@ The info you enter is then directly added to the OpenStreetMap in your name, wit

Otherwise, you can download another keyboard in the app store. Popular keyboards that support many languages are Google Gboard, SwiftKey Keyboard and Multiling O Keyboard."</string>
<string name="quest_streetName_menuItem_nolanguage">(unspecified)</string>
<string name="quest_fireHydrant_type_title">What kind of fire hydrant is this?</string>
<string name="quest_fireHydrant_type_pillar">Pillar</string>
<string name="quest_fireHydrant_type_underground">Underground</string>
<string name="quest_fireHydrant_type_wall">Wall</string>
<string name="quest_fireHydrant_type_pond">Pond</string>
</resources>
10 changes: 6 additions & 4 deletions res/authors.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
All assets made by and (c) Tobias Zwick unless explicitly stated otherwise. License: CC-BY-SA 4.0.

URLs to other sources used:
- Twemoji 2 (MIT license) https://github.com/twitter/twemoji/
- EmojiOne 2 (CC-BY 4 license) https://github.com/emojione/emojione/tree/2.2.7
- elegant themes (GPL) https://www.elegantthemes.com/blog/freebie-of-the-week/beautiful-flat-icons-for-free
- Twemoji 2 (MIT license) https://github.com/twitter/twemoji/
- EmojiOne 2 (CC-BY 4 license) https://github.com/emojione/emojione/tree/2.2.7
- elegant themes (GPL) https://www.elegantthemes.com/blog/freebie-of-the-week/beautiful-flat-icons-for-free
- Creative Tail Object Icons (CC-BY 4 license) https://www.creativetail.com/free-objects-icons/


File Author if not Tobias Zwick / Source
Expand Down Expand Up @@ -43,6 +44,7 @@ quest_icons.svg
notes
parking
parking_maxstay
fire_hydrant modified from Creative Tail Object Icons
pedestrian
pedestrian_crossing
phone
Expand Down Expand Up @@ -106,4 +108,4 @@ sport_icons.svg
squash modified from EmojiOne 2: U+1F3F8
table_tennis EmojiOne 2: U+1F3D3
tennis EmojiOne 2: U+1F3BE
volleyball EmojiOne 2: U+1F3D0
volleyball EmojiOne 2: U+1F3D0
Loading

0 comments on commit 9efbacd

Please sign in to comment.