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 May 25, 2024
2 parents 72a3857 + bfe6df3 commit 0eeaa65
Show file tree
Hide file tree
Showing 190 changed files with 1,352 additions and 470 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.gradle
/.idea/*
!.idea/codeStyles
!.idea/icon.svg
!.idea/ktlint.xml
/local.properties
.DS_Store
Expand Down
2 changes: 2 additions & 0 deletions .idea/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
218 changes: 121 additions & 97 deletions CHANGELOG.md

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions CONTRIBUTING_A_NEW_QUEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ See [this step](https://github.com/matkoniecz/StreetComplete_quest_creation_tuto

# Add the quest to the list of active ones

Adjust [QuestsModule.kt](app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt) file. It contains a big list of active quests, ordered by priority. Read [what governs their priority](app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt#L172-L195) but do not worry too much, it can be tweaked later.
Adjust [QuestsModule.kt](app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt) file. It contains a big list of active quests, ordered by priority. Read [what governs their priority](app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt#L217-L247) but do not worry too much, it can be tweaked later.

Each quest is associated with a number in this list. These numbers are used to identify the quest uniquely and can be used to save presets as QR codes. When adding a new quest, use the next consecutive number that is not yet in the list. Put the quest in order of priority, even if it means the numbers are not sorted.

Expand Down Expand Up @@ -432,7 +432,7 @@ Article about [null safety related syntax](https://kotlinlang.org/docs/null-safe
As mentioned, the user interface must leave no space for misunderstandings, it must be concise and quick and easy to use. Also sounds obvious, but you will quickly find out that a balance must be found between covering all the edge cases and designing the form to be as straightforward and clutterless as possible.

- Design the main form clutter-free so that it is straightforward for the majority of use cases.
- Allow to answer popular edge cases, but don't clutter up the main form with that. A good pattern is to move such answers into the "Other answers..." menu. E.g. look at the [opening hours quest](app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHoursForm.kt#L40-L48).
- Allow to answer popular edge cases, but don't clutter up the main form with that. A good pattern is to move such answers into the "Uh..." (otherAnswers) menu. E.g. look at the [opening hours quest](app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHoursForm.kt#L45-L53). That menu should also be used when user might have doubts on how to answer a specific situation.
- Don't rely on the "leave a note" fallback too much. It is not intended and does not work as a regular answer but is designed to cover the case that the question was invalid itself because it was based on wrong data like i.e. the place does not exist anymore.
- The information the user should fill in should be as atomic as possible. Users are impatient, i.e. do not let them fill out a whole address with street name etc. when just the house number is fine too.
- "A picture is worth a thousand words": Often the term for certain things may not be enough to convey the meaning of certain predefined answers. Do you know what a wheelbender is? You will know if you see the photo.
Expand Down Expand Up @@ -505,9 +505,9 @@ Matches like `surface ~ earth|dirt|ground` are possible and are evaluated as "`s

But using regexp like `surface ~ ^(.*)[0-9]$` is [also possible](app/src/test/java/de/westnordost/streetcomplete/data/elementfilter/filters/ElementFilterOverpassKtTest.kt#L79-L88).

It is possible to check for [age of elements](app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedHighwayConstruction.kt#L13-L17) or implement a [fully custom tag parsing](app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHours.kt#L137-L151), still combined with filter syntax.
It is possible to check for [age of elements](app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedHighwayConstruction.kt#L14-L18) or implement a [fully custom tag parsing](app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHours.kt#L144-L159), still combined with filter syntax.

It is possible to share and reuse [information about tagging schemes](app/src/main/java/de/westnordost/streetcomplete/quests/surface/AddRoadSurface.kt#L18).
It is possible to share and reuse [information about tagging schemes](app/src/main/java/de/westnordost/streetcomplete/quests/surface/AddRoadSurface.kt#L28).

(this info is gathered [here](app/src/main/java/de/westnordost/streetcomplete/osm))

Expand Down Expand Up @@ -538,6 +538,11 @@ This will decode whether the user should have access to direct deletion of eleme

For nodes within ways, the node will remain and tags will be removed.

## `hint` & `hintImages` (info button)

When there are doubts on the question itself (terms used, etc.), how to answer or how to find the answer, more information can be provided via info button text & images.
Examples for such info button would be explanation of what is halal, what is [tactile paving](app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingBusStop.kt#L33-L38), what is a sanitary dump station, when a level counts as a roof level and when as a normal level, explanation of the street side puzzle UI, etc.

## Per-country quest behaviour modification

While quests should generally be tailored to function in whole world similarly, if really needed one can use `countryInfo` to modify behaviour of the quest in specific country, see e.g. [AddTrafficSignalsVibrationForm.kt](app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibrationForm.kt) for example usage.
2 changes: 1 addition & 1 deletion QUEST_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SCEE is also able to generate quests from external sources, so search for specif
As mentioned, the user interface must leave no space for misunderstandings, it must be concise and quick and easy to use. Also sounds obvious, but you will quickly find out that a balance must be found between covering all the edge cases and designing the form to be as straightforward and clutterless as possible.

- Design the main form clutter-free so that it is straightforward for the majority of use cases.
- Make it not impossible to answer the edge cases (but don't clutter up the main form with that). A good pattern is to "ban" answering edge cases into the "Other answers..." menu. I.e. look at the opening hours quest.
- Make it not impossible to answer the edge cases (but don't clutter up the main form with that). A good pattern is to "ban" answering edge cases into the "Uh..." menu. I.e. look at the opening hours quest.
- Don't rely on the "leave a note" fallback too much. It is not intended and does not work as a regular answer but is designed to cover the case that the question was invalid itself because it was based on wrong data like i.e. the place does not exist anymore.
- The information the user should fill in should be as atomic as possible. Users are impatient. I.e. do not let them fill out a whole address with street name etc. when just the house number is fine too.
- "A picture is worth a thousand words": Often the term for certain things may not be enough to convey the meaning of certain predefined answers. Do you know what a wheelbender is? You will know if you see the photo.
Expand Down
45 changes: 21 additions & 24 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import java.util.Properties
plugins {
id("com.android.application")
kotlin("android")
kotlin("plugin.serialization") version "1.9.23"
kotlin("plugin.serialization") version "2.0.0"
kotlin("plugin.compose") version "2.0.0"
}

android {
Expand Down Expand Up @@ -69,10 +70,6 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.12"
}

bundle {
language {
enableSplit = false // because language is selectable in-app
Expand Down Expand Up @@ -129,69 +126,69 @@ dependencies {
androidTestImplementation(kotlin("test"))

// dependency injection
implementation(platform("io.insert-koin:koin-bom:3.5.4"))
implementation(platform("io.insert-koin:koin-bom:3.5.6"))
implementation("io.insert-koin:koin-core")
implementation("io.insert-koin:koin-android")
implementation("io.insert-koin:koin-androidx-workmanager")

// Android stuff
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.core:core-ktx:1.12.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.annotation:annotation:1.7.1")
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation("androidx.annotation:annotation:1.8.0")
implementation("androidx.fragment:fragment-ktx:1.7.1")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.viewpager:viewpager:1.0.0")
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")

// Jetpack Compose
val composeBom = platform("androidx.compose:compose-bom:2024.04.01")
val composeBom = platform("androidx.compose:compose-bom:2024.05.00")
implementation(composeBom)
androidTestImplementation(composeBom)
implementation("androidx.compose.material:material")
// Jetpack Compose Previews
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")

implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0")
// photos
implementation("androidx.exifinterface:exifinterface:1.3.7")

// settings
implementation("com.russhwolf:multiplatform-settings:1.1.1")

// Kotlin
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.3.5")

// Date/time
api("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")

// scheduling background jobs
implementation("androidx.work:work-runtime-ktx:2.9.0")

// HTTP Client
implementation("io.ktor:ktor-client-core:2.3.9")
implementation("io.ktor:ktor-client-cio:2.3.9")
testImplementation("io.ktor:ktor-client-mock:2.3.9")
implementation("io.ktor:ktor-client-core:2.3.11")
implementation("io.ktor:ktor-client-cio:2.3.11")
testImplementation("io.ktor:ktor-client-mock:2.3.11")

// finding in which country we are for country-specific logic
implementation("de.westnordost:countryboundaries:2.1")
// finding a name for a feature without a name tag
implementation("de.westnordost:osmfeatures-android:5.2")
implementation("de.westnordost:osmfeatures:6.0")
// talking with the OSM API
implementation("de.westnordost:osmapi-map:3.0")
implementation("de.westnordost:osmapi-changesets:3.0")
implementation("de.westnordost:osmapi-notes:3.0")
implementation("de.westnordost:osmapi-traces:3.0")
implementation("de.westnordost:osmapi-traces:3.1")
implementation("de.westnordost:osmapi-user:3.0")

// widgets
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("androidx.viewpager2:viewpager2:1.1.0")
implementation("me.grantland:autofittextview:0.2.1")
implementation("com.google.android.flexbox:flexbox:3.0.0")

Expand All @@ -203,7 +200,7 @@ dependencies {

// serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("com.charleskorn.kaml:kaml:0.58.0")
implementation("com.charleskorn.kaml:kaml:0.59.0")

// map and location
implementation("com.mapzen.tangram:tangram:0.17.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package de.westnordost.streetcomplete.util
import android.content.res.Configuration
import android.content.res.Resources
import androidx.test.platform.app.InstrumentationRegistry
import de.westnordost.osmfeatures.AndroidFeatureDictionary
import de.westnordost.osmfeatures.FeatureDictionary
import de.westnordost.osmfeatures.create
import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
import de.westnordost.streetcomplete.data.osm.mapdata.Node
import de.westnordost.streetcomplete.data.osm.mapdata.Way
Expand All @@ -19,7 +19,7 @@ class NameAndLocationLabelTest {

init {
val context = InstrumentationRegistry.getInstrumentation().targetContext
featureDictionary = AndroidFeatureDictionary.create(context.assets, "osmfeatures/default", "osmfeatures/brands")
featureDictionary = FeatureDictionary.create(context.assets, "osmfeatures/default", "osmfeatures/brands")

val conf = Configuration(context.resources.configuration)
conf.setLocale(Locale.ENGLISH)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ livingStreetSignStyle: russia
mobileCountryCode: 283
officialLanguages: [hy]
orchardProduces: [grape, apricot, apple, peach, tomato, pear, plum, walnut, cherry, fig, hazelnut]
parcelLockerBrand: [Գլոբինգ, Onex, OmniCDEK]
slowZoneLabelPosition: top
slowZoneLabelText: ԹՈՏՒ
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ noParkingLineStyle: dashed yellow
noStoppingLineStyle: yellow
officialLanguages: [de]
orchardProduces: [grape, apple, strawberry, apricot, pear, hop, plum, blueberry, tomato, peach, walnut, chilli_pepper, sweet_pepper, raspberry, cherry]
parcelLockerBrand: [Amazon Hub, Myflexbox, Post Abholstation, Amazon Locker, MYFLEXBOX, DHL Packstation, Amazon, Tamburi, GLS, Amazon Hub Locker, A1]
popularSports: [soccer, tennis, equestrian, beachvolleyball]
postboxesHaveCollectionTimes: true
regularShoppingDays: 5
Expand Down
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-ACT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ atmOperators: [Westpac, Commonwealth Bank, St.George, ANZ]
chargingStationOperators: ['Tesla, Inc.', Evie Networks]
defaultSpeedLimitHasUrbanOrRural: true
hasSlowZone: false
parcelLockerBrand: [Australia Post]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-NSW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ chargingStationOperators: [NRMA, Jolt, Evie Networks, 'Tesla, Inc.', Chargefox,
clothesContainerOperators: [Dankha Pty Ltd, 1-World Charity Shops]
defaultSpeedLimitHasUrbanOrRural: true
hasSlowZone: false
parcelLockerBrand: [Australia Post]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-QLD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
atmOperators: [Westpac, Commonwealth Bank, ANZ, NAB, Suncorp, BOQ, Bendigo Bank, rediATM, Heritage Bank, St.George, DC ATM, ATMx, nab, atmx, armaguard, Suncorp Bank, RediATM, National Australia Bank, Bendigo, Bank of Queensland, Armaguard]
chargingStationOperators: [Yurika, Evie Networks, 'Tesla, Inc.', Chargefox, AmpCharge]
defaultSpeedLimitHasUrbanOrRural: true
parcelLockerBrand: [Australia Post, Amazon Hub]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-SA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
atmOperators: [ANZ, RediATM, Commonwealth Bank, NAB, BankSA, Bank SA, Bendigo Bank, Westpac]
chargingStationOperators: [Chargefox, Jolt, 'Tesla, Inc.', Evie Networks, NRMA]
defaultSpeedLimitHasUrbanOrRural: true
parcelLockerBrand: [Australia Post]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-TAS.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Do not edit. Data is from res/country/metadata and https://github.com/streetcomplete/countrymetadata
atmOperators: [Commonwealth Bank, ANZ, Bendigo Bank, RediATM, Westpac, firstpoint, BOQ, NAB, Cashcard]
chargingStationOperators: [Electric Highway Tasmania, Chargefox, Evie Networks, TasPorts, Meander Valley Council, Huon Valley Council]
parcelLockerBrand: [Australia Post, Amazon Hub]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-VIC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
atmOperators: [Commonwealth Bank, ANZ, NAB, Westpac, Bendigo Bank, BOM, Next, Bankwest, Next Payments, atmx, HSBC, CBA, Commonwealth, Bank of Melbourne, rediATM, atmX, Westpac Bank, RediATM, Precinct, Commonwealth Bank of Australia, Bank Australia]
chargingStationOperators: [Evie Networks, Chargefox, Central Victorian Greenhouse Alliance, 'Tesla, Inc.', BP Pulse, AmpCharge, ChargePoint, Jolt, The District Docklands, Secure Parking, RACV, Linga Network, IKEA, Foxcharger]
defaultSpeedLimitHasUrbanOrRural: true
parcelLockerBrand: [Australia Post, Amazon Hub]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AU-WA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
atmOperators: [Westpac, ANZ, Bankwest, Commonwealth Bank, National Australia Bank, NAB, Commonwealth, Bendigo Bank, Commonwealth Bank of Australia, next, nab, DCATM, DC payments, CBA, BankWest]
chargingStationOperators: [Chargefox, 'Tesla, Inc.', RAC]
defaultSpeedLimitHasUrbanOrRural: true
parcelLockerBrand: [Australia Post]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/AX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
atmOperators: [OTTO]
chargingStationOperators: [ÅEA, ACS-Energy]
officialLanguages: [sv]
parcelLockerBrand: [Åland Post]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/BE-VLG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ chargingStationOperators: [Allego, Blue Corner, TotalEnergies, Lidl, Last Mile S
clothesContainerOperators: [Vlaams Inzamel Centrum Textiel, Wereld Missie Hulp, Limburg.net, Limburg.Net, Vlaams Internationaal Centrum, De Kringwinkel, Vlaams Inzamelcentrum Textiel, Curitas, Curitas n.v., V.H.S. Europ, Kringwinkel, IVIO, WMH, IVAREM, Caritas n.v., ivio, Oxfam, Wereldmissiehulp, Stad Halle, Rode Kruis, Les Petits Riens - Spullenhulp, Curitas NV, www.dekringwinkel.be, de kringwinkel, Wereldmissiehulp en O.L.V. van zeven Weeën vzw, Wereld-Missiehulp, TEXTIEL, Salvatorlaanse Hulpactie & Ontwikkelingshulp, Hulpzorg, De Bremberg, Curitas N.V.]
defaultSpeedLimitHasUrbanOrRural: true
officialLanguages: [nl]
parcelLockerBrand: [bpost, bpost Pakjesautomaat]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/BE-WAL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ chargingStationOperators: [Lidl, Allego, 'Tesla, Inc.', Ionity, ZE-MO, Luminus,
clothesContainerOperators: [Terre, IDELUX-Environnement, Terre ASBL, Terre asbl, Oxfam, Les Petits Riens, Oxfam-Solidarité, Les Petits Riens - Spullenhulp, ASBL Terre, Caritas n.v., Les Petits Riens-Spullenhulp, Curitas, BEP, ASBL la chaîne du cœur]
defaultSpeedLimitHasUrbanOrRural: true
officialLanguages: [fr, de]
parcelLockerBrand: [bpost, Mondial Relay, Bpost]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/BG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ noParkingSignStyle: vienna
noStoppingSignStyle: vienna
officialLanguages: [bg]
orchardProduces: [grape, cherry, plum, walnut, tomato, apple, chilli_pepper, sweet_pepper, peach, apricot, raspberry, hazelnut, almond, strawberry, pear, blueberry]
parcelLockerBrand: [BoxNow, easybox, Еконт, Speedy, Box Now]
postboxesHaveCollectionTimes: true
slowZoneLabelPosition: top
slowZoneLabelText: ЗОНА
Loading

0 comments on commit 0eeaa65

Please sign in to comment.