From 64aca311e3a5389a9c07a7fef2ce63459476e926 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 01:31:27 +0200 Subject: [PATCH 01/33] Camp drinking_water quest --- .../streetcomplete/quests/QuestsModule.kt | 4 +++ .../quests/camping/AddCampDrinkingWater.kt | 34 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt 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 8d3e7844d3..38d0379aa3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt @@ -42,6 +42,7 @@ import de.westnordost.streetcomplete.quests.bus_stop_name.AddBusStopName import de.westnordost.streetcomplete.quests.bus_stop_ref.AddBusStopRef import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter import de.westnordost.streetcomplete.quests.camera_type.AddCameraType +import de.westnordost.streetcomplete.quests.camping.AddCampDrinkingWater import de.westnordost.streetcomplete.quests.car_wash_type.AddCarWashType import de.westnordost.streetcomplete.quests.charging_station_capacity.AddChargingStationCapacity import de.westnordost.streetcomplete.quests.charging_station_operator.AddChargingStationOperator @@ -399,6 +400,9 @@ fun questTypeRegistry( AddIsDefibrillatorIndoor(), // need to go inside in case it is inside (or gone) + // camping site + AddCampDrinkingWater(), + // toilets AddToiletAvailability(), // OSM Carto, shown in OsmAnd descriptions AddToiletsFee(), // used by OsmAnd in the object description diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt new file mode 100644 index 0000000000..0b31577db8 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -0,0 +1,34 @@ +package de.westnordost.streetcomplete.quests.camp_drinking_water + +import de.westnordost.streetcomplete.R +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.OUTDOORS +import de.westnordost.streetcomplete.osm.Tags +import de.westnordost.streetcomplete.quests.YesNoQuestForm +import de.westnordost.streetcomplete.util.ktx.toYesNo + +class AddIsDefibrillatorIndoor : OsmFilterQuestType() { + + override val elementFilter = """ + nodes, ways with ( + tourism=camp_site + ) + and (!drinking_water or drinking_water older today -4 years) + """ + override val changesetComment = "Specify whether there is drinking water in camp site" + override val wikiLink = "Key:drinking_water" + override val icon = R.drawable.ic_quest_drinking_water + override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val achievements = listOf(OUTDOORS) + + override fun getTitle(tags: Map) = R.string.quest_camp_drinking_water_title + + override fun createForm() = YesNoQuestForm() + + override fun applyAnswerTo(answer: Boolean, tags: Tags, timestampEdited: Long) { + tags["drinking_water"] = answer.toYesNo() + } +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ffcd9cdda6..4bd296244f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,6 +842,8 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning + "Does it have drinking water?" + What kind of car wash is this? Automated Self-service From 036b1c75c2e4a0a2932daf232fde1ffb2682192f Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 01:55:40 +0200 Subject: [PATCH 02/33] fix names --- .../streetcomplete/quests/camping/AddCampDrinkingWater.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt index 0b31577db8..658c7efe07 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -1,4 +1,4 @@ -package de.westnordost.streetcomplete.quests.camp_drinking_water +package de.westnordost.streetcomplete.quests.camping import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.data.osm.mapdata.Element @@ -10,7 +10,7 @@ import de.westnordost.streetcomplete.osm.Tags import de.westnordost.streetcomplete.quests.YesNoQuestForm import de.westnordost.streetcomplete.util.ktx.toYesNo -class AddIsDefibrillatorIndoor : OsmFilterQuestType() { +class AddCampDrinkingWater : OsmFilterQuestType() { override val elementFilter = """ nodes, ways with ( From 98943df96475a66677ba08d8f25518a6053571df Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 19:30:45 +0200 Subject: [PATCH 03/33] camp shower=* quest --- .../streetcomplete/quests/QuestsModule.kt | 4 ++- .../quests/camping/AddCampShower.kt | 36 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt 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 38d0379aa3..798a67b52d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt @@ -43,6 +43,7 @@ import de.westnordost.streetcomplete.quests.bus_stop_ref.AddBusStopRef import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter import de.westnordost.streetcomplete.quests.camera_type.AddCameraType import de.westnordost.streetcomplete.quests.camping.AddCampDrinkingWater +import de.westnordost.streetcomplete.quests.camping.AddCampShower import de.westnordost.streetcomplete.quests.car_wash_type.AddCarWashType import de.westnordost.streetcomplete.quests.charging_station_capacity.AddChargingStationCapacity import de.westnordost.streetcomplete.quests.charging_station_operator.AddChargingStationOperator @@ -400,8 +401,9 @@ fun questTypeRegistry( AddIsDefibrillatorIndoor(), // need to go inside in case it is inside (or gone) - // camping site + // inside camping sites AddCampDrinkingWater(), + AddCampShower(), // toilets AddToiletAvailability(), // OSM Carto, shown in OsmAnd descriptions diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt new file mode 100644 index 0000000000..79e26b62c0 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt @@ -0,0 +1,36 @@ +package de.westnordost.streetcomplete.quests.camping + +import de.westnordost.streetcomplete.R +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.OUTDOORS +import de.westnordost.streetcomplete.osm.Tags +import de.westnordost.streetcomplete.quests.YesNoQuestForm +import de.westnordost.streetcomplete.util.ktx.toYesNo + +class AddCampShower : OsmFilterQuestType() { + + /* We only resurvey shower=yes and shower=no, as it might have more detailed + * values from other editors, and we don't want to damage them */ + override val elementFilter = """ + nodes, ways with ( + tourism=camp_site + ) + and (!shower or (shower older today -4 years and shower ~ yes|no)) + """ + override val changesetComment = "Specify whether there are showers available at camp site" + override val wikiLink = "Key:shower" + override val icon = R.drawable.ic_quest_camp_shower + override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val achievements = listOf(OUTDOORS) + + override fun getTitle(tags: Map) = R.string.quest_camp_shower_title + + override fun createForm() = YesNoQuestForm() + + override fun applyAnswerTo(answer: Boolean, tags: Tags, timestampEdited: Long) { + tags["shower"] = answer.toYesNo() + } +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4bd296244f..6d119cb6ea 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -843,6 +843,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Panning "Does it have drinking water?" + "Does it have showers?" What kind of car wash is this? Automated From 313fbb0f3beb2935942c975a59132efc92c036b2 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 19:32:59 +0200 Subject: [PATCH 04/33] camp shower placeholder --- .../res/drawable/ic_quest_camp_shower.xml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app/src/main/res/drawable/ic_quest_camp_shower.xml diff --git a/app/src/main/res/drawable/ic_quest_camp_shower.xml b/app/src/main/res/drawable/ic_quest_camp_shower.xml new file mode 100644 index 0000000000..e056d75a49 --- /dev/null +++ b/app/src/main/res/drawable/ic_quest_camp_shower.xml @@ -0,0 +1,36 @@ + + + + + + + + + From 497a2b90425a96be05df0be6498edb78d2acdf8d Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 19:37:54 +0200 Subject: [PATCH 05/33] placeholder icon ic_quest_camp_shower.xml --- .../res/drawable/ic_quest_camp_shower.xml | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/app/src/main/res/drawable/ic_quest_camp_shower.xml b/app/src/main/res/drawable/ic_quest_camp_shower.xml index e056d75a49..1de48929c9 100644 --- a/app/src/main/res/drawable/ic_quest_camp_shower.xml +++ b/app/src/main/res/drawable/ic_quest_camp_shower.xml @@ -5,32 +5,26 @@ android:viewportHeight="128"> + android:fillColor="#000" + android:pathData="m94.199,27.08c-4.436,0 -8.033,3.596 -8.033,8.033s3.597,8.033 8.033,8.033c4.437,0 8.035,-3.596 8.035,-8.033s-3.598,-8.033 -8.035,-8.033zM90.199,46.08c-2.833,0 -5.151,2.418 -6.865,3.98 -4.577,3.772 -4.808,10.958 -9.631,14.363 -4.555,2.934 -0.023,9.733 4.438,6.656 5.16,-3.617 5.85,-9.738 9.604,-14.072 0.157,11.058 -9.362,20.457 -9.545,30.072 0,2.209 1.791,4 4,4h2.924l-0.924,12c-0.076,5.409 8.076,5.409 8,0v-12h4v12c-0.076,5.409 8.076,5.409 8,0l-0.924,-12h2.924c2.209,-0 4,-1.791 4,-4 -1.452,-11.037 -8.736,-20.099 -9.549,-30.127 3.961,4.454 5.201,11.195 9.447,14.127 4.461,3.076 8.993,-3.722 4.438,-6.656 -4.792,-4.204 -5.12,-10.413 -9.461,-14.379 -1.726,-1.555 -4.042,-3.965 -6.875,-3.965 -3.66,1.794 -5.768,0.785 -8,0z" + android:fillAlpha="0.2"/> + android:fillColor="#000" + android:pathData="m64.2,8.04a3,3 0,0 0,-2.955 3.043v112a3,3 0,1 0,6 0v-112a3,3 0,0 0,-3.045 -3.043z" + android:fillAlpha="0.2"/> + android:pathData="m34,23.1c-4.436,0 -8.033,3.598 -8.033,8.035s3.597,8.031 8.033,8.031c4.437,0 8.033,-3.594 8.033,-8.031 0,-4.437 -3.596,-8.035 -8.033,-8.035zM28.801,42.1c-4.265,0 -7.702,2.594 -9.848,5.563s-3.454,6.463 -4.412,9.85c-1.916,6.773 -2.305,13.336 -2.305,13.336 -0.401,5.38 7.706,5.891 7.984,0.504 0,0 0.397,-5.937 2.018,-11.664 0.905,-2.85 1.994,-5.642 3.627,-7.863l-3.637,47.275c-0.076,5.409 8.076,5.409 8,0l2,-24h4l2,24c-0.076,5.409 8.076,5.409 8,0l-3.637,-47.275c1.746,2.367 2.928,5.436 3.627,7.863 1.62,5.727 2.018,11.664 2.018,11.664 0.279,5.387 8.385,4.876 7.984,-0.504 0,0 -0.389,-6.563 -2.305,-13.336 -0.958,-3.386 -2.266,-6.881 -4.412,-9.85s-5.582,-5.563 -9.848,-5.563c-3.692,1.378 -7.306,1.288 -10.855,0z" + android:fillColor="#fff"/> + android:pathData="m94.199,23.1c-4.436,0 -8.033,3.598 -8.033,8.035s3.597,8.031 8.033,8.031c4.437,0 8.035,-3.594 8.035,-8.031s-3.598,-8.035 -8.035,-8.035zM90.199,42.1c-2.833,0 -5.151,2.418 -6.865,3.98 -4.577,3.772 -4.808,10.958 -9.631,14.363 -4.555,2.934 -0.023,9.733 4.438,6.656 5.16,-3.617 5.85,-9.738 9.604,-14.072 0.157,11.058 -9.362,20.457 -9.545,30.072 0,2.209 1.791,4 4,4h2.924l-0.924,12c-0.076,5.409 8.076,5.409 8,0v-12h4v12c-0.076,5.409 8.076,5.409 8,0l-0.924,-12h2.924c2.209,-0 4,-1.791 4,-4 -1.452,-11.037 -8.736,-20.099 -9.549,-30.127 3.961,4.454 5.201,11.195 9.447,14.127 4.461,3.076 8.993,-3.722 4.438,-6.656 -4.792,-4.204 -5.12,-10.413 -9.461,-14.379 -1.726,-1.555 -4.042,-3.965 -6.875,-3.965 -3.66,1.794 -5.768,0.785 -8,0z" + android:fillColor="#fff"/> + android:pathData="m64.2,4.06a3,3 0,0 0,-2.955 3.043v112a3,3 0,1 0,6 0v-112a3,3 0,0 0,-3.045 -3.043z" + android:fillColor="#fff"/> From c12b495edea88d4c93b93af5371acbf373c234bb Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 21:05:34 +0200 Subject: [PATCH 06/33] camp power_supply=* quest --- .../streetcomplete/quests/QuestsModule.kt | 2 ++ .../quests/camping/AddCampPower.kt | 36 +++++++++++++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 39 insertions(+) create mode 100644 app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt 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 798a67b52d..cff034cc5d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt @@ -43,6 +43,7 @@ import de.westnordost.streetcomplete.quests.bus_stop_ref.AddBusStopRef import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter import de.westnordost.streetcomplete.quests.camera_type.AddCameraType import de.westnordost.streetcomplete.quests.camping.AddCampDrinkingWater +import de.westnordost.streetcomplete.quests.camping.AddCampPower import de.westnordost.streetcomplete.quests.camping.AddCampShower import de.westnordost.streetcomplete.quests.car_wash_type.AddCarWashType import de.westnordost.streetcomplete.quests.charging_station_capacity.AddChargingStationCapacity @@ -404,6 +405,7 @@ fun questTypeRegistry( // inside camping sites AddCampDrinkingWater(), AddCampShower(), + AddCampPower(), // toilets AddToiletAvailability(), // OSM Carto, shown in OsmAnd descriptions diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt new file mode 100644 index 0000000000..c9a9486771 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt @@ -0,0 +1,36 @@ +package de.westnordost.streetcomplete.quests.camping + +import de.westnordost.streetcomplete.R +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.OUTDOORS +import de.westnordost.streetcomplete.osm.Tags +import de.westnordost.streetcomplete.quests.YesNoQuestForm +import de.westnordost.streetcomplete.util.ktx.toYesNo + +class AddCampPower : OsmFilterQuestType() { + + /* We only resurvey power_supply=yes and power_supply=no, as it might have more detailed + * values from other editors, and we don't want to damage them */ + override val elementFilter = """ + nodes, ways with ( + tourism=camp_site + ) + and (!power_supply or (power_supply older today -4 years and power_supply ~ yes|no)) + """ + override val changesetComment = "Specify whether there is electricity available at camp site" + override val wikiLink = "Key:power_supply" + override val icon = R.drawable.ic_quest_camp_power_supply + override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val achievements = listOf(OUTDOORS) + + override fun getTitle(tags: Map) = R.string.quest_camp_power_supply_title + + override fun createForm() = YesNoQuestForm() + + override fun applyAnswerTo(answer: Boolean, tags: Tags, timestampEdited: Long) { + tags["power_supply"] = answer.toYesNo() + } +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6d119cb6ea..8dfddbe393 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -844,6 +844,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we "Does it have drinking water?" "Does it have showers?" + "Can you charge your phone/laptop here?" What kind of car wash is this? Automated From 999102c49430d2ab24009b3dcaba7c7f9da9683d Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 21:05:50 +0200 Subject: [PATCH 07/33] ic_quest_camp_power_supply.xml placeholder --- .../drawable/ic_quest_camp_power_supply.xml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 app/src/main/res/drawable/ic_quest_camp_power_supply.xml diff --git a/app/src/main/res/drawable/ic_quest_camp_power_supply.xml b/app/src/main/res/drawable/ic_quest_camp_power_supply.xml new file mode 100644 index 0000000000..f5949c4f80 --- /dev/null +++ b/app/src/main/res/drawable/ic_quest_camp_power_supply.xml @@ -0,0 +1,22 @@ + + + + + From 519b1b8e677c3554d77135d6f31513b4706b0a17 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 23:21:10 +0200 Subject: [PATCH 08/33] camp type (tents=* / caravans=*) quest --- .../streetcomplete/quests/QuestsModule.kt | 2 + .../quests/camping/AddCampType.kt | 37 +++++++++++++++++++ .../quests/camping/AddCampTypeForm.kt | 17 +++++++++ .../streetcomplete/quests/camping/CampType.kt | 7 ++++ app/src/main/res/values/strings.xml | 10 +++-- 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt create mode 100644 app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt create mode 100644 app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt 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 cff034cc5d..962d0ad5c8 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt @@ -45,6 +45,7 @@ import de.westnordost.streetcomplete.quests.camera_type.AddCameraType import de.westnordost.streetcomplete.quests.camping.AddCampDrinkingWater import de.westnordost.streetcomplete.quests.camping.AddCampPower import de.westnordost.streetcomplete.quests.camping.AddCampShower +import de.westnordost.streetcomplete.quests.camping.AddCampType import de.westnordost.streetcomplete.quests.car_wash_type.AddCarWashType import de.westnordost.streetcomplete.quests.charging_station_capacity.AddChargingStationCapacity import de.westnordost.streetcomplete.quests.charging_station_operator.AddChargingStationOperator @@ -403,6 +404,7 @@ fun questTypeRegistry( AddIsDefibrillatorIndoor(), // need to go inside in case it is inside (or gone) // inside camping sites + AddCampType(), AddCampDrinkingWater(), AddCampShower(), AddCampPower(), diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt new file mode 100644 index 0000000000..7edeb479f9 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -0,0 +1,37 @@ +package de.westnordost.streetcomplete.quests.camping + +import de.westnordost.streetcomplete.R +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.OUTDOORS +import de.westnordost.streetcomplete.osm.Tags +import de.westnordost.streetcomplete.util.ktx.toYesNo + +class AddCampType : OsmFilterQuestType() { + + override val elementFilter = """ + nodes, ways with ( + tourism=camp_site + ) + and (!caravans or !tents) + """ + override val changesetComment = "Survey who may camp here" + override val wikiLink = "Key:caravans" + override val icon = R.drawable.ic_quest_camp_type + override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val achievements = listOf(OUTDOORS) + + override fun getTitle(tags: Map) = R.string.quest_camp_type_title + + override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = + getMapData().filter("nodes, ways with tourism=camp_site") + + override fun createForm() = AddCampTypeForm() + + override fun applyAnswerTo(answer: CampType, tags: Tags, timestampEdited: Long) { + tags["tents"] = answer.tents.toYesNo() + tags["caravans"] = answer.caravans.toYesNo() + } +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt new file mode 100644 index 0000000000..09e485ccff --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt @@ -0,0 +1,17 @@ +package de.westnordost.streetcomplete.quests.camping + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.quests.AListQuestForm +import de.westnordost.streetcomplete.quests.TextItem +import de.westnordost.streetcomplete.quests.camping.CampType.CARAVANS_ONLY +import de.westnordost.streetcomplete.quests.camping.CampType.TENTS_AND_CARAVANS +import de.westnordost.streetcomplete.quests.camping.CampType.TENTS_ONLY + +class AddCampTypeForm : AListQuestForm() { + + override val items = listOf( + TextItem(TENTS_AND_CARAVANS, R.string.quest_camp_type_tents_and_caravans), + TextItem(CARAVANS_ONLY, R.string.quest_camp_type_caravans_only), + TextItem(TENTS_ONLY, R.string.quest_camp_type_tents_only), + ) +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt new file mode 100644 index 0000000000..9de96e2df1 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt @@ -0,0 +1,7 @@ +package de.westnordost.streetcomplete.quests.camping + +enum class CampType(val tents: Boolean, val caravans: Boolean) { + TENTS_AND_CARAVANS(true, true), + CARAVANS_ONLY(false, true), + TENTS_ONLY(true, false), +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8dfddbe393..9850c168ae 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,9 +842,13 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning - "Does it have drinking water?" - "Does it have showers?" - "Can you charge your phone/laptop here?" + Does it have drinking water? + Does it have showers? + Can you charge your phone/laptop here? + Who may camp here? + Both tents and caravans + Only caravans + Only tents What kind of car wash is this? Automated From 1e59e6167a8a05bfb38cb34c7d8e18169911395e Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 23:23:59 +0200 Subject: [PATCH 09/33] highlight nearby tourism=camp_site --- .../streetcomplete/quests/camping/AddCampDrinkingWater.kt | 3 +++ .../westnordost/streetcomplete/quests/camping/AddCampPower.kt | 3 +++ .../westnordost/streetcomplete/quests/camping/AddCampShower.kt | 3 +++ 3 files changed, 9 insertions(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt index 658c7efe07..e4c458d1c8 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -26,6 +26,9 @@ class AddCampDrinkingWater : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_drinking_water_title + override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = + getMapData().filter("nodes, ways with tourism=camp_site") + override fun createForm() = YesNoQuestForm() override fun applyAnswerTo(answer: Boolean, tags: Tags, timestampEdited: Long) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt index c9a9486771..60207c1166 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt @@ -28,6 +28,9 @@ class AddCampPower : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_power_supply_title + override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = + getMapData().filter("nodes, ways with tourism=camp_site") + override fun createForm() = YesNoQuestForm() override fun applyAnswerTo(answer: Boolean, tags: Tags, timestampEdited: Long) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt index 79e26b62c0..7481d3fd51 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt @@ -28,6 +28,9 @@ class AddCampShower : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_shower_title + override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = + getMapData().filter("nodes, ways with tourism=camp_site") + override fun createForm() = YesNoQuestForm() override fun applyAnswerTo(answer: Boolean, tags: Tags, timestampEdited: Long) { From daeda7788e785a51298195ab0f7150a5f3debdbd Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 23:35:46 +0200 Subject: [PATCH 10/33] backcountry=* OtherAnswers --- .../streetcomplete/quests/camping/AddCampTypeForm.kt | 5 +++++ .../de/westnordost/streetcomplete/quests/camping/CampType.kt | 1 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 7 insertions(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt index 09e485ccff..d0171c08c3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt @@ -3,6 +3,7 @@ package de.westnordost.streetcomplete.quests.camping import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.quests.AListQuestForm import de.westnordost.streetcomplete.quests.TextItem +import de.westnordost.streetcomplete.quests.camping.CampType.BACKCOUNTRY import de.westnordost.streetcomplete.quests.camping.CampType.CARAVANS_ONLY import de.westnordost.streetcomplete.quests.camping.CampType.TENTS_AND_CARAVANS import de.westnordost.streetcomplete.quests.camping.CampType.TENTS_ONLY @@ -14,4 +15,8 @@ class AddCampTypeForm : AListQuestForm() { TextItem(CARAVANS_ONLY, R.string.quest_camp_type_caravans_only), TextItem(TENTS_ONLY, R.string.quest_camp_type_tents_only), ) + + override val otherAnswers get() = listOfNotNull( + AnswerItem(R.string.quest_camp_type_backcountry) { applyAnswer(BACKCOUNTRY) }, + ) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt index 9de96e2df1..4a66dc33b0 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt @@ -4,4 +4,5 @@ enum class CampType(val tents: Boolean, val caravans: Boolean) { TENTS_AND_CARAVANS(true, true), CARAVANS_ONLY(false, true), TENTS_ONLY(true, false), + BACKCOUNTRY(false, false), } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9850c168ae..8aed871bf9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -849,6 +849,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Both tents and caravans Only caravans Only tents + Backcountry camping (no facilities) What kind of car wash is this? Automated From 9fb6d8fd304fab1cdcd85f4c01bca80e4cd5c7ad Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 23:39:37 +0200 Subject: [PATCH 11/33] implement backcounty=yes answer --- .../streetcomplete/quests/camping/AddCampType.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt index 7edeb479f9..493c2e8d74 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -31,7 +31,11 @@ class AddCampType : OsmFilterQuestType() { override fun createForm() = AddCampTypeForm() override fun applyAnswerTo(answer: CampType, tags: Tags, timestampEdited: Long) { - tags["tents"] = answer.tents.toYesNo() - tags["caravans"] = answer.caravans.toYesNo() + if (answer.tents || answer.caravans) { + tags["tents"] = answer.tents.toYesNo() + tags["caravans"] = answer.caravans.toYesNo() + } else { + tags["backcountry"] = "yes" + } } } From b0c66f6204c5d66b12b2f65ea5d70405b6d00fac Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Fri, 15 Jul 2022 23:58:54 +0200 Subject: [PATCH 12/33] add placeholder ic_quest_camp_type.xml --- app/src/main/res/drawable/ic_quest_camp_type.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/src/main/res/drawable/ic_quest_camp_type.xml diff --git a/app/src/main/res/drawable/ic_quest_camp_type.xml b/app/src/main/res/drawable/ic_quest_camp_type.xml new file mode 100644 index 0000000000..a895c1019c --- /dev/null +++ b/app/src/main/res/drawable/ic_quest_camp_type.xml @@ -0,0 +1,16 @@ + + + + + From c53c595ed6a30baa86d402ac6a21536704fca5e7 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sat, 16 Jul 2022 00:01:58 +0200 Subject: [PATCH 13/33] missing include --- .../westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt index d0171c08c3..3aba3ebc52 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt @@ -3,6 +3,7 @@ package de.westnordost.streetcomplete.quests.camping import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.quests.AListQuestForm import de.westnordost.streetcomplete.quests.TextItem +import de.westnordost.streetcomplete.quests.AnswerItem import de.westnordost.streetcomplete.quests.camping.CampType.BACKCOUNTRY import de.westnordost.streetcomplete.quests.camping.CampType.CARAVANS_ONLY import de.westnordost.streetcomplete.quests.camping.CampType.TENTS_AND_CARAVANS From 182b19202370b763928243b508d1afcb7eabbb74 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sat, 16 Jul 2022 00:31:00 +0200 Subject: [PATCH 14/33] skip backcountry camping sites --- .../de/westnordost/streetcomplete/quests/camping/AddCampType.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt index 493c2e8d74..b4380a3058 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -16,6 +16,7 @@ class AddCampType : OsmFilterQuestType() { tourism=camp_site ) and (!caravans or !tents) + and !backcountry """ override val changesetComment = "Survey who may camp here" override val wikiLink = "Key:caravans" From 4538d3deb5e35753878c65d98f1d1ddd5ec4c71a Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sat, 16 Jul 2022 00:41:55 +0200 Subject: [PATCH 15/33] try to improve wording --- app/src/main/res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8aed871bf9..c4470176a1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,9 +842,9 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning - Does it have drinking water? + Does it have freely available drinking water? Does it have showers? - Can you charge your phone/laptop here? + Can anyone charge their phone/laptop here? Who may camp here? Both tents and caravans Only caravans From 627b14342c2412f5b2903c290ca9f0856574fb85 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sat, 16 Jul 2022 00:58:12 +0200 Subject: [PATCH 16/33] further refine wording of questions --- app/src/main/res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c4470176a1..3187cc47cd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,9 +842,9 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning - Does it have freely available drinking water? + Is drinking water available to all customers here? Does it have showers? - Can anyone charge their phone/laptop here? + Can any customer charge their phone/laptop here? Who may camp here? Both tents and caravans Only caravans From bc15545e0d8e323f76bfa6c8cb6b8d0a659d13a4 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Tue, 19 Jul 2022 09:18:42 +0200 Subject: [PATCH 17/33] Reformat quest filters --- .../quests/camping/AddCampDrinkingWater.kt | 9 ++++----- .../streetcomplete/quests/camping/AddCampPower.kt | 13 +++++++------ .../streetcomplete/quests/camping/AddCampShower.kt | 13 +++++++------ .../streetcomplete/quests/camping/AddCampType.kt | 11 +++++------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt index e4c458d1c8..83d7e6d212 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -13,10 +13,9 @@ import de.westnordost.streetcomplete.util.ktx.toYesNo class AddCampDrinkingWater : OsmFilterQuestType() { override val elementFilter = """ - nodes, ways with ( - tourism=camp_site - ) - and (!drinking_water or drinking_water older today -4 years) + nodes, ways with + tourism = camp_site + and (!drinking_water or drinking_water older today -4 years) """ override val changesetComment = "Specify whether there is drinking water in camp site" override val wikiLink = "Key:drinking_water" @@ -27,7 +26,7 @@ class AddCampDrinkingWater : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_drinking_water_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = - getMapData().filter("nodes, ways with tourism=camp_site") + getMapData().filter("nodes, ways with tourism = camp_site") override fun createForm() = YesNoQuestForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt index 60207c1166..056cbb091f 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampPower.kt @@ -12,13 +12,14 @@ import de.westnordost.streetcomplete.util.ktx.toYesNo class AddCampPower : OsmFilterQuestType() { - /* We only resurvey power_supply=yes and power_supply=no, as it might have more detailed + /* We only resurvey power_supply = yes and power_supply = no, as it might have more detailed * values from other editors, and we don't want to damage them */ override val elementFilter = """ - nodes, ways with ( - tourism=camp_site - ) - and (!power_supply or (power_supply older today -4 years and power_supply ~ yes|no)) + nodes, ways with + tourism = camp_site and ( + !power_supply + or power_supply older today -4 years and power_supply ~ yes|no + ) """ override val changesetComment = "Specify whether there is electricity available at camp site" override val wikiLink = "Key:power_supply" @@ -29,7 +30,7 @@ class AddCampPower : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_power_supply_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = - getMapData().filter("nodes, ways with tourism=camp_site") + getMapData().filter("nodes, ways with tourism = camp_site") override fun createForm() = YesNoQuestForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt index 7481d3fd51..566dff2606 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampShower.kt @@ -12,13 +12,14 @@ import de.westnordost.streetcomplete.util.ktx.toYesNo class AddCampShower : OsmFilterQuestType() { - /* We only resurvey shower=yes and shower=no, as it might have more detailed + /* We only resurvey shower = yes and shower = no, as it might have more detailed * values from other editors, and we don't want to damage them */ override val elementFilter = """ - nodes, ways with ( - tourism=camp_site - ) - and (!shower or (shower older today -4 years and shower ~ yes|no)) + nodes, ways with + tourism = camp_site and ( + !shower + or shower older today -4 years and shower ~ yes|no + ) """ override val changesetComment = "Specify whether there are showers available at camp site" override val wikiLink = "Key:shower" @@ -29,7 +30,7 @@ class AddCampShower : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_shower_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = - getMapData().filter("nodes, ways with tourism=camp_site") + getMapData().filter("nodes, ways with tourism = camp_site") override fun createForm() = YesNoQuestForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt index b4380a3058..8090d2f835 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -12,11 +12,10 @@ import de.westnordost.streetcomplete.util.ktx.toYesNo class AddCampType : OsmFilterQuestType() { override val elementFilter = """ - nodes, ways with ( - tourism=camp_site - ) - and (!caravans or !tents) - and !backcountry + nodes, ways with + tourism = camp_site + and (!caravans or !tents) + and !backcountry """ override val changesetComment = "Survey who may camp here" override val wikiLink = "Key:caravans" @@ -27,7 +26,7 @@ class AddCampType : OsmFilterQuestType() { override fun getTitle(tags: Map) = R.string.quest_camp_type_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = - getMapData().filter("nodes, ways with tourism=camp_site") + getMapData().filter("nodes, ways with tourism = camp_site") override fun createForm() = AddCampTypeForm() From a38b2321dafe06c6534de6a7845807e7a00bb4fc Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sun, 31 Jul 2022 11:34:58 +0200 Subject: [PATCH 18/33] update language suggestions from code review Co-authored-by: Peter Newman --- .../streetcomplete/quests/camping/AddCampDrinkingWater.kt | 2 +- app/src/main/res/values/strings.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt index 83d7e6d212..701a27f5b2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -17,7 +17,7 @@ class AddCampDrinkingWater : OsmFilterQuestType() { tourism = camp_site and (!drinking_water or drinking_water older today -4 years) """ - override val changesetComment = "Specify whether there is drinking water in camp site" + override val changesetComment = "Specify whether there is drinking water at camp site" override val wikiLink = "Key:drinking_water" override val icon = R.drawable.ic_quest_drinking_water override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3187cc47cd..ce44c1a6df 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -843,8 +843,8 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Panning Is drinking water available to all customers here? - Does it have showers? - Can any customer charge their phone/laptop here? + Are there showers here? + Can customers charge their phone/laptop here? Who may camp here? Both tents and caravans Only caravans From cee6f6b88ca67d8c4457f086dc655c0c4869600f Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sun, 31 Jul 2022 11:53:15 +0200 Subject: [PATCH 19/33] Update app/src/main/res/values/strings.xml Co-authored-by: Peter Newman --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ce44c1a6df..5c6174911a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,7 +842,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning - Is drinking water available to all customers here? + Is drinking water available to customers here? Are there showers here? Can customers charge their phone/laptop here? Who may camp here? From dff7779c70e95b8fa4993afc9663a37cce18e31b Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sun, 31 Jul 2022 11:56:37 +0200 Subject: [PATCH 20/33] update order of answers to be more logical Co-authored-by: Peter Newman --- .../streetcomplete/quests/camping/AddCampTypeForm.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt index 3aba3ebc52..b93112c70e 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampTypeForm.kt @@ -13,8 +13,8 @@ class AddCampTypeForm : AListQuestForm() { override val items = listOf( TextItem(TENTS_AND_CARAVANS, R.string.quest_camp_type_tents_and_caravans), - TextItem(CARAVANS_ONLY, R.string.quest_camp_type_caravans_only), TextItem(TENTS_ONLY, R.string.quest_camp_type_tents_only), + TextItem(CARAVANS_ONLY, R.string.quest_camp_type_caravans_only), ) override val otherAnswers get() = listOfNotNull( From 24d9dac6a4cb76aec8cf1979c6428cefda70cb29 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sun, 31 Jul 2022 11:57:09 +0200 Subject: [PATCH 21/33] Update app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt just ordering Co-authored-by: Peter Newman --- .../de/westnordost/streetcomplete/quests/camping/CampType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt index 4a66dc33b0..867d608efa 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt @@ -2,7 +2,7 @@ package de.westnordost.streetcomplete.quests.camping enum class CampType(val tents: Boolean, val caravans: Boolean) { TENTS_AND_CARAVANS(true, true), - CARAVANS_ONLY(false, true), TENTS_ONLY(true, false), + CARAVANS_ONLY(false, true), BACKCOUNTRY(false, false), } From 54f6f0d9b9995b68b40be009188e1df539536284 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sun, 31 Jul 2022 12:11:27 +0200 Subject: [PATCH 22/33] drinking water too may have more values than yes/no Co-authored-by: Peter Newman --- .../quests/camping/AddCampDrinkingWater.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt index 701a27f5b2..6813a7f39c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -12,10 +12,15 @@ import de.westnordost.streetcomplete.util.ktx.toYesNo class AddCampDrinkingWater : OsmFilterQuestType() { + /* We only resurvey drinking_water = yes and drinking_water = no, as it might have more detailed + * values from other editors, and we don't want to damage them */ override val elementFilter = """ nodes, ways with - tourism = camp_site - and (!drinking_water or drinking_water older today -4 years) + nodes, ways with + tourism = camp_site and ( + !drinking_water + or drinking_water older today -4 years and drinking_water ~ yes|no + ) """ override val changesetComment = "Specify whether there is drinking water at camp site" override val wikiLink = "Key:drinking_water" From 270a6947c5f9c7f33fce73ab42546ebc42fa3914 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sun, 31 Jul 2022 12:20:11 +0200 Subject: [PATCH 23/33] you can often see caravans and/or tents from the outside, so no need for disabled-by-default see https://github.com/streetcomplete/StreetComplete/pull/4213#discussion_r924139457 --- .../westnordost/streetcomplete/quests/camping/AddCampType.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt index 8090d2f835..bb171181b3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -20,7 +20,8 @@ class AddCampType : OsmFilterQuestType() { override val changesetComment = "Survey who may camp here" override val wikiLink = "Key:caravans" override val icon = R.drawable.ic_quest_camp_type - override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + // you can often see caravans and/or tents from the outside, so usually there is no need for this quest to be disabled by default + //override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside override val achievements = listOf(OUTDOORS) override fun getTitle(tags: Map) = R.string.quest_camp_type_title From de73e46b72fb364db1c39b8e2956e98ef57299bb Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 3 Aug 2022 12:49:35 +0200 Subject: [PATCH 24/33] initial camp tent icon (update color to green, inkscape optimized SVG) --- res/graphics/authors.txt | 3 +++ res/graphics/camping/camp.svg | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 res/graphics/camping/camp.svg diff --git a/res/graphics/authors.txt b/res/graphics/authors.txt index 69d811da26..2ab08eae69 100644 --- a/res/graphics/authors.txt +++ b/res/graphics/authors.txt @@ -138,6 +138,9 @@ building levels/ building_levels_icon.svg building_levels_illustration.svg +camping/ + camp.svg https://commons.wikimedia.org/wiki/File:Noun_camp_2695642.svg, Bluerasberry CC-BY 4.0 + cycleway/ bus_lane.svg bus_lane_l.svg diff --git a/res/graphics/camping/camp.svg b/res/graphics/camping/camp.svg new file mode 100644 index 0000000000..7bcfe3e1bc --- /dev/null +++ b/res/graphics/camping/camp.svg @@ -0,0 +1,2 @@ + +image/svg+xml From 91e91a3e6cbfd0d9fc7a51570e39fee710ffd424 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 3 Aug 2022 12:56:22 +0200 Subject: [PATCH 25/33] update ic_quest_camp_type.xml --- .../main/res/drawable/ic_quest_camp_type.xml | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/app/src/main/res/drawable/ic_quest_camp_type.xml b/app/src/main/res/drawable/ic_quest_camp_type.xml index a895c1019c..9de4914537 100644 --- a/app/src/main/res/drawable/ic_quest_camp_type.xml +++ b/app/src/main/res/drawable/ic_quest_camp_type.xml @@ -1,16 +1,9 @@ - + - - - + android:pathData="M64 2c-34.187 0 -62 27.813 -62 62s27.813 62 62 62 62 -27.813 62 -62 -27.813 -62 -62 -62zm-1.62 79.403h-38.538l-6.698 4.804v2.036c0 0.905 -0.736 1.639 -1.644 1.639s-1.644 -0.734 -1.644 -1.639v-7.051c0 -0.905 0.736 -1.639 1.644 -1.639s1.644 0.734 1.644 1.639v1.056l6.674 -4.786 14.844 -38.375c4.997 0.875 22.661 3.346 43.568 -0.967l-19.85 43.283zm12.681 0l9.981 -22.333 9.874 22.333h-19.855zm37.439 8.478c-0.908 0 -1.644 -0.734 -1.644 -1.639v-1.938l-8.357 -4.902h-3.99l-11.955 -27.038c-0.262 -0.593 -0.851 -0.977 -1.501 -0.978h-0.003c-0.649 0 -1.237 0.381 -1.502 0.972l-12.087 27.045h-5.465l19.09 -41.63 16.997 37.66 8.774 5.146v-1.387c0 -0.905 0.736 -1.639 1.644 -1.639s1.644 0.734 1.644 1.639v7.051c-0.001 0.904 -0.737 1.638 -1.645 1.638z" + android:fillColor="#9BBE55" /> + \ No newline at end of file From 52bf83036a9978b04d4237a742ca778e17085281 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 3 Aug 2022 13:36:00 +0200 Subject: [PATCH 26/33] fix broken rule after accepting suggestings --- .../streetcomplete/quests/camping/AddCampDrinkingWater.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt index 6813a7f39c..5df64ea914 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampDrinkingWater.kt @@ -15,7 +15,6 @@ class AddCampDrinkingWater : OsmFilterQuestType() { /* We only resurvey drinking_water = yes and drinking_water = no, as it might have more detailed * values from other editors, and we don't want to damage them */ override val elementFilter = """ - nodes, ways with nodes, ways with tourism = camp_site and ( !drinking_water From 6b30032015f417b06f8de18d74251d3c50ef9c39 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 3 Aug 2022 16:51:20 +0200 Subject: [PATCH 27/33] clarify drinking_water quest wording --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5c6174911a..200c61f5d7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,7 +842,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning - Is drinking water available to customers here? + Is drinking water freely available to customers here? Are there showers here? Can customers charge their phone/laptop here? Who may camp here? From 79082ece591118edb1847ee872fae9bd9d1c2817 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Mon, 8 Aug 2022 15:59:00 +0200 Subject: [PATCH 28/33] Update res/graphics/authors.txt Co-authored-by: Mateusz Konieczny --- res/graphics/authors.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/graphics/authors.txt b/res/graphics/authors.txt index 2ab08eae69..5bcbde9e59 100644 --- a/res/graphics/authors.txt +++ b/res/graphics/authors.txt @@ -139,7 +139,7 @@ building levels/ building_levels_illustration.svg camping/ - camp.svg https://commons.wikimedia.org/wiki/File:Noun_camp_2695642.svg, Bluerasberry CC-BY 4.0 + camp.svg https://commons.wikimedia.org/wiki/File:Noun_camp_2695642.svg, sbts2018 (https://thenounproject.com/sbts2018/) CC-BY 4.0 cycleway/ bus_lane.svg From d04d6638f6b1866b2ba38cf32d0cbeee270f5a0b Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Tue, 9 Aug 2022 23:08:20 +0200 Subject: [PATCH 29/33] more precise text to ask for any way to charge phone/laptop --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 200c61f5d7..acf541b995 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -844,7 +844,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Is drinking water freely available to customers here? Are there showers here? - Can customers charge their phone/laptop here? + Is there any way for customers to charge their phone or laptop here? Who may camp here? Both tents and caravans Only caravans From b8bb4969eefb130264bd22e6aa7cacd635f267e3 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 10 Aug 2022 23:48:56 +0200 Subject: [PATCH 30/33] Update app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt Co-authored-by: Peter Newman --- .../de/westnordost/streetcomplete/quests/camping/CampType.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt index 867d608efa..d06a0b8195 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/CampType.kt @@ -4,5 +4,6 @@ enum class CampType(val tents: Boolean, val caravans: Boolean) { TENTS_AND_CARAVANS(true, true), TENTS_ONLY(true, false), CARAVANS_ONLY(false, true), + // Only the enum value is used here, the tent and caravan values are ignored. BACKCOUNTRY(false, false), } From 3ac552bba894698f38d211d80bb136d11bcc5add Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 10 Aug 2022 23:50:22 +0200 Subject: [PATCH 31/33] Update app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt cleaner BACKCOUNTRY matching Co-authored-by: Peter Newman --- .../streetcomplete/quests/camping/AddCampType.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt index bb171181b3..cff0d79237 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -32,11 +32,12 @@ class AddCampType : OsmFilterQuestType() { override fun createForm() = AddCampTypeForm() override fun applyAnswerTo(answer: CampType, tags: Tags, timestampEdited: Long) { - if (answer.tents || answer.caravans) { - tags["tents"] = answer.tents.toYesNo() - tags["caravans"] = answer.caravans.toYesNo() - } else { - tags["backcountry"] = "yes" + when (answer) { + BACKCOUNTRY -> tags["backcountry"] = "yes" + else -> { + tags["tents"] = answer.tents.toYesNo() + tags["caravans"] = answer.caravans.toYesNo() + } } } } From 1cda3e36f155c82358ff12fd79910595176a7589 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Wed, 10 Aug 2022 23:51:20 +0200 Subject: [PATCH 32/33] Update app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt Co-authored-by: Peter Newman --- .../de/westnordost/streetcomplete/quests/camping/AddCampType.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt index cff0d79237..0e3f48d896 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/camping/AddCampType.kt @@ -7,6 +7,7 @@ import de.westnordost.streetcomplete.data.osm.mapdata.filter import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.OUTDOORS import de.westnordost.streetcomplete.osm.Tags +import de.westnordost.streetcomplete.quests.camping.CampType.BACKCOUNTRY import de.westnordost.streetcomplete.util.ktx.toYesNo class AddCampType : OsmFilterQuestType() { From f2193f9553e468f51bd282b4cf975fb79643056d Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 17 Aug 2022 14:38:05 +0200 Subject: [PATCH 33/33] improve wordings --- app/src/main/res/values/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index acf541b995..6903eedbdd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -842,12 +842,12 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Fixed Panning - Is drinking water freely available to customers here? + Is drinking water freely available to campers here? Are there showers here? - Is there any way for customers to charge their phone or laptop here? + Is there any way for customers to charge their phone, laptop etc. here? Who may camp here? - Both tents and caravans - Only caravans + Both tents and RVs + Only RVs Only tents Backcountry camping (no facilities)