-
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Quest: Does this caravan area have a sanitary_dump_station? (#5363)
* Draft AddSanitaryDumpStation #5233 * Update AddSanitaryDumpStation.kt * add sanitary_dump_station example pic * AddSanitaryDumpStation: Improve elementFilter * Create sanitary_dump_station_illustration.jpg * drawables * Update quest_sanitary_dump_station.xml * fix drawables * Update strings.xml * Update app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt Co-authored-by: Flo Edelmann <[email protected]> * Update app/src/main/res/authors.txt Co-authored-by: Flo Edelmann <[email protected]> * remove image * examlple signs for sanitary dump station * alternative sign * new pictures * remove attribution to missing picture --------- Co-authored-by: Flo Edelmann <[email protected]> Co-authored-by: Tobias Zwick <[email protected]>
- Loading branch information
1 parent
8b57805
commit 9de3369
Showing
9 changed files
with
191 additions
and
2 deletions.
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
35 changes: 35 additions & 0 deletions
35
...java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.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,35 @@ | ||
package de.westnordost.streetcomplete.quests.sanitary_dump_station; | ||
|
||
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 | ||
import de.westnordost.streetcomplete.osm.Tags | ||
import de.westnordost.streetcomplete.sanitary_dump_station.AddSanitaryDumpStationForm | ||
import de.westnordost.streetcomplete.util.ktx.toYesNo | ||
|
||
class AddSanitaryDumpStation : OsmFilterQuestType<Boolean>() { | ||
|
||
override val elementFilter = """ | ||
nodes, ways with | ||
( | ||
tourism = caravan_site | ||
or tourism = camping_site and caravans = yes and !backcountry | ||
) | ||
and access !~ private|no | ||
and !sanitary_dump_station | ||
""" | ||
|
||
override val changesetComment = "Specify if there is a sanitary dump station at camp or caravan site" | ||
override val wikiLink = "Key:sanitary_dump_station" | ||
override val icon = R.drawable.ic_quest_caravan | ||
override val achievements = listOf(EditTypeAchievement.OUTDOORS) | ||
|
||
override fun getTitle(tags: Map<String, String>) = R.string.quest_sanitary_dump_station_title | ||
|
||
override fun createForm() = AddSanitaryDumpStationForm() | ||
|
||
override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { | ||
tags["sanitary_dump_station"] = answer.toYesNo() | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStationForm.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,15 @@ | ||
package de.westnordost.streetcomplete.sanitary_dump_station | ||
|
||
import de.westnordost.streetcomplete.R | ||
import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm | ||
import de.westnordost.streetcomplete.quests.AnswerItem | ||
|
||
class AddSanitaryDumpStationForm : AbstractOsmQuestForm<Boolean>() { | ||
|
||
override val contentLayoutResId = R.layout.quest_sanitary_dump_station | ||
|
||
override val buttonPanelAnswers = listOf( | ||
AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(false) }, | ||
AnswerItem(R.string.quest_generic_hasFeature_yes) { applyAnswer(true) } | ||
) | ||
} |
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,42 @@ | ||
<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="M64,64m-64,0a64,64 0,1 1,128 0a64,64 0,1 1,-128 0" | ||
android:strokeAlpha="0.2" | ||
android:strokeWidth="12" | ||
android:fillColor="#9bbe55"/> | ||
<path | ||
android:fillColor="#000" | ||
android:pathData="m99.86,79.98h16.05v8h-8v12h-8v-12h-43.98c0,6.63 -5.37,12.02 -12,12.02s-12,-5.37 -12,-12c-3.41,-0.13 -6.81,0.19 -10.17,-0.19 -8.03,-1.25 -10.65,-9.79 -9.5,-19.84 -0.33,0 87.61,12 87.61,12z" | ||
android:fillAlpha="0.2"/> | ||
<path | ||
android:pathData="m23.93,84l76,0c-0,-24 -0,-56 -28,-56l-32,0c-24,0 -40,56 -16,56z" | ||
android:fillColor="#deb486"/> | ||
<path | ||
android:pathData="m99.35,64c0.52,6.73 0.54,13.65 0.54,20l-76,0c-9.68,0 -12.85,-9.12 -11.61,-20z" | ||
android:fillColor="#c84747"/> | ||
<path | ||
android:pathData="m43.93,68a16,16 0,0 1,16 16l-32,0a16,16 0,0 1,16 -16z" | ||
android:fillColor="#913636"/> | ||
<path | ||
android:pathData="M43.95,84.02m12,0a12,12 0,1 0,-24 0a12,12 0,1 0,24 0" | ||
android:fillColor="#555"/> | ||
<path | ||
android:pathData="m115.93,76l-0,8l-8,0l-0,12l-8,0l-0,-12l-8,-0l-0,-8z" | ||
android:fillColor="#aaa"/> | ||
<path | ||
android:pathData="M79.93,44L71.93,44A4,4 0,0 0,67.93 48L67.93,76A4,4 0,0 0,71.93 80L79.93,80A4,4 0,0 0,83.93 76L83.93,48A4,4 0,0 0,79.93 44z" | ||
android:fillColor="#c08268"/> | ||
<path | ||
android:pathData="M51.93,44L31.93,44A4,4 0,0 0,27.93 48L27.93,56A4,4 0,0 0,31.93 60L51.93,60A4,4 0,0 0,55.93 56L55.93,48A4,4 0,0 0,51.93 44z" | ||
android:fillColor="#95685e"/> | ||
<path | ||
android:pathData="m90.69,35.98c1.02,1.22 1.93,2.57 2.74,4l-71.98,0c1,-1.43 2.06,-2.77 3.18,-4z" | ||
android:fillColor="#c84747"/> | ||
<path | ||
android:pathData="M43.93,84m5.95,0a5.95,5.95 0,1 0,-11.89 0a5.95,5.95 0,1 0,11.89 0" | ||
android:fillColor="#aaa"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<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="M16,0L112,0A16,16 0,0 1,128 16L128,112A16,16 0,0 1,112 128L16,128A16,16 0,0 1,0 112L0,16A16,16 0,0 1,16 0z" | ||
android:fillColor="#73411f"/> | ||
<path | ||
android:pathData="m8,120h112v-40h-72v8h28c2,0 4,2 4,4v16c0,2 -2,4 -4,4h-48c-2,0 -4,-2 -4,-4v-16c0,-2 2,-4 4,-4h8v-8h-28z" | ||
android:strokeWidth=".19854" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="m120,68v-6h-16v-30c0,-8 -8,-16 -16,-16h-48c-8,0 -16,8 -16,16v20c0,8 8,16 16,16h11c0,-8 5,-14 13,-14s13,6 13,14zM76,28c0,-2 2,-4 4,-4h8c2,0 4,2 4,4v8c0,2 -2,4 -4,4h-8c-2,0 -4,-2 -4,-4zM60,44h-20c-2,0 -4,-2 -4,-4v-12c0,-2 2,-4 4,-4h20c2,0 4,2 4,4v12c0,2 -2,4 -4,4z" | ||
android:strokeWidth=".19854" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="M64,67m-9,0a9,9 0,1 1,18 0a9,9 0,1 1,-18 0" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="m44,72v20h6l-8,10 -8,-10h6v-20z" | ||
android:fillColor="#fff"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<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="M16,0L112,0A16,16 0,0 1,128 16L128,112A16,16 0,0 1,112 128L16,128A16,16 0,0 1,0 112L0,16A16,16 0,0 1,16 0z" | ||
android:fillColor="#25b"/> | ||
<path | ||
android:pathData="m40,16c-8,0 -20,4 -20,6l4,6h24v4h-14c-4,0 -10,14 -10,16 -2,0 -12,2 -12,4v16h8c0,-8 6,-14 14,-14s14,6 14,14h32c0,-8 6,-14 14,-14 8,0 14,6 14,14h4c2,0 4,-2 4,-4v-40c0,-4 -4,-8 -8,-8zM82,24h24c1.11,0 2,0.89 2,2v14c0,1.11 -0.89,2 -2,2h-24c-1.11,0 -2,-0.89 -2,-2v-14c0,-1.11 0.89,-2 2,-2zM36,36h12v12h-20c0,-2 4,-12 8,-12zM64,48c4.42,0 8,3.58 8,8s-3.58,8 -8,8 -8,-3.58 -8,-8 3.58,-8 8,-8zM34,58c-5.52,0 -10,4.48 -10,10s4.48,10 10,10 10,-4.48 10,-10 -4.48,-10 -10,-10zM94,58c-5.52,0 -10,4.48 -10,10s4.48,10 10,10 10,-4.48 10,-10 -4.48,-10 -10,-10zM52,72 L64,84 76,72z" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="m112,84h-24v26h-48v-26h-24" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#fff"/> | ||
<path | ||
android:pathData="m48,92s5.02,-4 8,-4 5.02,4 8,4 5.02,-4 8,-4 8,4 8,4" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#fff" | ||
android:strokeLineCap="round"/> | ||
<path | ||
android:pathData="m48,102s5.02,-4 8,-4 5.02,4 8,4 5.02,-4 8,-4 8,4 8,4" | ||
android:strokeWidth="4" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#fff" | ||
android:strokeLineCap="round"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/quest_sanitary_dump_station_description"/> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:showDividers="middle" | ||
android:divider="@drawable/space_16dp" | ||
android:layout_marginTop="16dp"> | ||
|
||
<ImageView | ||
android:layout_weight="1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:scaleType="centerInside" | ||
android:src="@drawable/sanitary_dump_station_sign1" /> | ||
|
||
<ImageView | ||
android:layout_weight="1" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:src="@drawable/sanitary_dump_station_sign2" /> | ||
|
||
</LinearLayout> | ||
|
||
</LinearLayout> |
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
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