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 Street cabinet quest #470

Merged
merged 24 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
661c54b
Do not ask for charging station operator when it is already tagged th…
westnordost Oct 26, 2023
a37832a
First version of street cabinet quest
mcliquid Oct 27, 2023
3b3b492
Added Quest to QuestList and added the strings
mcliquid Oct 27, 2023
c7fcd5c
remove unnecessary padding
westnordost Oct 27, 2023
540288a
Going back to simple ListQuestForm for the beginning
mcliquid Oct 27, 2023
ca49fcf
exclude building=roof from amenity_indoor quest
qugebert Oct 27, 2023
f49541a
Added quest icon, tested the implementation
mcliquid Oct 28, 2023
6d21559
increased the border width
mcliquid Oct 28, 2023
87c0e84
re-used existing strings
mcliquid Oct 28, 2023
95c9503
moved icon from debug
mcliquid Oct 28, 2023
1ece0cc
Merge branch 'streetcomplete:master' into street_cabinet
mcliquid Oct 28, 2023
e19ec72
WIP: rebuild to ImageQuest
mcliquid Oct 31, 2023
fc2c62f
Added first three icons
mcliquid Oct 31, 2023
c5f83af
Added all icons
mcliquid Oct 31, 2023
bc92fb0
fix some issues
Helium314 Oct 31, 2023
5a7c7b2
Added sources
mcliquid Oct 31, 2023
dc38399
Move text below icons
mcliquid Oct 31, 2023
e09ffd6
bigger stroke and switched order
mcliquid Oct 31, 2023
ac16916
Switched order to most used regarding taginfo
mcliquid Oct 31, 2023
b94decb
New icons
mcliquid Nov 1, 2023
aeabe03
Revert "Do not ask for charging station operator when it is already t…
Helium314 Nov 1, 2023
98d3174
Revert "remove unnecessary padding"
Helium314 Nov 1, 2023
644cab4
Revert "exclude building=roof from amenity_indoor quest"
Helium314 Nov 1, 2023
b6d9fb2
removed two strings
mcliquid Nov 1, 2023
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
34 changes: 34 additions & 0 deletions app/src/debug/res/drawable/ic_quest_street_cabinet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
mcliquid marked this conversation as resolved.
Show resolved Hide resolved
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:strokeWidth=".2"
android:fillColor="#fd5"/>
<path
android:pathData="m25.69,107.25l76.66,0"
android:strokeWidth="7.67"
android:fillColor="#00000000"
android:strokeColor="#c87137"/>
<path
android:strokeWidth="3"
android:pathData="M37.15,20.72l53.67,0l0,84.33l-53.67,0z"
android:fillColor="#aaa"
android:strokeColor="#333"/>
<path
android:strokeWidth="3"
android:pathData="m25.65,105.06l76.66,0"
android:fillColor="#00000000"
android:strokeColor="#c87137"/>
<path
android:pathData="m65.48,31.95 l-5,15 6.25,-1.25 -2.5,13.75 18.75,-20 -12.5,2.5 7.5,-12.5z"
android:strokeLineJoin="round"
android:strokeWidth="1.25"
android:fillColor="#fac800"
android:strokeColor="#fac800"/>
<path
android:pathData="M48.09,55.73l7.67,0l0,16.75l-7.67,0z"
android:fillColor="#ccc"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ import de.westnordost.streetcomplete.quests.sport.AddSport
import de.westnordost.streetcomplete.quests.step_count.AddStepCount
import de.westnordost.streetcomplete.quests.step_count.AddStepCountStile
import de.westnordost.streetcomplete.quests.steps_ramp.AddStepsRamp
import de.westnordost.streetcomplete.quests.street_cabinet.AddStreetCabinetType
import de.westnordost.streetcomplete.quests.summit.AddSummitCross
import de.westnordost.streetcomplete.quests.summit.AddSummitRegister
import de.westnordost.streetcomplete.quests.surface.AddCyclewayPartSurface
Expand Down Expand Up @@ -582,6 +583,7 @@ fun getQuestTypeList(
EE_QUEST_OFFSET + 5 to AddHealthcareSpeciality(),
EE_QUEST_OFFSET + 6 to AddServiceBuildingType(),
EE_QUEST_OFFSET + 7 to AddServiceBuildingOperator(),
EE_QUEST_OFFSET + 29 to AddStreetCabinetType(),
EE_QUEST_OFFSET + 8 to AddOutdoorSeatingType(),
EE_QUEST_OFFSET + 25 to AddDestination(),
EE_QUEST_OFFSET + 22 to AddArtworkType(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package de.westnordost.streetcomplete.quests.street_cabinet

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.osm.Tags

class AddStreetCabinetType : OsmFilterQuestType<StreetCabinetType>() {

override val elementFilter = """
nodes, ways with
man_made = street_cabinet
and !street_cabinet
and !utility
"""
override val changesetComment = "Add street cabinet type"
override val wikiLink = "Tag:man_made=street_cabinet"
override val icon = R.drawable.ic_quest_street_cabinet
override val defaultDisabledMessage: Int = R.string.default_disabled_msg_ee

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

override fun getTitleArgs(tags: Map<String, String>): Array<String> {
val operator = tags["operator"]?.let { " ($it)" } ?: ""
return arrayOf(operator)
}

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("""
nodes, ways with
(
man_made = street_cabinet
or building = service
)
""")

override fun createForm() = AddStreetCabinetTypeForm()

override fun applyAnswerTo(
answer: StreetCabinetType,
tags: Tags,
geometry: ElementGeometry,
timestampEdited: Long
) {
tags[answer.osmKey] = answer.osmValue }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package de.westnordost.streetcomplete.quests.street_cabinet

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AListQuestForm
import de.westnordost.streetcomplete.quests.TextItem
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.POWER
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.TELECOM
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.POSTAL_SERVICE
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.TRAFFIC_CONTROL
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.TRAFFIC_MONITORING
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.TRANSPORT_MANAGEMENT
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.WASTE
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.TELEVISION
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.GAS
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.STREET_LIGHTING
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.WATER
import de.westnordost.streetcomplete.quests.street_cabinet.StreetCabinetType.SEWERAGE
class AddStreetCabinetTypeForm : AListQuestForm<StreetCabinetType>() {
override val items = listOf(
TextItem(POWER, R.string.quest_street_cabinet_power),
TextItem(TELECOM, R.string.quest_street_cabinet_telecom),
TextItem(POSTAL_SERVICE, R.string.quest_street_cabinet_postal_service),
TextItem(TRAFFIC_CONTROL, R.string.quest_street_cabinet_traffic_control),
TextItem(TRAFFIC_MONITORING, R.string.quest_street_cabinet_traffic_monitoring),
TextItem(TRANSPORT_MANAGEMENT, R.string.quest_street_cabinet_transport_management),
TextItem(WASTE, R.string.quest_street_cabinet_waste),
TextItem(TELEVISION, R.string.quest_street_cabinet_television),
TextItem(GAS, R.string.quest_street_cabinet_gas),
TextItem(STREET_LIGHTING, R.string.quest_street_cabinet_street_lighting),
TextItem(WATER, R.string.quest_street_cabinet_water),
mcliquid marked this conversation as resolved.
Show resolved Hide resolved
TextItem(SEWERAGE, R.string.quest_street_cabinet_sewerage),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package de.westnordost.streetcomplete.quests.street_cabinet

enum class StreetCabinetType(val osmKey: String, val osmValue: String) {
POSTAL_SERVICE("street_cabinet", "postal_service"),
TRAFFIC_CONTROL("street_cabinet", "traffic_control"),
TRAFFIC_MONITORING("street_cabinet", "traffic_monitoring"),
TRANSPORT_MANAGEMENT("street_cabinet", "transport_management"),
WASTE("street_cabinet", "waste"),
TELEVISION("utility", "television"),
GAS("utility", "gas"),
POWER("utility", "power"),
STREET_LIGHTING("utility", "street_lighting"),
TELECOM("utility", "telecom"),
WATER("utility", "water"),
SEWERAGE("utility", "sewerage");
}
18 changes: 18 additions & 0 deletions app/src/main/res/values/strings_ee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,24 @@
<string name="quest_service_building_monitoring_station_description">A station located in a own building that monitors something</string>
<string name="quest_service_building_other">Other service building</string>

<!-- street cabinet type -->
<string name="quest_street_cabinet_type_title">What kind of street cabinet is this%s?</string>
<string name="quest_street_cabinet_traffic">Traffic</string>
<string name="quest_street_cabinet_other">Other</string>
<string name="quest_street_cabinet_postal_service">Postal Service</string>
<string name="quest_street_cabinet_postal_service_description">A street cabinet designed to host pending letters or other postal stuff before they go on local delivery (known as a postal relay box).</string>
<string name="quest_street_cabinet_traffic_control">Traffic Control</string>
<string name="quest_street_cabinet_traffic_monitoring">Traffic Monitoring</string>
<string name="quest_street_cabinet_transport_management">Transport Management</string>
<string name="quest_street_cabinet_waste">Waste</string>
<string name="quest_street_cabinet_television">Television</string>
<string name="quest_street_cabinet_gas">Gas</string>
<string name="quest_street_cabinet_power">Power</string>
<string name="quest_street_cabinet_street_lighting">Street Lighting</string>
<string name="quest_street_cabinet_water">Water</string>
<string name="quest_street_cabinet_telecom">Telecom</string>
<string name="quest_street_cabinet_sewerage">Sewerage</string>

<!-- outdoor seating type -->
<string name="quest_seating_parklet">Next to the curb, or where parking used to be</string>
<string name="quest_seating_pedestrian_zone">In a pedestrian zone</string>
Expand Down
3 changes: 2 additions & 1 deletion res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
===============================================================================
Expand Down Expand Up @@ -409,6 +409,7 @@ quest/
steps_ramp.svg
steps_handrail.svg
street.svg
street_cabinet.svg mcliquid (GPL 3) based on https://github.com/JOSM/josm/blob/master/resources/images/presets/misc/street_cabinet.svg)
street_lanes.svg
street_name.svg
street_surface.svg
Expand Down
1 change: 1 addition & 0 deletions res/graphics/quest/street_cabinet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.