diff --git a/CHANGES-mnalis.md b/CHANGES-mnalis.md index 7b66187d9e..1bda49b891 100644 --- a/CHANGES-mnalis.md +++ b/CHANGES-mnalis.md @@ -1,6 +1,6 @@ -## Changes in mnalis-v38-smoothness branch +## Changes in mnalis-v38-smoothness-helium314 branch -This file details changes made in https://github.com/mnalis/StreetComplete/tree/mnalis-v38-smoothness +This file details changes made in https://github.com/mnalis/StreetComplete/tree/mnalis-v38-smoothness-helium314 as modified from upstream https://github.com/streetcomplete/StreetComplete From `mnalis-v38` branch: @@ -22,6 +22,15 @@ From `helium314/smoothness`: * try to fix style renames * QuestTypeAchievement compile error +From `upstream-helium314-new` (and `upstream-helium314-old`?) branches: +* move "no cycleway" answer to different position (commit 1af6ce536211bd005a927414b372aa3c360f0620) +* add hide button (commit 6ca8a6d38ee0e408dc38cd52cdd213c333c251c6) +* also make buildings on light theme more transparent (commit edd770106132915823829b5da4aacf1a434ef651) +* make buildings more transparent (dark mode only) (commit 367b904990f1824eb2c114ec48ef44f1393afd1b) +* adjust dark theme (commit 9dbf3908180edcb30f1b0464a62f5c134a47c0b0) +* add phone and website quests (commit 8e65bacde415860fd3e29a402d3cd9056a4e187f) +* add "zebra" answer for crossing type quest (commit 68f49d281aed27d3b526fd35d5552a9095f43036) + ## TODO * update APK build code, and put date/version/last commit in filename. Also, is it possible to download apk directly from actions, or must it be packed in debug.zip ? @@ -38,21 +47,14 @@ From `helium314/smoothness`: newer commit b00ed7484fd77f968bb69d6e182333a454e729d1 and reverse 5462928489a6c5afebf3495f5b8ef1b64e645976, is there even newer? * add phone number and website quests (commit a01c492bdc1f7385a7b83acd59fed5100fc55cdf) * add poi "quests" and adjust quest dot offset (commit 2ea50a4433d9db5b5101a739efd4c9e4282959fc) -- add 'FIXME' quest only, but not offsets etc - * add gpx notes (commit a01bc6a2ba54fca1c791237571d6b08a4f1ceb2e) -- BUGGY on -dev version no pictures, no easy sharing of notes - * add 'hide' button (commit 87fce03ec2d2efaa578920eb79da179c24c86587) * add level quests for shopping malls (commit b2ae6032809b25f206daaf1deb79fe98693e8198) * update contact quests (commit 2dddd0b2d49ffa6c5dc2d67bd629cfcbce8537c5) -- FIXME: it also removes key_cutter, hostel etc, why? - * adjust dark theme (commit 3251e335c7839520a2eb95b120d6ad88d333f19c) - * move "none" answer for cycleway to more convenient position (commit 4812c692041d3c3b5ccd4dbbe249132c107317e1) * add per-quest settings for some quests (for element selection) (commit a60a389024f7db64091b25c950e511180c3a5ff9) * add maxspeed tag selection to per-quest-settings (commit e256a94617d6465db3a6cef92b89ef83e6665d35) * x 148a60f1b remove ShowFixme() and other Show() which are in other Helium314 patches we didn't import * replace helium314 reverse quest order button with quick preset change button? - * also make buildings on light theme more transparent (commit edd770106132915823829b5da4aacf1a434ef651) - * make buildings more transparent (dark mode only) (commit 367b904990f1824eb2c114ec48ef44f1393afd1b) * disable 3D (commit f379fc78376212362d47f9efa3b6b7692031bfcf, 08a791676728d683849938f8a7c03a2bbee92131, 825afd551347cb1add9446d72c5df896e98893e8) - * update icons (commit bce1e5569137bfdef5468d8f861c6363c70aec5b) * update level filter (commit c19129b8b86f810bfdfca3c77c6edbdbc4c98bd1) * add raised crossing answer to show poi quest, remove unused imports (commit cdf7fa5aaf05ac289cb356e314bbf5ffc5f6517f, 5c9a07257d30184475d92df2908180ff0e159d9c) * fix build (commit 1bdad058165b769020b611b5449ccc96ad027f21, a2cb3c68e2927fcaf90f4ab1515428ef58547c15) @@ -63,7 +65,6 @@ From `helium314/smoothness`: * make day/night filter optional, add setting (commit 965a9427c4e0cf344cfd0e809fb9f43639da1bee) * fix level quest (131831b34f8f8d34477b61ce4031e910c9d5e8ab) * update level quest (requires at least one poi with tagged level) (commit 7458bfe43e46d6dd89a28b09bb7bf2e361256f85) - * add "zebra" answer for crossing type quest (commit 68f49d281aed27d3b526fd35d5552a9095f43036) * extend map tile cache from 12 hours to 8 days (commit 365b097d3349423d2777cec7238faa115155c14a) * add level filter (commit 4dbc75e59863e3d3e96015bf8eed736459483387) * small update to place level quest (commit 21d85b8395494f8c4751c9bdd9eb036b0f3a3881) @@ -72,20 +73,10 @@ From `helium314/smoothness`: * add "private" other answer to track, lit and surface quests (commit bf7a8771c2480f10813daef25f06f92a4c5bc649) * add "demolished" other answer for building type (commit 844e027754c5d48a1c9d214318813dc7f88f1015) * add quests asking for level inside mall or retail buildings (commit 1dd8d52e87a25f8608d6479eedba6675fc23beb3) - * add phone and website quests (commit 8e65bacde415860fd3e29a402d3cd9056a4e187f) * show pois and adjust quest dot and pin offsets (commit 8cf33fab948a3c3e1615a61b3b1638659e6cae71) - * re-ask surface for badly tagged tracks (by matkoniecz) (commit 94d444069bb4918b6b9a9248470ecd9825b3d14e) - * add hide button (commit 6ca8a6d38ee0e408dc38cd52cdd213c333c251c6) - * adjust dark theme (commit 9dbf3908180edcb30f1b0464a62f5c134a47c0b0) - * move "no cycleway" answer to different position (commit 1af6ce536211bd005a927414b372aa3c360f0620) * rename package and app (in changesets) (commit 8694cf185b7dff21308ec712f04928d786934075) - * small fixes (commit b6daf8211e8f440a043ce179ec78cb9eef409939) - Not wanted yet: - * add button to reverse quest order (commit 1982e79ef618444bc41cb609f9d5270805a24ab2) - * (preparing for westnordost presets) - add quest profiles (commit 3d97a952d355e2ef4b4ee3c6db0670cda60f5876) - * auto-download only if auto-upload is allowed (commit 52cf846a7544c5c1fbf39f1ef0cae8eb93b945ab) - * add optional zoom with volume buttons (commit 56466f34760db956fd385eef700553f2a3013003) + * re-ask surface for badly tagged tracks (by matkoniecz) (commit 94d444069bb4918b6b9a9248470ecd9825b3d14e) * allow house address quest even if no building type ? See [issue #2464](https://github.com/streetcomplete/StreetComplete/issues/2464) diff --git a/app/src/main/assets/map_theme/jawg/streetcomplete-dark-style.yaml b/app/src/main/assets/map_theme/jawg/streetcomplete-dark-style.yaml index 2a359b8112..22315a55f8 100644 --- a/app/src/main/assets/map_theme/jawg/streetcomplete-dark-style.yaml +++ b/app/src/main/assets/map_theme/jawg/streetcomplete-dark-style.yaml @@ -9,7 +9,7 @@ global: text_fill_color: '#ccf' text_water_color: '#ccf' - railway_color: '#903' + railway_color: '#603' road_color: '#559' road_outline_color: '#99f' highway_color: '#033' @@ -19,13 +19,13 @@ global: square_color: global.road_color earth_color: '#2e2e48' - water_color: '#002' - green_color: '#363054' - forest_color: '#403962' - town_color: '#3d364e' + water_color: '#006' + green_color: '#455944' + forest_color: '#375436' + town_color: '#211d2b' - building_color: [0.16, 0.36, 0.36, 0.75] - building_outline_color: [0.12, 0.32, 0.32, 0.75] + building_color: [0.16, 0.36, 0.36, 0.35] + building_outline_color: [0.26, 0.6, 0.6, 0.7] boundary_color: '#e72' diff --git a/app/src/main/assets/map_theme/jawg/streetcomplete-light-style.yaml b/app/src/main/assets/map_theme/jawg/streetcomplete-light-style.yaml index df266d5276..4f5397af3d 100644 --- a/app/src/main/assets/map_theme/jawg/streetcomplete-light-style.yaml +++ b/app/src/main/assets/map_theme/jawg/streetcomplete-light-style.yaml @@ -18,7 +18,7 @@ global: forest_color: '#a8c884' town_color: '#f3dacd' - building_color: rgba(204, 214, 238, .75) + building_color: rgba(204, 214, 238, .4) building_outline_color: rgba(185, 195, 217, .75) boundary_color: '#f3c' diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestAnswerFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestAnswerFragment.kt index a442084616..1200c19c28 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestAnswerFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestAnswerFragment.kt @@ -189,6 +189,9 @@ abstract class AbstractQuestAnswerFragment : if (binding.content.childCount == 0) { binding.content.visibility = View.GONE } + + binding.hideButton.popIn() + binding.hideButton.setOnClickListener { skipQuest() } } override fun onDestroyView() { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.kt index cf2cffe04c..f36739e568 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/QuestModule.kt @@ -27,6 +27,7 @@ import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter import de.westnordost.streetcomplete.quests.car_wash_type.AddCarWashType import de.westnordost.streetcomplete.quests.construction.MarkCompletedBuildingConstruction import de.westnordost.streetcomplete.quests.construction.MarkCompletedHighwayConstruction +import de.westnordost.streetcomplete.quests.contact.* import de.westnordost.streetcomplete.quests.crossing_type.AddCrossingType import de.westnordost.streetcomplete.quests.crossing_island.AddCrossingIsland import de.westnordost.streetcomplete.quests.defibrillator.AddIsDefibrillatorIndoor @@ -344,6 +345,8 @@ import javax.inject.Singleton AddKosher(), AddWheelchairAccessBusiness(featureDictionaryFuture), // used by wheelmap, OsmAnd, Organic Maps AddInternetAccess(), // used by OsmAnd + AddContactPhone(), + AddContactWebsite(), /* ↓ 5.quests that are very numerous ---------------------------------------------------- */ diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactPhone.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactPhone.kt new file mode 100644 index 0000000000..df30f4f212 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactPhone.kt @@ -0,0 +1,78 @@ +package de.westnordost.streetcomplete.quests.contact + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder +import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType +import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.CITIZEN + +class AddContactPhone : OsmFilterQuestType() { + + override val elementFilter = """ + nodes, ways, relations with + ( + tourism = information and information = office + or """.trimIndent() + + + // The common list is shared by the name quest, the opening hours quest and the wheelchair quest. + // So when adding other tags to the common list keep in mind that they need to be appropriate for all those quests. + // Independent tags can by added in the "wheelchair only" tab. + + mapOf( + "amenity" to arrayOf( + // common + "restaurant", "cafe", "nightclub","internet_cafe", + "cinema", "townhall", "courthouse", "embassy", "community_centre", "youth_centre", "library", + "dentist", "doctors", "clinic", "veterinary","animal_shelter", + + // name & wheelchair only + "arts_centre","ferry_terminal" + ), + "tourism" to arrayOf( + // common + "zoo", "aquarium", "gallery", "museum", + ), + "shop" to arrayOf( + // common + "beauty", "massage", "hairdresser","boutique","wool","tattoo","electrical","florist","glaziery", + "computer","electronics","hifi","bicycle","outdoor","sports","clothing","art","craft","model", + "musical_instrument","camera","books","travel_agency","cheese","chocolate","coffee","health_food" + ), + "leisure" to arrayOf( + // common + "fitness_centre", "bowling_alley","sports_centre" + ), + "office" to arrayOf( + // common + "insurance", "government", "travel_agent", "tax_advisor", "religion", "employment_agency", + + // name & wheelchair + "lawyer", "estate_agent", "therapist" + ), + "craft" to arrayOf( + // common + "carpenter", "shoemaker", "tailor", "photographer", "dressmaker", + "electronics_repair", "stonemason","winery" + ) + ).map { it.key + " ~ " + it.value.joinToString("|") }.joinToString("\n or ") + + "\n) and !phone and !contact:phone and !contact:mobile and !brand and name" + + override val commitMessage = "Add phone number" + override val wikiLink = "Key:phone" + override val icon = R.drawable.ic_quest_blind_traffic_lights_sound + + override val questTypeAchievements = listOf(CITIZEN) + + override fun getTitle(tags: Map) = R.string.quest_contact_phone + + override fun getTitleArgs(tags: Map, featureName: Lazy): Array { + val name = tags["name"] + return if (name != null) arrayOf(name) else arrayOf() + } + + override fun createForm() = AddContactPhoneForm() + + override fun applyAnswerTo(answer: String, changes: StringMapChangesBuilder) { + changes.add("phone", answer) + } + +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactPhoneForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactPhoneForm.kt new file mode 100644 index 0000000000..03fa75e1be --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactPhoneForm.kt @@ -0,0 +1,36 @@ +package de.westnordost.streetcomplete.quests.contact + +import android.os.Bundle +import android.text.InputType +import android.view.View + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.quests.AbstractQuestFormAnswerFragment +import de.westnordost.streetcomplete.util.TextChangedWatcher +import de.westnordost.streetcomplete.databinding.QuestContactBinding + + +class AddContactPhoneForm : AbstractQuestFormAnswerFragment() { + + override val contentLayoutResId = R.layout.quest_contact + private val binding by contentViewBinding(QuestContactBinding::bind) + + private val contact get() = binding.nameInput?.text?.toString().orEmpty().trim() + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.nameInput.inputType = InputType.TYPE_CLASS_PHONE + + binding.nameInput.setText(PREFILL) + binding.nameInput.addTextChangedListener(TextChangedWatcher { checkIsFormComplete() }) + } + + override fun onClickOk() { + applyAnswer(contact) + } + + + override fun isFormComplete() = contact.isNotEmpty() && contact != PREFILL +} + +private const val PREFILL = "+" diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactWebsite.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactWebsite.kt new file mode 100644 index 0000000000..37bfce84a5 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactWebsite.kt @@ -0,0 +1,81 @@ +package de.westnordost.streetcomplete.quests.contact + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder +import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType +import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.CITIZEN + +class AddContactWebsite : OsmFilterQuestType() { + + override val elementFilter = """ + nodes, ways, relations with + ( + tourism = information and information = office + or """.trimIndent() + + + // The common list is shared by the name quest, the opening hours quest and the wheelchair quest. + // So when adding other tags to the common list keep in mind that they need to be appropriate for all those quests. + // Independent tags can by added in the "wheelchair only" tab. + + mapOf( + "amenity" to arrayOf( + // common + "restaurant", "cafe", "nightclub", // eat & drink + "cinema", "townhall", "courthouse", "embassy", "community_centre", "youth_centre", "library", // civic + "internet_cafe", // commercial + "dentist", "doctors", "clinic", "veterinary", // health + "animal_shelter", + + // name & wheelchair only + "arts_centre","ferry_terminal" + ), + "tourism" to arrayOf( + // common + "zoo", "aquarium", "gallery", "museum", + ), + "shop" to arrayOf( + // common + "beauty", "massage", "hairdresser","boutique","wool","tattoo","electrical","florist","glaziery", + "computer","electronics","hifi","mobile_phone","bicycle","outdoor","sports","clothing","art","craft","model", + "musical_instrument","camera","books","travel_agency","cheese","chocolate","coffee","health_food" + + ), + "leisure" to arrayOf( + // common + "fitness_centre", "bowling_alley","sports_centre" + ), + "office" to arrayOf( + // common + "insurance", "government", "travel_agent", "tax_advisor", "religion", "employment_agency", + + // name & wheelchair + "lawyer", "estate_agent", "therapist" + ), + "craft" to arrayOf( + // common + "carpenter", "shoemaker", "tailor", "photographer", "dressmaker", + "electronics_repair", "stonemason","winery" + ) + ).map { it.key + " ~ " + it.value.joinToString("|") }.joinToString("\n or ") + + "\n) and !website and !contact:website and !contact:facebook and !contact:instagram and !brand and name" + + override val commitMessage = "Add website" + override val wikiLink = "Key:website" + override val icon = R.drawable.ic_quest_wifi + + override val questTypeAchievements = listOf(CITIZEN) + + override fun getTitle(tags: Map) = R.string.quest_contact_website + + override fun getTitleArgs(tags: Map, featureName: Lazy): Array { + val name = tags["name"] + return if (name != null) arrayOf(name) else arrayOf() + } + + override fun createForm() = AddContactWebsiteForm() + + override fun applyAnswerTo(answer: String, changes: StringMapChangesBuilder) { + changes.add("website", answer) + } + +} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactWebsiteForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactWebsiteForm.kt new file mode 100644 index 0000000000..3af9ba4d61 --- /dev/null +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/contact/AddContactWebsiteForm.kt @@ -0,0 +1,36 @@ +package de.westnordost.streetcomplete.quests.contact + +import android.os.Bundle +import android.text.InputType +import android.view.View + +import de.westnordost.streetcomplete.R +import de.westnordost.streetcomplete.quests.AbstractQuestFormAnswerFragment +import de.westnordost.streetcomplete.util.TextChangedWatcher +import de.westnordost.streetcomplete.databinding.QuestContactBinding + + +class AddContactWebsiteForm : AbstractQuestFormAnswerFragment() { + + override val contentLayoutResId = R.layout.quest_contact + private val binding by contentViewBinding(QuestContactBinding::bind) + + private val contact get() = binding.nameInput?.text?.toString().orEmpty().trim() + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + binding.nameInput.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_URI + + binding.nameInput.setText(PREFILL) + binding.nameInput.addTextChangedListener(TextChangedWatcher { checkIsFormComplete() }) + } + + override fun onClickOk() { + applyAnswer(contact) + } + + + override fun isFormComplete() = contact.isNotEmpty() && contact != PREFILL +} + +private const val PREFILL = "http://" diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/crossing_type/AddCrossingTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/crossing_type/AddCrossingTypeForm.kt index 4d9bf1c1bd..4f0b3db695 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/crossing_type/AddCrossingTypeForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/crossing_type/AddCrossingTypeForm.kt @@ -10,6 +10,7 @@ class AddCrossingTypeForm : AImageListQuestAnswerFragment = listOf( - NONE, TRACK, EXCLUSIVE_LANE, ADVISORY_LANE, UNSPECIFIED_LANE, SUGGESTION_LANE, SEPARATE, + NONE, PICTOGRAMS, BUSWAY, SIDEWALK_EXPLICIT, diff --git a/app/src/main/res/layout/fragment_quest_answer.xml b/app/src/main/res/layout/fragment_quest_answer.xml index 7a3abf4a74..a47f66fb0f 100644 --- a/app/src/main/res/layout/fragment_quest_answer.xml +++ b/app/src/main/res/layout/fragment_quest_answer.xml @@ -172,6 +172,19 @@ android:visibility="gone" /> + + diff --git a/app/src/main/res/layout/quest_contact.xml b/app/src/main/res/layout/quest_contact.xml new file mode 100644 index 0000000000..0bd955aa83 --- /dev/null +++ b/app/src/main/res/layout/quest_contact.xml @@ -0,0 +1,10 @@ + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 75c0a08206..c9f5d53135 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -371,6 +371,7 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards Controlled by traffic lights Marked Without road markings + Zebra crossing Undo Undo the following edit? Synced @@ -547,6 +548,8 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards What religion is practiced at this place? Christianity Islam + "What is the phone number of %s?" + "What is the website of %s?" Hinduism Buddhism Shinto