forked from streetcomplete/StreetComplete
-
-
Notifications
You must be signed in to change notification settings - Fork 24
created quests for lgbtq people #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jan-leila
wants to merge
25
commits into
Helium314:modified
Choose a base branch
from
jan-leila:lgbtq-quests
base: modified
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
83c725f
created quests for lgbtq people
jan-leila d4d6c8b
added filter to not tag moments
jan-leila 3cce8cc
added handling for lgbtq=only
jan-leila 1f0f3ff
simplified filters
jan-leila 9a75e34
Split the list of countries in 2 groups
mscherer 1786667
Merge pull request #1 from mscherer/lgbtq
jan-leila 9fcc650
removed lgbtq signed quest
jan-leila f03893a
formatted excluded countries
jan-leila f9bdfcb
added hide option to access quest
jan-leila 111c0df
Merge branch 'modified' into lgbtq-quests
jan-leila 320922e
fixed crash on temp hide
jan-leila 6772f44
Add icons for LGBTQ quests
flavia-telcean 29629e4
Fix typos
flavia-telcean 32b66cd
Switch hiding behaviour to normal
flavia-telcean caafa4f
Add attribution
flavia-telcean 800e35d
Merge pull request #2 from tiberiu-telcean/lgbtq-quests
jan-leila 9673685
Merge branch 'modified' into lgbtq-quests
jan-leila 0fbf2c7
made LGBTQAccess quest text only
jan-leila 316e9a3
simplified LGBTQAccessQuest
jan-leila 7d656cc
fixed crash on not marked
jan-leila 881d19c
added vet and music stores to filters
jan-leila 8af39b4
fixed formating on LGBTPropagandaCountries
jan-leila e9963af
merged not posted and hide forever
jan-leila 15f6eb6
fix: changed woman to women
jan-leila ef8738c
Merge remote-tracking branch 'scee/modified' into lgbtq-quests
jan-leila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
app/src/main/java/de/westnordost/streetcomplete/quests/lgbtq/ExcludedCountries.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| import de.westnordost.streetcomplete.data.quest.AllCountriesExcept | ||
|
|
||
| // countries with a LGBT propaganda law, and not in the list of country | ||
| // where homosexuality is illegal | ||
| val LGBTPropagandaCountries = | ||
| listOf( | ||
| // Belarus, see https://www.reuters.com/world/europe/belarus-prepares-law-against-lgbt-propaganda-state-media-says-2024-02-19/ | ||
| // "BY", | ||
| // Georgia, see https://oc-media.org/georgian-dream-announces-draft-law-against-pseudo-liberal-ideology/ | ||
| // "GE", | ||
| // Kyrgyzstan, see https://en.wikipedia.org/wiki/Kyrgyz_anti-LGBT_propaganda_law | ||
| "KY", | ||
| // Russia, since 2013 and worst since 2023 | ||
| "RU", | ||
| ) | ||
|
|
||
| // countries where homosexuality is illegal | ||
| // even if unenforced or just for male | ||
| val LGBTHomosexualityIllegalCountries = | ||
| listOf( | ||
| // United Arab Emirates | ||
| "AE", | ||
| // Afghanistan | ||
| "AF", | ||
| // Bangladesh | ||
| "BD", | ||
| // Burundi | ||
| "BI", | ||
| // Brunei Darussalam | ||
| "BN", | ||
| // Cameroon | ||
| "CM", | ||
| // Dominica | ||
| "DM", | ||
|
jan-leila marked this conversation as resolved.
|
||
| // Algeria | ||
| "DZ", | ||
| // Egypt | ||
| "EG", | ||
| // Eritrea | ||
| "ER", | ||
| // Ethiopia | ||
| "ET", | ||
| // Grenada | ||
| "GD", | ||
| // Ghana | ||
| "GH", | ||
| // Gambia | ||
| "GM", | ||
| // Guinea | ||
| "GN", | ||
| // Guyana | ||
| "GY", | ||
| // Indonesia | ||
| // not illegal, except in one province where it is enforced | ||
| "ID", | ||
| // Iraq | ||
| "IQ", | ||
| // Iran | ||
| "IR", | ||
| // Jamaica | ||
| "JM", | ||
| // Kenya | ||
| "KE", | ||
| // Kiribati, just for male, but not enforced | ||
| "KI", | ||
| // Comoros | ||
| "KM", | ||
| // Kuwait, just for male | ||
| "KW", | ||
| // Lebanon, unsure in 2024, cf wikipedia | ||
| "LB", | ||
| // Sri Lanka | ||
| "LK", | ||
| // Liberia | ||
| "LR", | ||
| // Libya | ||
| "LY", | ||
| // Morocco | ||
| "MA", | ||
| // Myanmar | ||
| "MM", | ||
| // Mauritania | ||
| "MR", | ||
| // Maldives, not enforced | ||
| "MV", | ||
| // Malawi | ||
| "MW", | ||
| // Malaysia | ||
| "MY", | ||
| // Namibia, not enforced | ||
|
jan-leila marked this conversation as resolved.
|
||
| "NA", | ||
| // Nigeria | ||
| "NG", | ||
| // Niue | ||
| "NU", | ||
| // Oman | ||
| "OM", | ||
| // Papua New Guinea , illegal for male only | ||
| "PG", | ||
| // Pakistan | ||
| "PK", | ||
| // Qatar | ||
| "QA", | ||
| // Saudi Arabia | ||
| "SA", | ||
| // Solomon Islands | ||
| "SB", | ||
| // Sudan | ||
| "SD", | ||
| // Sierra Leone, illegal for male only | ||
| "SL", | ||
| // Senegal | ||
| "SN", | ||
| // Somalia | ||
| "SO", | ||
| // South Sudan | ||
| "SS", | ||
| // Eswatini | ||
| "SZ", | ||
| // Chad | ||
| "TD", | ||
| // Togo | ||
| "TG", | ||
| // Turkmenistan, illegal for male only | ||
| "TM", | ||
| // Tunisia | ||
| "TN", | ||
| // Tonga, illegal for male only | ||
| "TO", | ||
| // Tuvalu,illegal for male only, not enforced | ||
| "TV", | ||
| // Tanzania | ||
| "TZ", | ||
| // Uganda | ||
| "UG", | ||
| // Uzbekistan, illegal for male only | ||
| "UZ", | ||
| // Saint Lucia | ||
| "WL", | ||
| // Samoa, illegal for male only, not enforced | ||
| "WS", | ||
| // Saint Vincent and the Grenadines | ||
| "WV", | ||
| // Yemen | ||
| "YE", | ||
| // Zambia | ||
| "ZM", | ||
| // Zimbabwe | ||
| "ZW" | ||
| ) | ||
|
|
||
| // country where mapping would be fruitless and/or dangerous | ||
| val LGBTExcludedCountries = AllCountriesExcept( | ||
|
Comment on lines
+154
to
+155
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't that be named |
||
| listOf( | ||
| LGBTHomosexualityIllegalCountries, | ||
| LGBTPropagandaCountries | ||
| ).flatten() | ||
| ) | ||
25 changes: 25 additions & 0 deletions
25
app/src/main/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQAccessForm.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| import de.westnordost.streetcomplete.R | ||
| import de.westnordost.streetcomplete.quests.AListQuestForm | ||
| import de.westnordost.streetcomplete.quests.AnswerItem | ||
| import de.westnordost.streetcomplete.quests.TextItem | ||
|
|
||
| class LGBTQAccessForm : AListQuestForm<String?>() { | ||
|
|
||
| override val items get() = listOf<TextItem<String?>>( | ||
| TextItem("no", R.string.quest_lgbtq_access_no), | ||
| TextItem("welcome", R.string.quest_lgbtq_access_welcome), | ||
| TextItem("primary", R.string.quest_lgbtq_access_primary), | ||
| TextItem("only", R.string.quest_lgbtq_access_only), | ||
| ) | ||
|
|
||
| override val otherAnswers get() = listOfNotNull( | ||
| AnswerItem(R.string.quest_lgbtq_access_not_marked) { | ||
| tempHideQuest() | ||
| }, | ||
|
jan-leila marked this conversation as resolved.
Outdated
|
||
| AnswerItem(R.string.quest_lgbtq_access_hide_forever) { | ||
| hideQuest() | ||
| }, | ||
| ) | ||
| } | ||
45 changes: 45 additions & 0 deletions
45
app/src/main/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQAccessQuest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| import de.westnordost.streetcomplete.R | ||
| import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry | ||
| import de.westnordost.streetcomplete.data.osm.mapdata.Element | ||
| import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry | ||
| import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType | ||
| import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement | ||
| import de.westnordost.streetcomplete.osm.Tags | ||
|
|
||
| class LGBTQAccessQuest : OsmFilterQuestType<String?>() { | ||
| override val elementFilter = """ | ||
| nodes, ways with ( | ||
| amenity ~ swingerclub|nightclub|bar|pub|cafe|restaurant|place_of_worship|community_centre|library|doctors|social_facility | ||
| or shop ~ erotic|books | ||
| or leisure ~ sauna|nightclub|nightlife | ||
| ) | ||
| and (!seasonal or seasonal = no) | ||
| and !brand and !wikipedia:brand and !wikidata:brand | ||
| and !memorial and !historic | ||
| and !lgbtq | ||
| """ | ||
|
|
||
| // countries that are listed here ban lgbtq people | ||
| override val enabledInCountries = LGBTExcludedCountries | ||
|
|
||
| override val changesetComment = "Survey lgbtq access" | ||
| override val wikiLink = "Key:lgbtq" | ||
| override val icon = R.drawable.ic_quest_lgbtq | ||
| override val achievements = listOf(EditTypeAchievement.CITIZEN) | ||
|
|
||
| override fun getTitle(tags: Map<String, String>) = R.string.quest_lgbtq_access | ||
|
|
||
| override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable<Element> = | ||
| mapData.filter { isApplicableTo(it) } | ||
|
|
||
| override fun isApplicableTo(element: Element): Boolean = filter.matches(element) | ||
| override fun createForm() = LGBTQAccessForm() | ||
|
|
||
| override fun applyAnswerTo(answer: String?, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { | ||
| answer?.let { | ||
| tags["lgbtq"] = it | ||
| } | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQGenderSpecialization.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| enum class LGBTQGenderSpecialization { | ||
| NONE, | ||
| MEN, | ||
|
jan-leila marked this conversation as resolved.
|
||
| WOMAN, | ||
| NON_BINARY, | ||
| } | ||
14 changes: 14 additions & 0 deletions
14
...src/main/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQGenderSpecializationForm.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| import de.westnordost.streetcomplete.R | ||
| import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm | ||
| import de.westnordost.streetcomplete.quests.AnswerItem | ||
|
|
||
| class LGBTQGenderSpecializationForm : AbstractOsmQuestForm<LGBTQGenderSpecialization>() { | ||
| override val buttonPanelAnswers = listOf( | ||
| AnswerItem(R.string.quest_lgbtq_gender_specialization_men) { applyAnswer(LGBTQGenderSpecialization.MEN) }, | ||
| AnswerItem(R.string.quest_lgbtq_gender_specialization_woman) { applyAnswer(LGBTQGenderSpecialization.WOMAN) }, | ||
| AnswerItem(R.string.quest_lgbtq_gender_specialization_non_binary) { applyAnswer(LGBTQGenderSpecialization.NON_BINARY) }, | ||
| AnswerItem(R.string.quest_lgbtq_gender_specialization_none) { applyAnswer(LGBTQGenderSpecialization.NONE) }, | ||
| ) | ||
| } |
44 changes: 44 additions & 0 deletions
44
...rc/main/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQGenderSpecializationQuest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| 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 | ||
| import de.westnordost.streetcomplete.osm.Tags | ||
|
|
||
| class LGBTQGenderSpecializationQuest : OsmFilterQuestType<LGBTQGenderSpecialization>() { | ||
| override val elementFilter = """ | ||
| nodes with lgbtq ~ primary|only and !(lgbtq:men or lgbtq:woman or lgbtq:non_binary) | ||
| and !memorial and !historic | ||
| """ | ||
|
|
||
| // countries that are listed here ban lgbtq people | ||
| override val enabledInCountries = LGBTExcludedCountries | ||
|
|
||
| override val changesetComment = "Survey lgbtq specificity" | ||
| override val wikiLink = "Key:lgbtq" | ||
| override val icon = R.drawable.ic_quest_gender | ||
| override val achievements = listOf(EditTypeAchievement.CITIZEN) | ||
|
|
||
| override fun getTitle(tags: Map<String, String>) = R.string.quest_lgbtq_gender_specialization | ||
|
|
||
| override fun createForm() = LGBTQGenderSpecializationForm() | ||
|
|
||
| override fun applyAnswerTo(answer: LGBTQGenderSpecialization, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) = | ||
| when (answer) { | ||
| LGBTQGenderSpecialization.NONE -> { | ||
| tags["lgbtq:men"] = "welcome" | ||
| tags["lgbtq:woman"] = "welcome" | ||
| tags["lgbtq:non_binary"] = "welcome" | ||
| } | ||
| LGBTQGenderSpecialization.MEN -> { | ||
| tags["lgbtq:men"] = tags["lgbtq"] ?: "primary" | ||
| } | ||
| LGBTQGenderSpecialization.WOMAN -> { | ||
| tags["lgbtq:woman"] = tags["lgbtq"] ?: "primary" | ||
| } | ||
| LGBTQGenderSpecialization.NON_BINARY -> { | ||
| tags["lgbtq:non_binary"] = tags["lgbtq"] ?: "primary" | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
...rc/main/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQTransgenderSpecialization.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| enum class LGBTQTransgenderSpecialization { | ||
| YES, | ||
| NO, | ||
| BANNED, | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ain/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQTransgenderSpecializationForm.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| import de.westnordost.streetcomplete.R | ||
| import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm | ||
| import de.westnordost.streetcomplete.quests.AnswerItem | ||
|
|
||
| class LGBTQTransgenderSpecializationForm : AbstractOsmQuestForm<LGBTQTransgenderSpecialization>() { | ||
| override val buttonPanelAnswers = listOf( | ||
| AnswerItem(R.string.quest_generic_hasFeature_no) { | ||
| applyAnswer( | ||
| LGBTQTransgenderSpecialization.NO | ||
| ) | ||
| }, | ||
| AnswerItem(R.string.quest_generic_hasFeature_yes) { | ||
| applyAnswer( | ||
| LGBTQTransgenderSpecialization.YES | ||
| ) | ||
| }, | ||
| AnswerItem(R.string.quest_lgbtq_transgender_specialization_banned) { | ||
| applyAnswer( | ||
| LGBTQTransgenderSpecialization.BANNED | ||
| ) | ||
| }, | ||
| ) | ||
| } |
41 changes: 41 additions & 0 deletions
41
...in/java/de/westnordost/streetcomplete/quests/lgbtq/LGBTQTransgenderSpecializationQuest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package de.westnordost.streetcomplete.quests.lgbtq | ||
|
|
||
| import de.westnordost.streetcomplete.R | ||
| import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry | ||
| import de.westnordost.streetcomplete.data.osm.mapdata.Element | ||
| import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry | ||
| import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType | ||
| import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement | ||
| import de.westnordost.streetcomplete.osm.Tags | ||
|
|
||
| class LGBTQTransgenderSpecializationQuest : OsmFilterQuestType<LGBTQTransgenderSpecialization>() { | ||
| override val elementFilter = """ | ||
| nodes, ways with lgbtq ~ primary|only and !lgbtq:trans | ||
| and !memorial and !historic | ||
| """ | ||
|
|
||
| // countries that are listed here ban lgbtq people | ||
| override val enabledInCountries = LGBTExcludedCountries | ||
|
jan-leila marked this conversation as resolved.
|
||
|
|
||
| override val changesetComment = "Survey lgbtq transgender specialization" | ||
| override val wikiLink = "Key:lgbtq" | ||
| override val icon = R.drawable.ic_quest_trans | ||
| override val achievements = listOf(EditTypeAchievement.CITIZEN) | ||
|
|
||
| override fun getTitle(tags: Map<String, String>) = R.string.quest_lgbtq_transgender_specialization | ||
|
|
||
| override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable<Element> = | ||
| mapData.filter { isApplicableTo(it) } | ||
|
|
||
| override fun isApplicableTo(element: Element): Boolean = filter.matches(element) | ||
|
|
||
| override fun applyAnswerTo(answer: LGBTQTransgenderSpecialization, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { | ||
| when (answer) { | ||
| LGBTQTransgenderSpecialization.YES -> tags["lgbtq:trans"] = "primary" | ||
| LGBTQTransgenderSpecialization.NO -> tags["lgbtq:trans"] = "welcome" | ||
| LGBTQTransgenderSpecialization.BANNED -> tags["lgbtq:trans"] = "no" | ||
| } | ||
| } | ||
|
|
||
| override fun createForm() = LGBTQTransgenderSpecializationForm() | ||
| } | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.