diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt index 5f3c4c0d55..267a378324 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt @@ -152,6 +152,7 @@ import de.westnordost.streetcomplete.quests.segregated.AddCyclewaySegregation import de.westnordost.streetcomplete.quests.self_service.AddSelfServiceLaundry import de.westnordost.streetcomplete.quests.service_building.AddServiceBuildingOperator import de.westnordost.streetcomplete.quests.service_building.AddServiceBuildingType +import de.westnordost.streetcomplete.quests.shelter_type.AddShelterType import de.westnordost.streetcomplete.quests.shop_type.CheckShopExistence import de.westnordost.streetcomplete.quests.shop_type.CheckShopType import de.westnordost.streetcomplete.quests.shop_type.SpecifyShopType @@ -588,6 +589,7 @@ fun getQuestTypeList( EE_QUEST_OFFSET + 23 to AddRailwayPlatformRef(), EE_QUEST_OFFSET + 9 to AddTreeGenus(), EE_QUEST_OFFSET + 26 to AddIsPharmacyDispensing(), + EE_QUEST_OFFSET + 30 to AddShelterType(), EE_QUEST_OFFSET + 28 to AddFootwayWidth(arSupportChecker), EE_QUEST_OFFSET + 10 to OsmoseQuest(osmoseDao), EE_QUEST_OFFSET + 11 to CustomQuest(customQuestList), diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/AddShelterType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/AddShelterType.kt new file mode 100644 index 0000000000..9c53b5dad7 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/AddShelterType.kt @@ -0,0 +1,36 @@ +package de.westnordost.streetcomplete.quests.shelter_type + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry +import de.westnordost.streetcomplete.data.osm.mapdata.Element +import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry +import de.westnordost.streetcomplete.data.osm.mapdata.filter +import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType +import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement +import de.westnordost.streetcomplete.osm.Tags + +class AddShelterType : OsmFilterQuestType() { + + override val elementFilter = """ + nodes, ways with + amenity = shelter + and !shelter_type + """ + override val changesetComment = "Specify shelter types" + override val wikiLink = "Key:shelter_type" + override val icon = R.drawable.ic_quest_shelter_type + override val isDeleteElementEnabled = true + override val achievements = listOf(EditTypeAchievement.OUTDOORS) + override val defaultDisabledMessage: Int = R.string.quest_shelter_type_disabled_msg + + override fun getTitle(tags: Map) = R.string.quest_shelter_type_title + + override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = + getMapData().filter("nodes, ways with amenity = shelter") + + override fun createForm() = AddShelterTypeForm() + + override fun applyAnswerTo(answer: ShelterType, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { + tags["shelter_type"] = answer.osmValue + } +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/AddShelterTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/AddShelterTypeForm.kt new file mode 100644 index 0000000000..8fa5884295 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/AddShelterTypeForm.kt @@ -0,0 +1,40 @@ +package de.westnordost.streetcomplete.quests.shelter_type + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.quests.AImageListQuestForm +import de.westnordost.streetcomplete.quests.AnswerItem +import de.westnordost.streetcomplete.quests.IAnswerItem +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.PUBLIC_TRANSPORT +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.PICNIC_SHELTER +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.GAZEBO +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.LEAN_TO +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.BASIC_HUT +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.SUN_SHELTER +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.FIELD_SHELTER +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.ROCK_SHELTER +import de.westnordost.streetcomplete.quests.shelter_type.ShelterType.WEATHER_SHELTER +import de.westnordost.streetcomplete.view.image_select.Item + +class AddShelterTypeForm : AImageListQuestForm() { + + override val items = listOf( + Item(PUBLIC_TRANSPORT, R.drawable.shelter_type_public_transport, R.string.quest_shelter_type_public_transport), + Item(PICNIC_SHELTER, R.drawable.shelter_type_picnic_shelter, R.string.quest_shelter_type_picnic_shelter), + Item(GAZEBO, R.drawable.shelter_type_gazebo, R.string.quest_shelter_type_gazebo), + Item(LEAN_TO, R.drawable.shelter_type_lean_to, R.string.quest_shelter_type_lean_to), + Item(BASIC_HUT, R.drawable.shelter_type_basic_hut, R.string.quest_shelter_type_basic_hut), + Item(SUN_SHELTER, R.drawable.shelter_type_sun_shelter, R.string.quest_shelter_type_sun_shelter), + Item(FIELD_SHELTER, R.drawable.shelter_type_field_shelter, R.string.quest_shelter_type_field_shelter), + Item(ROCK_SHELTER, R.drawable.shelter_type_rock_shelter, R.string.quest_shelter_type_rock_shelter) + ) + + override val otherAnswers = listOf( + AnswerItem(R.string.quest_shelter_type_is_weather_shelter) { applyAnswer(WEATHER_SHELTER) } + ) + + override val itemsPerRow = 3 + + override fun onClickOk(selectedItems: List) { + applyAnswer(selectedItems.single()) + } +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/ShelterType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/ShelterType.kt new file mode 100644 index 0000000000..f174784d91 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/shelter_type/ShelterType.kt @@ -0,0 +1,13 @@ +package de.westnordost.streetcomplete.quests.shelter_type + +enum class ShelterType(val osmValue: String) { + PUBLIC_TRANSPORT("public_transport"), + PICNIC_SHELTER("picnic_shelter"), + GAZEBO("gazebo"), + LEAN_TO("lean_to"), + BASIC_HUT("basic_hut"), + SUN_SHELTER("sun_shelter"), + FIELD_SHELTER("field_shelter"), + ROCK_SHELTER("rock_shelter"), + WEATHER_SHELTER("weather_shelter") +} diff --git a/app/src/main/res/authors.txt b/app/src/main/res/authors.txt index e5f4f061cd..66951fdcf5 100644 --- a/app/src/main/res/authors.txt +++ b/app/src/main/res/authors.txt @@ -232,6 +232,15 @@ recycling_centre.jpg Public Domain https://commons.wikimedia.org/w recycling_container.jpg CC0 https://commons.wikimedia.org/wiki/File:Vitoria_-_Contenedores_de_reciclaje_en_la_Avenida_de_Gasteiz.jpg recycling_container_undergr... CC0 https://commons.wikimedia.org/wiki/File:San_Fernando_de_Henares_-_reciclaje_de_residuos_urbanos_04.JPG +shelter_type_public_transpor… CC-BY 2.0 Janusz Jakubowski https://commons.wikimedia.org/wiki/File:Bus_shelter_in_Warsaw_(25843621920).jpg +shelter_type_picnic_shelter.… CC-BY-SA 3.0 B.navez https://wiki.openstreetmap.org/wiki/File:R%C3%A9union_Ma%C3%AFdo_kiosque_pique-nique.JPG +shelter_type_gazebo.jpg CC-BY 2.0 Tim Green https://commons.wikimedia.org/wiki/File:Shelter,_Roundhay_Park_(3511090304).jpg +shelter_type_lean_to.jpg CC-BY-SA 3.0 j doll https://commons.wikimedia.org/wiki/File:Keauhou_Shelter_(145211875).jpeg +shelter_type_basic_hut.jpg CC-BY-SA 4.0 Eginhard https://commons.wikimedia.org/wiki/File:Schutzh%C3%BCtte_Lauchb%C3%BChl_2021-06-19.jpg +shelter_type_sun_shelter.jpg CC-BY-SA 2.0 blmoregon https://commons.wikimedia.org/wiki/File:Oregon_Trail_-_Keeney_Historic_Site.jpg +shelter_type_field_shelter… CC-BY-SA 4.0 Kolforn https://commons.wikimedia.org/wiki/File:-2018-10-03_Free_range_pigs,_Southrepps_(1).JPG +shelter_type_rock_shelter.jpg CC-BY 2.0 Bureau of Land Management Oregon and Washington https://commons.wikimedia.org/wiki/File:Rock_Shelter_(11410676553).jpg + sliding_envelope.wav CC0 https://freesound.org/people/MTJohnson/sounds/444431/ snip.wav CC0 https://freesound.org/people/Godowan/sounds/240473/ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_basic_hut.jpg b/app/src/main/res/drawable-hdpi/shelter_type_basic_hut.jpg new file mode 100644 index 0000000000..9f0eedf74f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_basic_hut.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_field_shelter.jpg b/app/src/main/res/drawable-hdpi/shelter_type_field_shelter.jpg new file mode 100644 index 0000000000..41d79fa145 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_field_shelter.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_gazebo.jpg b/app/src/main/res/drawable-hdpi/shelter_type_gazebo.jpg new file mode 100644 index 0000000000..79fbf82ba5 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_gazebo.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_lean_to.jpg b/app/src/main/res/drawable-hdpi/shelter_type_lean_to.jpg new file mode 100644 index 0000000000..cceea7ecb2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_lean_to.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_picnic_shelter.jpg b/app/src/main/res/drawable-hdpi/shelter_type_picnic_shelter.jpg new file mode 100644 index 0000000000..37524d6c8f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_picnic_shelter.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_public_transport.jpg b/app/src/main/res/drawable-hdpi/shelter_type_public_transport.jpg new file mode 100644 index 0000000000..43abc951fb Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_public_transport.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_rock_shelter.jpg b/app/src/main/res/drawable-hdpi/shelter_type_rock_shelter.jpg new file mode 100644 index 0000000000..8abd5f5058 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_rock_shelter.jpg differ diff --git a/app/src/main/res/drawable-hdpi/shelter_type_sun_shelter.jpg b/app/src/main/res/drawable-hdpi/shelter_type_sun_shelter.jpg new file mode 100644 index 0000000000..5c5325c20c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/shelter_type_sun_shelter.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_basic_hut.jpg b/app/src/main/res/drawable-mdpi/shelter_type_basic_hut.jpg new file mode 100644 index 0000000000..6d2faf26ce Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_basic_hut.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_field_shelter.jpg b/app/src/main/res/drawable-mdpi/shelter_type_field_shelter.jpg new file mode 100644 index 0000000000..516b9704b7 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_field_shelter.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_gazebo.jpg b/app/src/main/res/drawable-mdpi/shelter_type_gazebo.jpg new file mode 100644 index 0000000000..ca475a81a5 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_gazebo.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_lean_to.jpg b/app/src/main/res/drawable-mdpi/shelter_type_lean_to.jpg new file mode 100644 index 0000000000..8ded0e9f57 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_lean_to.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_picnic_shelter.jpg b/app/src/main/res/drawable-mdpi/shelter_type_picnic_shelter.jpg new file mode 100644 index 0000000000..3dc8690f82 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_picnic_shelter.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_public_transport.jpg b/app/src/main/res/drawable-mdpi/shelter_type_public_transport.jpg new file mode 100644 index 0000000000..30a07996c9 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_public_transport.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_rock_shelter.jpg b/app/src/main/res/drawable-mdpi/shelter_type_rock_shelter.jpg new file mode 100644 index 0000000000..5b40a80ee8 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_rock_shelter.jpg differ diff --git a/app/src/main/res/drawable-mdpi/shelter_type_sun_shelter.jpg b/app/src/main/res/drawable-mdpi/shelter_type_sun_shelter.jpg new file mode 100644 index 0000000000..2832c25c56 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/shelter_type_sun_shelter.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_basic_hut.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_basic_hut.jpg new file mode 100644 index 0000000000..a35970d52e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_basic_hut.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_field_shelter.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_field_shelter.jpg new file mode 100644 index 0000000000..2faaae9f46 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_field_shelter.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_gazebo.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_gazebo.jpg new file mode 100644 index 0000000000..9d46205ccd Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_gazebo.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_lean_to.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_lean_to.jpg new file mode 100644 index 0000000000..2e58575cb5 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_lean_to.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_picnic_shelter.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_picnic_shelter.jpg new file mode 100644 index 0000000000..ac08c53df1 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_picnic_shelter.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_public_transport.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_public_transport.jpg new file mode 100644 index 0000000000..ec9fe9be6c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_public_transport.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_rock_shelter.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_rock_shelter.jpg new file mode 100644 index 0000000000..dcae478ff9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_rock_shelter.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/shelter_type_sun_shelter.jpg b/app/src/main/res/drawable-xhdpi/shelter_type_sun_shelter.jpg new file mode 100644 index 0000000000..f6ad88916f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/shelter_type_sun_shelter.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_basic_hut.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_basic_hut.jpg new file mode 100644 index 0000000000..7d0bcbc6a6 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_basic_hut.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_field_shelter.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_field_shelter.jpg new file mode 100644 index 0000000000..3a1ad38542 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_field_shelter.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_gazebo.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_gazebo.jpg new file mode 100644 index 0000000000..4eb78bd2f3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_gazebo.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_lean_to.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_lean_to.jpg new file mode 100644 index 0000000000..f2f9212bf3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_lean_to.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_picnic_shelter.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_picnic_shelter.jpg new file mode 100644 index 0000000000..3f4540d809 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_picnic_shelter.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_public_transport.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_public_transport.jpg new file mode 100644 index 0000000000..af684835b8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_public_transport.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_rock_shelter.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_rock_shelter.jpg new file mode 100644 index 0000000000..c83f6c3c2f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_rock_shelter.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/shelter_type_sun_shelter.jpg b/app/src/main/res/drawable-xxhdpi/shelter_type_sun_shelter.jpg new file mode 100644 index 0000000000..31d0a28fa4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/shelter_type_sun_shelter.jpg differ diff --git a/app/src/main/res/drawable/ic_quest_shelter_type.xml b/app/src/main/res/drawable/ic_quest_shelter_type.xml new file mode 100644 index 0000000000..f1c89fdc5b --- /dev/null +++ b/app/src/main/res/drawable/ic_quest_shelter_type.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings_ee.xml b/app/src/main/res/values/strings_ee.xml index 2ed05d004a..4a60b8877f 100644 --- a/app/src/main/res/values/strings_ee.xml +++ b/app/src/main/res/values/strings_ee.xml @@ -357,6 +357,19 @@ At a beach What kind of outdoor seating does this place have? + + What kind of shelter is this? + This quest is disabled by default because it’s not easy to answer. The shelter type must be chosen from suggestions, which are taken from most used values and these are often not easy to differentiate. + This is a generic weather shelter + Public Transport + Picnic Shelter + Gazebo + Lean-to + Basic hut + Sun shelter + Field shelter + Rock shelter + What kind of artwork is this? Sculpture diff --git a/res/graphics/authors.txt b/res/graphics/authors.txt index 065326cd6c..208302ba65 100644 --- a/res/graphics/authors.txt +++ b/res/graphics/authors.txt @@ -4,7 +4,7 @@ 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 - Google Noto Color Emoji https://github.com/googlefonts/noto-emoji/tree/main - (Apache license, version 2.0) + (Apache license, version 2.0) File Author if not Tobias Zwick / Source =============================================================================== @@ -397,6 +397,7 @@ quest/ road_construction.svg roof_shape.svg seating.svg + shelter_type.svg modified from https://wiki.openstreetmap.org/wiki/File:Shelter-14.svg shower.svg sidewalk.svg sidewalk_surface.svg @krisdoodle45 (based on way_surface.svg) diff --git a/res/graphics/quest/shelter_type.svg b/res/graphics/quest/shelter_type.svg new file mode 100644 index 0000000000..cf59c323fa --- /dev/null +++ b/res/graphics/quest/shelter_type.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +