-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3380 from matkoniecz/traffic_calming
Traffic calming, fixes #2742
- Loading branch information
Showing
39 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...n/java/de/westnordost/streetcomplete/quests/traffic_calming_type/AddTrafficCalmingType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.westnordost.streetcomplete.quests.barrier_type | ||
|
||
import de.westnordost.streetcomplete.R | ||
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder | ||
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType | ||
import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.PEDESTRIAN | ||
import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.CAR | ||
import de.westnordost.streetcomplete.quests.traffic_calming_type.AddTrafficCalmingTypeForm | ||
import de.westnordost.streetcomplete.quests.traffic_calming_type.TrafficCalmingType | ||
|
||
class AddTrafficCalmingType : OsmFilterQuestType<TrafficCalmingType>() { | ||
|
||
override val elementFilter = """ | ||
nodes with traffic_calming=yes | ||
""" | ||
override val commitMessage = "Add specific traffic calming type on a point" | ||
override val wikiLink = "Key:traffic_calming" | ||
override val icon = R.drawable.ic_quest_car_bumpy | ||
override val isDeleteElementEnabled = true | ||
|
||
override fun getTitle(tags: Map<String, String>) = R.string.quest_traffic_calming_type_title | ||
|
||
override fun createForm() = AddTrafficCalmingTypeForm() | ||
|
||
override fun applyAnswerTo(answer: TrafficCalmingType, changes: StringMapChangesBuilder) { | ||
changes.modify("traffic_calming", answer.osmValue) | ||
} | ||
|
||
override val questTypeAchievements = listOf(PEDESTRIAN, CAR) | ||
} |
27 changes: 27 additions & 0 deletions
27
...va/de/westnordost/streetcomplete/quests/traffic_calming_type/AddTrafficCalmingTypeForm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package de.westnordost.streetcomplete.quests.traffic_calming_type | ||
|
||
import de.westnordost.streetcomplete.R | ||
import de.westnordost.streetcomplete.quests.AImageListQuestAnswerFragment | ||
import de.westnordost.streetcomplete.quests.traffic_calming_type.TrafficCalmingType | ||
import de.westnordost.streetcomplete.quests.traffic_calming_type.TrafficCalmingType.* | ||
import de.westnordost.streetcomplete.view.image_select.Item | ||
|
||
class AddTrafficCalmingTypeForm : AImageListQuestAnswerFragment<TrafficCalmingType, TrafficCalmingType>() { | ||
|
||
override val items = listOf( | ||
Item(BUMP, R.drawable.traffic_calming_bump, R.string.quest_traffic_calming_type_bump), | ||
Item(HUMP, R.drawable.traffic_calming_hump, R.string.quest_traffic_calming_type_hump), | ||
Item(TABLE, R.drawable.traffic_calming_table, R.string.quest_traffic_calming_type_table), | ||
Item(CUSHION, R.drawable.traffic_calming_cushion, R.string.quest_traffic_calming_type_cushion), | ||
Item(ISLAND, R.drawable.traffic_calming_island, R.string.quest_traffic_calming_type_island), | ||
Item(CHOKER, R.drawable.traffic_calming_choker, R.string.quest_traffic_calming_type_choker), | ||
Item(CHICANE, R.drawable.traffic_calming_chicane, R.string.quest_traffic_calming_type_chicane), | ||
Item(RUMBLE_STRIP, R.drawable.traffic_calming_rumble_strip, R.string.quest_traffic_calming_type_rumble_strip), | ||
) | ||
|
||
override val itemsPerRow = 3 | ||
|
||
override fun onClickOk(selectedItems: List<TrafficCalmingType>) { | ||
applyAnswer(selectedItems.single()) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...main/java/de/westnordost/streetcomplete/quests/traffic_calming_type/TrafficCalmingType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package de.westnordost.streetcomplete.quests.traffic_calming_type | ||
|
||
enum class TrafficCalmingType(val osmValue: String) { | ||
BUMP("bump"), | ||
HUMP("hump"), | ||
TABLE("table"), | ||
CUSHION("cushion"), | ||
ISLAND("island"), | ||
CHOKER("choker"), | ||
CHICANE("chicane"), | ||
RUMBLE_STRIP("rumble_strip"), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<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,64a64,64 0,0 1,-64 64,64 64,0 0,1 -64,-64 64,64 0,0 1,64 -64,64 64,0 0,1 64,64" | ||
android:fillColor="#fd5"/> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="m46.295,26.301c-7.502,2.073 -14.858,4.681 -18.848,6.937 -5.683,3.213 -5.286,15.984 -4.674,22.563 -0.566,-0.159 -1.177,-0.182 -1.785,-0.014l-4.286,1.184c-1.777,0.491 -2.819,2.326 -2.328,4.103 0.491,1.777 2.328,2.818 4.105,2.327l2.389,-0.66c-0.612,2.902 0.459,6.795 0.459,6.795l7.7,27.866c0.654,2.366 3.104,3.756 5.47,3.102l6.431,-1.777c2.366,-0.654 3.757,-3.104 3.103,-5.471l-0.239,-0.866c6.056,-0.749 11.63,-2.281 19.531,-4.464 7.902,-2.183 13.47,-3.729 19.052,-6.195l0.239,0.865c0.654,2.366 3.105,3.755 5.472,3.101l6.431,-1.777c2.366,-0.654 3.756,-3.104 3.102,-5.47l-7.7,-27.866c-0.878,-3.177 -2.018,-5.009 -3.107,-6.063l2.401,-0.664c1.775,-0.49 2.818,-2.328 2.327,-4.105 -0.491,-1.777 -2.329,-2.816 -4.104,-2.326l-4.286,1.184c-0.607,0.168 -1.12,0.502 -1.523,0.928 -2.852,-5.961 -9.069,-17.124 -15.597,-16.962 -4.583,0.113 -12.232,1.651 -19.735,3.724z" | ||
android:fillAlpha="0.2"/> | ||
<path | ||
android:pathData="m94.002,61.863 l-12.287,13.984 0.775,2.807c0.654,2.366 3.108,3.755 5.475,3.102l6.428,-1.777c2.366,-0.654 3.757,-3.104 3.103,-5.471l-3.494,-12.645zM24.166,76.314 L28.904,93.46c0.654,2.366 3.106,3.757 5.473,3.103l6.43,-1.777c2.366,-0.654 3.666,-3.081 3.102,-5.471l-0.471,-1.998 -19.271,-11.004z" | ||
android:fillColor="#555"/> | ||
<path | ||
android:pathData="m65.908,18.637c-9.166,0.225 -30.602,6.148 -38.584,10.66 -5.687,3.215 -5.283,15.978 -4.67,22.553 -0.358,-0.101 -0.737,-0.143 -1.121,-0.117 -0.221,0.015 -0.444,0.052 -0.666,0.113l-4.287,1.186c-1.777,0.491 -2.819,2.326 -2.328,4.103 0.491,1.777 2.326,2.817 4.103,2.326l2.391,-0.66c-0.612,2.902 0.459,6.795 0.459,6.795l4.738,17.148s2.05,6.424 10.941,6.205c9.166,-0.226 15.596,-2.001 26.314,-4.963 9.076,-2.415 17.274,-4.818 25.131,-9.25 3.968,-2.409 6.887,-5.943 6.205,-10.945 -1.579,-5.716 -3.159,-11.432 -4.738,-17.148 -0.878,-3.176 -2.019,-5.008 -3.107,-6.063l2.402,-0.664c1.775,-0.49 2.819,-2.327 2.328,-4.103 -0.43,-1.555 -1.892,-2.545 -3.44,-2.44 -0.221,0.015 -0.444,0.052 -0.666,0.113l-4.287,1.184c-0.609,0.168 -1.123,0.503 -1.527,0.932 -2.847,-5.955 -9.055,-17.126 -15.592,-16.965z" | ||
android:fillColor="#3b88c3"/> | ||
<path | ||
android:pathData="m52.54,45.402c8.37,-2.313 18.602,-4.679 26.055,-5.903l-5.438,-11.33c-3.92,-5.838 -16.782,-2.284 -25.355,0.085 -8.574,2.369 -21.435,5.923 -21.802,12.946l1.151,12.515c7.024,-2.776 17.019,-5.999 25.389,-8.312" | ||
android:fillColor="#bbddf5"/> | ||
<path | ||
android:pathData="m81.07,49.365c-0.656,-0.021 -1.325,0.056 -1.99,0.24l-2.145,0.592c-3.55,0.981 -5.634,4.655 -4.652,8.207 0.981,3.552 4.657,5.635 8.207,4.654l2.143,-0.592c3.55,-0.981 5.636,-4.655 4.654,-8.207 -0.797,-2.886 -3.375,-4.804 -6.217,-4.894zM36.058,61.803c-0.656,-0.021 -1.326,0.056 -1.992,0.24l-2.145,0.592c-3.552,0.981 -5.636,4.655 -4.654,8.207 0.981,3.552 4.657,5.636 8.209,4.654l2.143,-0.592c3.552,-0.981 5.636,-4.657 4.654,-8.209 -0.797,-2.886 -3.372,-4.802 -6.215,-4.893z" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="m79.438,43.629c-5.925,-0.116 -11.322,1.72 -11.646,1.834 -1.155,0.405 -1.772,1.667 -1.369,2.826 0.399,1.161 1.664,1.776 2.824,1.375 0.099,-0.033 9.945,-3.367 16.23,-0.318 0.694,0.338 1.48,0.278 2.1,-0.086 0.364,-0.214 0.673,-0.538 0.873,-0.947 0.536,-1.107 0.076,-2.435 -1.031,-2.971 -2.485,-1.204 -5.287,-1.66 -7.981,-1.713zM39.928,53.238c-0.148,0 -0.298,0.016 -0.449,0.047 -0.491,0.099 -12.056,2.583 -16.902,9.973 -0.673,1.028 -0.387,2.405 0.639,3.08 0.382,0.248 0.812,0.367 1.234,0.363 0.718,-0.006 1.421,-0.358 1.846,-1.004 3.829,-5.843 13.99,-8.035 14.092,-8.059 1.201,-0.252 1.972,-1.43 1.721,-2.631 -0.22,-1.051 -1.143,-1.773 -2.18,-1.77zM70.754,74.138c-2.796,-0.014 -6.234,0.494 -9.859,1.496h-0.002c-8.287,2.29 -14.411,6.289 -13.523,9.504 0.49,1.775 7.014,-0.784 15.301,-3.074 8.287,-2.29 15.199,-3.442 14.709,-5.217 -0.5,-1.809 -3.031,-2.691 -6.625,-2.709z" | ||
android:fillColor="#269"/> | ||
<path | ||
android:pathData="m30.554,80.283c-1.07,-0.607 -1.444,-1.961 -0.837,-3.031 0.533,-0.943 1.651,-1.347 2.644,-1.012 0.557,0.077 5.389,0.424 27.156,-5.591 21.767,-6.015 25.736,-8.793 26.174,-9.145 0.682,-0.797 1.844,-1.024 2.788,-0.489 1.07,0.607 1.444,1.961 0.837,3.031 -1.657,2.922 -16.476,7.536 -28.615,10.89 -12.139,3.354 -27.225,7.004 -30.147,5.347z" | ||
android:fillColor="#55acee"/> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="m94,88a20,14 0,0 0,-19.793 12h39.586a20,14 0,0 0,-19.793 -12z" | ||
android:fillAlpha="0.2"/> | ||
<path | ||
android:pathData="m94,84a20,14 0,0 0,-19.793 12h39.586a20,14 0,0 0,-19.793 -12z" | ||
android:fillColor="#555"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters