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 seasonal grit bin quest #4754

Merged
merged 6 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -121,6 +121,7 @@ import de.westnordost.streetcomplete.quests.religion.AddReligionToWaysideShrine
import de.westnordost.streetcomplete.quests.road_name.AddRoadName
import de.westnordost.streetcomplete.quests.road_name.RoadNameSuggestionsSource
import de.westnordost.streetcomplete.quests.roof_shape.AddRoofShape
import de.westnordost.streetcomplete.quests.seasonal.AddSeasonal
import de.westnordost.streetcomplete.quests.seating.AddSeating
import de.westnordost.streetcomplete.quests.segregated.AddCyclewaySegregation
import de.westnordost.streetcomplete.quests.self_service.AddSelfServiceLaundry
Expand Down Expand Up @@ -316,6 +317,7 @@ fun questTypeRegistry(
whether the postbox is still there in countries in which it is enabled */
48 to AddPostboxCollectionTimes(),
49 to CheckExistence(featureDictionaryFuture),
155 to AddSeasonal(),

50 to AddBoardType(),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CheckExistence(
or leisure = picnic_table
or amenity = bbq
or leisure = firepit
or amenity = grit_bin and seasonal = no
or amenity = vending_machine and vending ~ parking_tickets|public_transport_tickets
or amenity = ticket_validator
or tourism = information and information ~ board|terminal|map
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package de.westnordost.streetcomplete.quests.seasonal

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.CITIZEN
import de.westnordost.streetcomplete.osm.Tags
import de.westnordost.streetcomplete.osm.updateWithCheckDate
import de.westnordost.streetcomplete.quests.YesNoQuestForm
import de.westnordost.streetcomplete.util.ktx.toYesNo

class AddSeasonal : OsmFilterQuestType<Boolean>() {
FloEdelmann marked this conversation as resolved.
Show resolved Hide resolved

override val elementFilter = """
nodes with
amenity = grit_bin
and !seasonal
"""
override val changesetComment = "Specify whether grit bins are seasonal"
override val wikiLink = "Key:seasonal"
override val icon = R.drawable.calendar
override val achievements = listOf(CITIZEN)
override val defaultDisabledMessage = R.string.default_disabled_msg_seasonal

override fun getTitle(tags: Map<String, String>) = R.string.quest_seasonal_title

override fun createForm() = YesNoQuestForm()

override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags.updateWithCheckDate("seasonal", (!answer).toYesNo())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AddSeating : OsmFilterQuestType<Seating>() {
override val icon = R.drawable.ic_quest_seating
override val isReplaceShopEnabled = true
override val achievements = listOf(CITIZEN)
override val defaultDisabledMessage = R.string.default_disabled_msg_summer_outdoor_seating
override val defaultDisabledMessage = R.string.default_disabled_msg_seasonal

override fun getTitle(tags: Map<String, String>) = R.string.quest_seating_name_title

Expand Down
68 changes: 68 additions & 0 deletions app/src/main/res/drawable/calendar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
android:pathData="m128,64c0,35.35 -28.65,64 -64,64s-64,-28.65 -64,-64 28.65,-64 64,-64 64,28.65 64,64"
android:fillColor="#9bbe55"/>
<path
android:fillColor="#FF000000"
android:pathData="m25,90v9c0,5.54 4.46,10 10,10h60c5.54,0 10,-4.46 10,-10v-9h-80z"
android:strokeAlpha="0.2"
android:fillAlpha="0.2"/>
<path
android:pathData="M35,35L95,35A10,10 0,0 1,105 45L105,95A10,10 0,0 1,95 105L35,105A10,10 0,0 1,25 95L25,45A10,10 0,0 1,35 35z"
android:fillColor="#fff"/>
<path
android:pathData="M35,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M51.67,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M68.33,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M85,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M85,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M68.33,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M51.67,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M35,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M35,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M51.67,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M68.33,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M85,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="m35,30h60c5.54,0 10,4.46 10,10v10h-80v-10c0,-5.54 4.46,-10 10,-10z"
android:fillColor="#c84747"/>
<path
android:pathData="M86,38m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#9e3d33"/>
<path
android:pathData="M86,20L86,20A4,4 0,0 1,90 24L90,36A4,4 0,0 1,86 40L86,40A4,4 0,0 1,82 36L82,24A4,4 0,0 1,86 20z"
android:fillColor="#444"/>
<path
android:pathData="M44,38m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#9e3d33"/>
<path
android:pathData="M44,20L44,20A4,4 0,0 1,48 24L48,36A4,4 0,0 1,44 40L44,40A4,4 0,0 1,40 36L40,24A4,4 0,0 1,44 20z"
android:fillColor="#444"/>
</vector>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the
<string name="default_disabled_msg_no_ar">You need a tape measure to solve this quest because measuring with the camera is not supported on this device.</string>
<string name="default_disabled_msg_difficult_and_time_consuming">This quest type is disabled by default because it is either time-consuming or difficult to make the right choice. Only enable this quest type if you are really committed to adding this kind of data.</string>
<string name="default_disabled_msg_overlay">This quest type is disabled by default because there is already an overlay with which it is more effective and efficient to enter and update this data.</string>
<string name="default_disabled_msg_seasonal">"This quest type is disabled by default because it may require re-checking the situation at a specific part of the year."</string>


<!-- Quest interface -->
Expand Down Expand Up @@ -1316,12 +1317,13 @@ If there are no signs along the whole street which apply for the highlighted sec
<string name="quest_roofShape_answer_many">"It has several different shapes"</string>
<string name="default_disabled_msg_roofShape">This quest type is disabled by default because roof shapes are often not easily visible from the street. This quest type is also quite time-consuming; in most cases it is easier and more efficient to map this from aerial imagery at home.</string>

<string name="quest_seasonal_title">Is this here the whole year?</string>

<string name="quest_seating_name_title">What kind of seating does this place have?</string>
<string name="quest_seating_takeaway">No seating (takeout only)</string>
<string name="quest_seating_indoor_only">Indoor seating only</string>
<string name="quest_seating_outdoor_only">Outdoor seating only</string>
<string name="quest_seating_indoor_and_outdoor">Both indoor and outdoor seating</string>
<string name="default_disabled_msg_summer_outdoor_seating">"This quest type is disabled by default because it may require checking during specific part of the year in order to verify outdoor seating."</string>

<string name="quest_segregated_title">How are the footpath and bicycle path laid out here?</string>
<string name="quest_segregated_separated">Segregated from one another</string>
Expand Down
1 change: 1 addition & 0 deletions res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ quest/
bus_stop_lit.svg parts taken from Twemoji: U+1F68D
bus_stop_shelter.svg parts taken from Twemoji: U+1F68D
bus_stop_name.svg parts taken from Twemoji: U+1F68D
calendar.svg Flo Edelmann (CC0)
camp_power.svg
car.svg modified from Twemoji: U+1F698
car_bumpy.svg modified from Twemoji: U+1F698
Expand Down
23 changes: 23 additions & 0 deletions res/graphics/quest/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.