Skip to content

Commit

Permalink
Merge branch 'mnalis-v38b1-smoothness-helium314' into mnalis-v38-smoo…
Browse files Browse the repository at this point in the history
…thness-helium314
  • Loading branch information
mnalis committed Nov 25, 2021
2 parents c495e5e + 2c13028 commit 099a552
Show file tree
Hide file tree
Showing 15 changed files with 286 additions and 30 deletions.
33 changes: 12 additions & 21 deletions CHANGES-mnalis.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 ?
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ abstract class AbstractQuestAnswerFragment<T> :
if (binding.content.childCount == 0) {
binding.content.visibility = View.GONE
}

binding.hideButton.popIn()
binding.hideButton.setOnClickListener { skipQuest() }
}

override fun onDestroyView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ---------------------------------------------------- */

Expand Down
Original file line number Diff line number Diff line change
@@ -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<String>() {

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<String, String>) = R.string.quest_contact_phone

override fun getTitleArgs(tags: Map<String, String>, featureName: Lazy<String?>): Array<String> {
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)
}

}
Original file line number Diff line number Diff line change
@@ -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<String>() {

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 = "+"
Original file line number Diff line number Diff line change
@@ -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<String>() {

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<String, String>) = R.string.quest_contact_website

override fun getTitleArgs(tags: Map<String, String>, featureName: Lazy<String?>): Array<String> {
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)
}

}
Original file line number Diff line number Diff line change
@@ -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<String>() {

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://"
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AddCrossingTypeForm : AImageListQuestAnswerFragment<CrossingType, Crossing
override val items = listOf(
Item(TRAFFIC_SIGNALS, R.drawable.crossing_type_signals, R.string.quest_crossing_type_signals_controlled),
Item(MARKED, R.drawable.crossing_type_zebra, R.string.quest_crossing_type_marked),
Item(ZEBRA, R.drawable.crossing_type_zebra, R.string.quest_crossing_type_zebra),
Item(UNMARKED, R.drawable.crossing_type_unmarked, R.string.quest_crossing_type_unmarked)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ enum class CrossingType(val osmValue: String) {
TRAFFIC_SIGNALS("traffic_signals"),
MARKED("marked"),
UNMARKED("unmarked"),
ZEBRA("zebra"),
}
Loading

0 comments on commit 099a552

Please sign in to comment.