Skip to content

Commit

Permalink
Merge branch 'master' into modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Helium314 committed Apr 29, 2024
2 parents 29dcc88 + 13aa2a2 commit 86f9553
Show file tree
Hide file tree
Showing 21 changed files with 160 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## v57.4

- Fix crash under certain circumstances in bike path overlay (#5604) (regression from #5596)

## v57.3

- Fix UNDO: It didn't actually do anything for edits that were already synced! This critical issue existed since v57.2 (#5600, #5602)
- Traffic signals: Improve wording (#5591)
- Max speed: Show warning when inputting implausible slow zone tempo limit (#5592)
Expand Down
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {
applicationId = "de.westnordost.streetcomplete.expert"
minSdk = 21
targetSdk = 34
versionCode = 5705
versionName = "57.3"
versionCode = 5706
versionName = "57.4"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import de.westnordost.streetcomplete.osm.building.toItems
import de.westnordost.streetcomplete.overlays.AGroupedImageSelectOverlayForm
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.getNameAndLocationLabel
import de.westnordost.streetcomplete.util.ktx.valueOfOrNull
import de.westnordost.streetcomplete.util.mostCommonWithin
import de.westnordost.streetcomplete.util.padWith
import de.westnordost.streetcomplete.view.image_select.GroupableDisplayItem
Expand Down Expand Up @@ -46,7 +47,7 @@ class BuildingsOverlayForm : AGroupedImageSelectOverlayForm<BuildingType>() {
prefs,
key = javaClass.simpleName,
serialize = { it.value!!.name },
deserialize = { BuildingType.valueOf(it).asItem() }
deserialize = { valueOfOrNull<BuildingType>(it)?.asItem() }
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import de.westnordost.streetcomplete.osm.cycleway_separate.asItem
import de.westnordost.streetcomplete.osm.cycleway_separate.parseSeparateCycleway
import de.westnordost.streetcomplete.overlays.AImageSelectOverlayForm
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.ktx.valueOfOrNull
import de.westnordost.streetcomplete.view.image_select.DisplayItem
import org.koin.android.ext.android.inject

Expand Down Expand Up @@ -41,7 +42,7 @@ class SeparateCyclewayForm : AImageSelectOverlayForm<SeparateCycleway>() {
prefs,
key = javaClass.simpleName,
serialize = { it.value!!.name },
deserialize = { SeparateCycleway.valueOf(it).asItem(countryInfo.isLeftHandTraffic) }
deserialize = { valueOfOrNull<SeparateCycleway>(it)?.asItem(countryInfo.isLeftHandTraffic) }
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import de.westnordost.streetcomplete.overlays.IAnswerItem
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.getLocalesForFeatureDictionary
import de.westnordost.streetcomplete.util.ktx.couldBeSteps
import de.westnordost.streetcomplete.util.ktx.valueOfOrNull
import de.westnordost.streetcomplete.view.setImage
import org.koin.android.ext.android.inject

Expand Down Expand Up @@ -79,7 +80,7 @@ class SurfaceOverlayForm : AbstractOverlayForm() {
prefs,
key = javaClass.simpleName,
serialize = { it.name },
deserialize = { Surface.valueOf(it) }
deserialize = { valueOfOrNull<Surface>(it) }
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import de.westnordost.streetcomplete.overlays.AImageSelectOverlayForm
import de.westnordost.streetcomplete.overlays.AnswerItem
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.ktx.couldBeSteps
import de.westnordost.streetcomplete.util.ktx.valueOfOrNull
import de.westnordost.streetcomplete.view.image_select.DisplayItem
import org.koin.android.ext.android.inject

Expand Down Expand Up @@ -48,7 +49,7 @@ class WayLitOverlayForm : AImageSelectOverlayForm<LitStatus>() {
prefs,
key = javaClass.simpleName,
serialize = { it.value!!.name },
deserialize = { LitStatus.valueOf(it).asItem() }
deserialize = { valueOfOrNull<LitStatus>(it)?.asItem() }
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ import de.westnordost.streetcomplete.quests.max_height.AddMaxPhysicalHeight
import de.westnordost.streetcomplete.quests.max_speed.AddMaxSpeed
import de.westnordost.streetcomplete.quests.max_weight.AddMaxWeight
import de.westnordost.streetcomplete.quests.memorial_type.AddMemorialType
import de.westnordost.streetcomplete.quests.moped.AddProhibitedForMoped
import de.westnordost.streetcomplete.quests.motorcycle_parking_capacity.AddMotorcycleParkingCapacity
import de.westnordost.streetcomplete.quests.motorcycle_parking_cover.AddMotorcycleParkingCover
import de.westnordost.streetcomplete.quests.oneway.AddOneway
Expand Down Expand Up @@ -499,6 +500,8 @@ fun getQuestTypeList(
99 to AddEntrance(),
100 to AddEntranceReference(),

166 to AddProhibitedForMoped(),

/* ↓ 3.quests that may need some exploration / walking around --------------------------- */

// ferry: usually visible from looking at the boat, but not always...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package de.westnordost.streetcomplete.quests.moped

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.quest.NoCountriesExcept
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement
import de.westnordost.streetcomplete.osm.Tags

class AddProhibitedForMoped : OsmFilterQuestType<AddMopedAccessAnswer>() {

override val elementFilter = """
ways with (
highway = cycleway
or highway = path and bicycle = designated
or highway = footway and bicycle = designated
)
and !moped
and (motor_vehicle != no or !motor_vehicle)
"""
override val enabledInCountries = NoCountriesExcept("BE")
override val defaultDisabledMessage = R.string.default_disabled_msg_visible_sign_moped
override val changesetComment = "Specify if a moped is allowed on the cycleway"
override val wikiLink = "Key:moped"
override val icon = R.drawable.ic_quest_moped_access

override val achievements = listOf(EditTypeAchievement.BICYCLIST)

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

override fun createForm() = AddMopedAccessForm()

override fun applyAnswerTo(
answer: AddMopedAccessAnswer,
tags: Tags,
geometry: ElementGeometry,
timestampEdited: Long,
) {
tags["moped"] = when (answer) {
AddMopedAccessAnswer.ALLOWED -> "yes"
AddMopedAccessAnswer.FORBIDDEN -> "no"
AddMopedAccessAnswer.DESIGNATED -> "designated"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.westnordost.streetcomplete.quests.moped

enum class AddMopedAccessAnswer {
ALLOWED,
DESIGNATED,
FORBIDDEN
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package de.westnordost.streetcomplete.quests.moped

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AListQuestForm
import de.westnordost.streetcomplete.quests.TextItem
import de.westnordost.streetcomplete.quests.moped.AddMopedAccessAnswer.FORBIDDEN
import de.westnordost.streetcomplete.quests.moped.AddMopedAccessAnswer.ALLOWED
import de.westnordost.streetcomplete.quests.moped.AddMopedAccessAnswer.DESIGNATED



class AddMopedAccessForm : AListQuestForm<AddMopedAccessAnswer>() {

override val items = listOf(
TextItem(DESIGNATED, R.string.quest_moped_access_designated),
TextItem(FORBIDDEN, R.string.quest_moped_access_forbidden),
TextItem(ALLOWED, R.string.quest_moped_access_allowed)
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package de.westnordost.streetcomplete.util.ktx

inline fun <reified E : Enum<E>> valueOfOrNull(str: String): E? =
enumValues<E>().firstOrNull { str == it.name }
2 changes: 2 additions & 0 deletions app/src/main/res/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ bicycle_rental_dropoff_poin... CC-BY-SA 4.0 Alexander Migl https://commons.
bicycle_rental_human.jpg CC-BY-SA 2.0 TijsB https://commons.wikimedia.org/wiki/File:Tel_Aviv-_bike_rental_(5889990605).jpg
bicycle_rental_shop_with_re... CC-BY-SA 2.0 Darb02 https://commons.wikimedia.org/wiki/File:Rydjor_Bike_Shop_and_Antique_Bike_Museum.jpg

bicycleway_moped.svg PD Ionutneagu https://www.svgrepo.com/download/490323/scooter-2.svg

bollard_fixed.jpg CC-BY-SA 4.0 Matija Nalis https://github.com/streetcomplete/StreetComplete/issues/3657#issuecomment-1020666101
bollard_flexible.jpg CC0 Ruben Kelevra https://commons.wikimedia.org/wiki/File:Flexible_bollard.jpg
bollard_foldable.jpg CC-BY-SA 3.0 Hauke Stieler https://wiki.openstreetmap.org/wiki/File:Bollard_foldable.jpg
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/ic_quest_moped_access.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:name="vector" android:width="128dp" android:height="128dp" android:viewportWidth="128" android:viewportHeight="128">
<path android:name="path" android:pathData="M 119.44 96.041 C 101.767 126.652 62.625 137.14 32.014 119.467 C 1.403 101.794 -9.085 62.652 8.588 32.041 C 26.261 1.43 65.403 -9.058 96.014 8.615 C 126.625 26.288 137.113 65.43 119.44 96.041" android:fillColor="#ca72e2" android:strokeWidth="1"/>
<path android:name="path_1" android:pathData="M 68.002 128.04 C 71.368 127.862 74.718 127.344 78.002 126.645 L 125.123 45.184 C 124.086 41.99 123.419 39.478 121.002 36.184 C 121.002 36.184 68.002 128.184 68.002 128.04 Z" android:fillColor="#000000" android:fillAlpha="0.2" android:strokeWidth="1"/>
<path android:name="path_2" android:pathData="M 96.003 8.651 C 85.901 2.819 74.871 0.072 63.989 0.084 L 8.577 96.061 C 14.007 105.491 21.901 113.67 32.003 119.502 C 42.087 125.324 53.095 128.071 63.958 128.069 L 119.399 32.042 C 113.97 22.633 106.086 14.473 96.003 8.652 Z" android:fillColor="#999999" android:strokeWidth="1"/>
<path android:name="path_3" android:pathData="M 119.46 32 L 64.044 127.983 C 67.289 127.98 70.519 127.733 73.709 127.244 L 123.652 40.74 C 122.481 37.733 121.08 34.812 119.46 32 Z M 64.034 0 C 60.789 0.003 57.559 0.25 54.369 0.739 L 4.426 87.243 C 5.597 90.25 6.998 93.171 8.618 95.983 Z" android:fillColor="#ffffff" android:strokeWidth="1"/>
<path android:name="path_4" android:pathData="M 56.221 50.498 L 58.115 51.626 L 45.914 63.161 C 46.414 63.637 46.869 64.126 47.272 64.623 C 46.873 64.138 46.427 63.661 45.94 63.192 C 42.71 60.235 38.946 59.698 34.749 61.14 L 37.067 64.442 L 46.902 78.477 C 47.482 77.717 47.97 76.963 48.368 76.228 C 48.314 76.335 48.258 76.446 48.196 76.555 L 63.647 85.376 C 61.76 88.691 62.915 92.911 66.232 94.804 C 69.547 96.697 73.765 95.545 75.664 92.237 L 80.72 95.124 C 84.999 88.451 83.232 80.434 77.838 76.684 L 80.901 78.433 C 81.506 78.778 82.289 78.564 82.635 77.958 L 83.327 76.747 C 83.669 76.147 83.457 75.379 82.859 75.038 L 66.873 65.91 L 64.928 69.317 L 64.05 70.854 C 65.801 75.163 63.628 80.086 59.477 80.623 L 52.37 76.566 C 54.386 72.756 53.971 68.512 51.862 63.965 L 57.71 58.648 C 59.737 57.118 60.04 55.254 59.384 53.447 C 60.513 52.394 61.422 51.46 61.848 50.523 L 63.806 52.247 C 64.443 52.809 64.48 53.174 65.11 52.61 C 65.22 52.512 65.319 52.415 65.409 52.304 C 66.129 51.457 65.982 51.458 65.298 50.864 L 63.191 49.054 L 62.477 48.646 L 61.886 47.659 C 61.533 47.065 61.104 46.579 60.588 46.195 L 59.854 45.711 C 59.075 45.266 58.32 44.547 57.455 45.007 C 57.44 45.015 57.411 45.057 57.37 45.119 C 56.991 45.046 56.583 45.127 56.186 45.338 C 55.706 45.591 55.244 46.038 54.907 46.628 C 54.572 47.214 54.419 47.845 54.445 48.387 C 54.473 48.994 54.724 49.505 55.179 49.786 C 55.34 50.129 55.832 50.264 56.221 50.498 Z M 37.075 64.456 L 40.98 70.05 L 39.698 68.26 C 38.358 67.83 36.855 68.381 36.129 69.653 C 35.294 71.115 35.803 72.976 37.263 73.809 C 38.724 74.643 40.586 74.137 41.421 72.674 C 41.677 72.226 41.806 71.736 41.818 71.248 L 44.483 75.063 C 42.475 78.015 38.496 78.969 35.341 77.167 C 32.022 75.272 30.868 71.046 32.763 67.727 C 33.735 66.036 35.317 64.907 37.075 64.456 Z M 56.791 46.162 C 56.374 46.95 55.859 47.972 55.512 48.662 C 55.481 48.569 55.458 48.459 55.455 48.335 C 55.436 47.975 55.546 47.542 55.784 47.124 C 56.025 46.702 56.34 46.391 56.659 46.225 C 56.705 46.202 56.75 46.18 56.791 46.162 Z M 67.008 87.301 L 72.297 90.321 C 71.462 91.775 69.604 92.28 68.148 91.449 C 66.692 90.612 66.181 88.756 67.008 87.301 Z" android:fillColor="#000" android:fillAlpha="0.2" android:strokeWidth="1"/>
<path android:name="path_5" android:pathData="M 56.293 46.517 L 58.186 47.645 L 45.985 59.179 C 46.486 59.655 46.941 60.145 47.344 60.641 C 46.943 60.157 46.498 59.679 46.011 59.21 C 42.781 56.253 39.017 55.716 34.82 57.158 L 37.137 60.46 L 46.974 74.495 C 47.552 73.736 48.042 72.982 48.439 72.246 C 48.384 72.354 48.33 72.465 48.268 72.573 L 63.717 81.394 C 61.83 84.709 62.987 88.929 66.302 90.823 C 69.617 92.715 73.836 91.564 75.734 88.255 L 80.791 91.143 C 85.07 84.469 83.304 76.452 77.909 72.702 L 80.971 74.451 C 81.577 74.797 82.36 74.582 82.706 73.976 L 83.398 72.764 C 83.74 72.166 83.528 71.396 82.931 71.055 L 66.944 61.928 L 64.999 65.334 L 64.121 66.872 C 65.872 71.182 63.7 76.104 59.548 76.642 L 52.441 72.584 C 54.457 68.773 54.042 64.53 51.934 59.982 L 57.78 54.667 C 59.808 53.137 60.112 51.273 59.456 49.466 C 60.584 48.413 61.494 47.478 61.919 46.54 L 63.877 48.265 C 64.515 48.827 64.551 49.192 65.182 48.628 C 65.29 48.53 65.391 48.433 65.48 48.323 C 66.201 47.476 66.053 47.476 65.37 46.882 L 63.263 45.073 L 62.549 44.665 L 61.957 43.676 C 61.605 43.084 61.174 42.597 60.66 42.213 L 59.924 41.729 C 59.146 41.285 58.39 40.566 57.526 41.025 C 57.511 41.033 57.483 41.074 57.442 41.138 C 57.061 41.064 56.655 41.145 56.258 41.355 C 55.777 41.609 55.314 42.057 54.978 42.646 C 54.643 43.232 54.49 43.863 54.516 44.406 C 54.543 45.012 54.794 45.523 55.249 45.805 C 55.412 46.147 55.903 46.282 56.293 46.517 Z M 37.146 60.474 L 41.051 66.069 L 39.769 64.278 C 38.429 63.849 36.926 64.4 36.2 65.672 C 35.365 67.135 35.874 68.994 37.335 69.828 C 38.795 70.662 40.656 70.156 41.491 68.693 C 41.747 68.244 41.877 67.755 41.89 67.267 L 44.554 71.083 C 42.545 74.033 38.567 74.987 35.413 73.186 C 32.094 71.291 30.939 67.064 32.834 63.745 C 33.806 62.054 35.388 60.925 37.146 60.474 Z M 56.862 42.18 C 56.444 42.968 55.93 43.989 55.584 44.68 C 55.552 44.586 55.529 44.478 55.526 44.354 C 55.508 43.992 55.617 43.56 55.855 43.143 C 56.096 42.721 56.411 42.41 56.731 42.244 C 56.776 42.22 56.82 42.198 56.862 42.18 Z M 67.08 83.32 L 72.368 86.339 C 71.533 87.793 69.676 88.299 68.218 87.467 C 66.764 86.631 66.253 84.774 67.08 83.32 Z" android:fillColor="#ffffff" android:strokeWidth="1" android:fillType="evenOdd"/>
</vector>
3 changes: 2 additions & 1 deletion app/src/main/res/raw/changelog.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- Do not edit! This file was generated automatically from CHANGELOG.md via UpdateChangelogTask -->
<h1>Changelog</h1><p></p><h2>v57.3</h2><ul><li>Fix UNDO: It didn't actually do anything for edits that were already synced! This critical issue existed since v57.2 (<a href="https://github.com/streetcomplete/StreetComplete/issues/5600">#5600</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5602">#5602</a>)</li><li>Traffic signals: Improve wording (<a href="https://github.com/streetcomplete/StreetComplete/issues/5591">#5591</a>)</li><li>Max speed: Show warning when inputting implausible slow zone tempo limit (<a href="https://github.com/streetcomplete/StreetComplete/issues/5592">#5592</a>)</li><li>Payment methods: Don't ask in shops if they have been specified exhaustively already (<a href="https://github.com/streetcomplete/StreetComplete/issues/5589">#5589</a>), by <a href="https://github.com/urbalazs">urbalazs</a></li><li>Railway crossings barriers: Don't ask for abandoned railways (<a href="https://github.com/streetcomplete/StreetComplete/issues/5597">#5597</a>)</li><li>Bike paths overlay: Fix selecting &quot;not designated as bike path&quot; when it was a &quot;path or trail&quot; wouldn't do anything (<a href="https://github.com/streetcomplete/StreetComplete/issues/5596">#5596</a>)
<h1>Changelog</h1><p></p><h2>v57.4</h2><ul><li>Fix crash under certain circumstances in bike path overlay (<a href="https://github.com/streetcomplete/StreetComplete/issues/5604">#5604</a>) (regression from <a href="https://github.com/streetcomplete/StreetComplete/issues/5596">#5596</a>)
</li></ul><h2>v57.3</h2><p></p><ul><li>Fix UNDO: It didn't actually do anything for edits that were already synced! This critical issue existed since v57.2 (<a href="https://github.com/streetcomplete/StreetComplete/issues/5600">#5600</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5602">#5602</a>)</li><li>Traffic signals: Improve wording (<a href="https://github.com/streetcomplete/StreetComplete/issues/5591">#5591</a>)</li><li>Max speed: Show warning when inputting implausible slow zone tempo limit (<a href="https://github.com/streetcomplete/StreetComplete/issues/5592">#5592</a>)</li><li>Payment methods: Don't ask in shops if they have been specified exhaustively already (<a href="https://github.com/streetcomplete/StreetComplete/issues/5589">#5589</a>), by <a href="https://github.com/urbalazs">urbalazs</a></li><li>Railway crossings barriers: Don't ask for abandoned railways (<a href="https://github.com/streetcomplete/StreetComplete/issues/5597">#5597</a>)</li><li>Bike paths overlay: Fix selecting &quot;not designated as bike path&quot; when it was a &quot;path or trail&quot; wouldn't do anything (<a href="https://github.com/streetcomplete/StreetComplete/issues/5596">#5596</a>)
</li></ul><h2>v57.2</h2><p></p><ul><li>Lit overlay: Unsupported current tagging is now indicated as such (<a href="https://github.com/streetcomplete/StreetComplete/issues/5571">#5571</a>)</li><li>Building overlay: Selecting a specific building type for a historic building does now not remove its property as historic (<a href="https://github.com/streetcomplete/StreetComplete/issues/5547">#5547</a>)</li><li>Fix max width for road narrowing traffic calmings were not answerable if mapped as a way (<a href="https://github.com/streetcomplete/StreetComplete/issues/5569">#5569</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5578">#5578</a>), by <a href="https://github.com/mnalis">mnalis</a></li><li>Fix regression in v57.1 that may lead to issues displaying the current GPS location (<a href="https://github.com/streetcomplete/StreetComplete/issues/5516">#5516</a>)</li><li>Fix the feature name label was slightly wrong for a few map features (<a href="https://github.com/streetcomplete/StreetComplete/issues/5549">#5549</a>)</li><li>Fix description of Prettymapp (<a href="https://github.com/streetcomplete/StreetComplete/issues/5570">#5570</a>), by <a href="https://github.com/FloEdelmann">FloEdelmann</a></li><li>Other small improvements (<a href="https://github.com/streetcomplete/StreetComplete/issues/5533">#5533</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5558">#5558</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5559">#5559</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5525">#5525</a>, <a href="https://github.com/streetcomplete/StreetComplete/issues/5573">#5573</a>), thanks <a href="https://github.com/matkoniecz">matkoniecz</a>, <a href="https://github.com/burrscurr">burrscurr</a>
</li></ul><h2>v57.1</h2><p></p><ul><li>fixed crash on startup if you recently solved a crossing quest (<a href="https://github.com/streetcomplete/StreetComplete/issues/5522">#5522</a>)</li><li>fixed that you could e.g. add a POI in an overlay twice if you tap OK fast enough (<a href="https://github.com/streetcomplete/StreetComplete/issues/5523">#5523</a>)
</li></ul><h2>v57.0</h2><p>
Expand Down

0 comments on commit 86f9553

Please sign in to comment.