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 b9ec56f6df4..daab2febcc4 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.bike_shop.AddBikeRepairAvailability import de.westnordost.streetcomplete.quests.bike_shop.AddSecondHandBicycleAvailability import de.westnordost.streetcomplete.quests.board_name.AddBoardName import de.westnordost.streetcomplete.quests.board_type.AddBoardType +import de.westnordost.streetcomplete.quests.boat_rental.AddBoatRental import de.westnordost.streetcomplete.quests.bollard_type.AddBollardType import de.westnordost.streetcomplete.quests.bridge_structure.AddBridgeStructure import de.westnordost.streetcomplete.quests.building_entrance.AddEntrance @@ -455,6 +456,8 @@ fun questTypeRegistry( /* ↓ 4.quests that may need to go inside ------------------------------------------------ */ + 174 to AddBoatRental(), + 112 to AddWheelchairAccessPublicTransport(), // need to look out for lifts etc, maybe even enter the station 113 to AddIsAmenityIndoor(getFeature), // need to go inside in case it is inside (or gone) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/AddBoatRental.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/AddBoatRental.kt new file mode 100644 index 00000000000..9c13f087bfd --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/AddBoatRental.kt @@ -0,0 +1,40 @@ +package de.westnordost.streetcomplete.quests.boat_rental + +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.OUTDOORS +import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.RARE +import de.westnordost.streetcomplete.osm.Tags + +class AddBoatRental : OsmFilterQuestType>() { + + override val elementFilter = """ + nodes, ways with + amenity = boat_rental + and ( + ${BoatRental.entries.joinToString(" and ") { "!${it.osmValue}" }} + or ${DEPRECATED_RENTALS.joinToString(" or ")} + ) + """ + override val changesetComment = "Specify boats for rental" + override val wikiLink = "Tag:amenity=boat_rental" + override val icon = R.drawable.ic_quest_boat + override val achievements = listOf(OUTDOORS, RARE) + + override fun getTitle(tags: Map) = R.string.quest_boat_rental_title + + override fun createForm() = AddBoatRentalForm() + + override fun applyAnswerTo(answer: List, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { + answer.forEach { tags[it.osmValue] = "yes" } + // remove ambiguous ones that should have been specified correctly by the user's answer + DEPRECATED_RENTALS.forEach { tags.remove(it) } + } +} + +private val DEPRECATED_RENTALS = listOf( + // ambiguous: + // motor or rowing? what kind of board? rowing what? + "dinghy_rental", "paddleboard_rental", "board_rental", "rowing_rental" +) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/AddBoatRentalForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/AddBoatRentalForm.kt new file mode 100644 index 00000000000..2038f22242f --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/AddBoatRentalForm.kt @@ -0,0 +1,23 @@ +package de.westnordost.streetcomplete.quests.boat_rental + +import android.os.Bundle +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.quests.AImageListQuestForm + +class AddBoatRentalForm : AImageListQuestForm>() { + + override val items = BoatRental.entries.map { it.asItem() } + override val itemsPerRow = 3 + + override val maxSelectableItems = -1 + override val moveFavoritesToFront = false + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + imageSelector.cellLayoutId = R.layout.cell_icon_select_with_label_below + } + + override fun onClickOk(selectedItems: List) { + applyAnswer(selectedItems) + } +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/BoatRental.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/BoatRental.kt new file mode 100644 index 00000000000..68d82945bdb --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/BoatRental.kt @@ -0,0 +1,19 @@ +package de.westnordost.streetcomplete.quests.boat_rental + +enum class BoatRental(val osmValue: String) { + // sort order: first the small things + CANOE("canoe_rental"), + KAYAK("kayak_rental"), + PEDALBOAT("pedalboat_rental"), + SUP("standup_paddleboard_rental"), + ROWBOAT("rowboat_rental"), + SAILBOAT("sailboat_rental"), + RAFT("raft_rental"), + SURFBOARD("surfboard_rental"), + SAILBOARD("sailboard_rental"), + // then the big things + MOTORBOAT("motorboat_rental"), + JETSKI("jetski_rental"), + HOUSEBOAT("houseboat_rental"), + YACHT("yacht_rental"), +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/BoatRentalItem.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/BoatRentalItem.kt new file mode 100644 index 00000000000..7984dbdc629 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/boat_rental/BoatRentalItem.kt @@ -0,0 +1,38 @@ +package de.westnordost.streetcomplete.quests.boat_rental + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.quests.boat_rental.BoatRental.* +import de.westnordost.streetcomplete.view.image_select.Item + +fun BoatRental.asItem() = Item(this, iconResId, titleResId) + +private val BoatRental.titleResId: Int get() = when (this) { + CANOE -> R.string.quest_boat_rental_canoe + KAYAK -> R.string.quest_boat_rental_kayak + PEDALBOAT -> R.string.quest_boat_rental_pedalboat + SUP -> R.string.quest_boat_rental_standup_paddleboard + ROWBOAT -> R.string.quest_boat_rental_rowboat + SAILBOAT -> R.string.quest_boat_rental_sailboat + RAFT -> R.string.quest_boat_rental_raft + SURFBOARD -> R.string.quest_boat_rental_surfboard + SAILBOARD -> R.string.quest_boat_rental_sailboard + MOTORBOAT -> R.string.quest_boat_rental_motorboat + JETSKI -> R.string.quest_boat_rental_jetski + HOUSEBOAT -> R.string.quest_boat_rental_houseboat + YACHT -> R.string.quest_boat_rental_yacht +} +private val BoatRental.iconResId: Int get() = when (this) { + CANOE -> R.drawable.ic_boat_rental_canoe + KAYAK -> R.drawable.ic_boat_rental_kayak + PEDALBOAT -> R.drawable.ic_boat_rental_pedalboat + SUP -> R.drawable.ic_boat_rental_standup_paddleboard + ROWBOAT -> R.drawable.ic_boat_rental_rowboat + SAILBOAT -> R.drawable.ic_boat_rental_sailboat + RAFT -> R.drawable.ic_boat_rental_raft + SURFBOARD -> R.drawable.ic_boat_rental_surfboard + SAILBOARD -> R.drawable.ic_boat_rental_sailboard + MOTORBOAT -> R.drawable.ic_boat_rental_motorboat + JETSKI -> R.drawable.ic_boat_rental_jetski + HOUSEBOAT -> R.drawable.ic_boat_rental_houseboat + YACHT -> R.drawable.ic_boat_rental_yacht +} diff --git a/app/src/main/res/drawable/ic_boat_rental_canoe.xml b/app/src/main/res/drawable/ic_boat_rental_canoe.xml new file mode 100644 index 00000000000..709a90fcf0f --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_canoe.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_houseboat.xml b/app/src/main/res/drawable/ic_boat_rental_houseboat.xml new file mode 100644 index 00000000000..82f7c765d46 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_houseboat.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_jetski.xml b/app/src/main/res/drawable/ic_boat_rental_jetski.xml new file mode 100644 index 00000000000..ade8c9d29a9 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_jetski.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_kayak.xml b/app/src/main/res/drawable/ic_boat_rental_kayak.xml new file mode 100644 index 00000000000..ed04335bc26 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_kayak.xml @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_motorboat.xml b/app/src/main/res/drawable/ic_boat_rental_motorboat.xml new file mode 100644 index 00000000000..c6314823cd3 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_motorboat.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_pedalboat.xml b/app/src/main/res/drawable/ic_boat_rental_pedalboat.xml new file mode 100644 index 00000000000..f63ec49e13b --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_pedalboat.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_raft.xml b/app/src/main/res/drawable/ic_boat_rental_raft.xml new file mode 100644 index 00000000000..3c90c47a875 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_raft.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_rowboat.xml b/app/src/main/res/drawable/ic_boat_rental_rowboat.xml new file mode 100644 index 00000000000..bcc45d15bce --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_rowboat.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_sailboard.xml b/app/src/main/res/drawable/ic_boat_rental_sailboard.xml new file mode 100644 index 00000000000..bd661c97d73 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_sailboard.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_sailboat.xml b/app/src/main/res/drawable/ic_boat_rental_sailboat.xml new file mode 100644 index 00000000000..fa442dea7c5 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_sailboat.xml @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_standup_paddleboard.xml b/app/src/main/res/drawable/ic_boat_rental_standup_paddleboard.xml new file mode 100644 index 00000000000..d19c9846ea9 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_standup_paddleboard.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_surfboard.xml b/app/src/main/res/drawable/ic_boat_rental_surfboard.xml new file mode 100644 index 00000000000..989eaa36b04 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_surfboard.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_boat_rental_yacht.xml b/app/src/main/res/drawable/ic_boat_rental_yacht.xml new file mode 100644 index 00000000000..d4135048217 --- /dev/null +++ b/app/src/main/res/drawable/ic_boat_rental_yacht.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_quest_boat.xml b/app/src/main/res/drawable/ic_quest_boat.xml new file mode 100644 index 00000000000..06149693211 --- /dev/null +++ b/app/src/main/res/drawable/ic_quest_boat.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7017fc02588..5199da7e200 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -820,6 +820,21 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Is it just a map and only a map? If the board is about a particular topic, please specify it, regardless of whether it also includes a map. For example a public transport board may have a bus route map. If the topic is not listed among the available answers, please consider leaving a note instead. + Which type of boats are for rent here? + Motorboat + Jetski + Sailboat + Pedalboat + Kayak + Canoe + Houseboat + Rowboat + Raft + Surfboard + Sailboard + Yacht + Standup Paddleboard (SUP) + What type of bollard is this? Rising Removable (with or without key) diff --git a/res/graphics/boat_rental/canoe.svg b/res/graphics/boat rental/canoe.svg similarity index 100% rename from res/graphics/boat_rental/canoe.svg rename to res/graphics/boat rental/canoe.svg diff --git a/res/graphics/boat_rental/houseboat.svg b/res/graphics/boat rental/houseboat.svg similarity index 100% rename from res/graphics/boat_rental/houseboat.svg rename to res/graphics/boat rental/houseboat.svg diff --git a/res/graphics/boat_rental/jetski.svg b/res/graphics/boat rental/jetski.svg similarity index 100% rename from res/graphics/boat_rental/jetski.svg rename to res/graphics/boat rental/jetski.svg diff --git a/res/graphics/boat_rental/kayak.svg b/res/graphics/boat rental/kayak.svg similarity index 100% rename from res/graphics/boat_rental/kayak.svg rename to res/graphics/boat rental/kayak.svg diff --git a/res/graphics/boat_rental/motorboat.svg b/res/graphics/boat rental/motorboat.svg similarity index 100% rename from res/graphics/boat_rental/motorboat.svg rename to res/graphics/boat rental/motorboat.svg diff --git a/res/graphics/boat_rental/pedalboat.svg b/res/graphics/boat rental/pedalboat.svg similarity index 100% rename from res/graphics/boat_rental/pedalboat.svg rename to res/graphics/boat rental/pedalboat.svg diff --git a/res/graphics/boat_rental/raft.svg b/res/graphics/boat rental/raft.svg similarity index 100% rename from res/graphics/boat_rental/raft.svg rename to res/graphics/boat rental/raft.svg diff --git a/res/graphics/boat_rental/rowboat.svg b/res/graphics/boat rental/rowboat.svg similarity index 100% rename from res/graphics/boat_rental/rowboat.svg rename to res/graphics/boat rental/rowboat.svg diff --git a/res/graphics/boat_rental/sailboard.svg b/res/graphics/boat rental/sailboard.svg similarity index 100% rename from res/graphics/boat_rental/sailboard.svg rename to res/graphics/boat rental/sailboard.svg diff --git a/res/graphics/boat_rental/sailboat.svg b/res/graphics/boat rental/sailboat.svg similarity index 100% rename from res/graphics/boat_rental/sailboat.svg rename to res/graphics/boat rental/sailboat.svg diff --git a/res/graphics/boat_rental/standup_paddleboard.svg b/res/graphics/boat rental/standup_paddleboard.svg similarity index 100% rename from res/graphics/boat_rental/standup_paddleboard.svg rename to res/graphics/boat rental/standup_paddleboard.svg diff --git a/res/graphics/boat_rental/surfboard.svg b/res/graphics/boat rental/surfboard.svg similarity index 100% rename from res/graphics/boat_rental/surfboard.svg rename to res/graphics/boat rental/surfboard.svg diff --git a/res/graphics/boat_rental/yacht.svg b/res/graphics/boat rental/yacht.svg similarity index 100% rename from res/graphics/boat_rental/yacht.svg rename to res/graphics/boat rental/yacht.svg