-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into parcel_locker_brand
- Loading branch information
Showing
22 changed files
with
386 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
33 changes: 33 additions & 0 deletions
33
.../java/de/westnordost/streetcomplete/quests/parcel_locker_mail_in/AddParcelLockerMailIn.kt
This file contains 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,33 @@ | ||
package de.westnordost.streetcomplete.quests.parcel_locker_mail_in | ||
|
||
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.mapdata.filter | ||
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType | ||
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.POSTMAN | ||
import de.westnordost.streetcomplete.osm.Tags | ||
import de.westnordost.streetcomplete.quests.YesNoQuestForm | ||
import de.westnordost.streetcomplete.util.ktx.toYesNo | ||
|
||
class AddParcelLockerMailIn : OsmFilterQuestType<Boolean>() { | ||
|
||
override val elementFilter = "nodes with amenity = parcel_locker and !parcel_mail_in" | ||
override val changesetComment = "Specify if it's possible to drop off parcels with this locker" | ||
override val wikiLink = "Tag:amenity=parcel_locker" | ||
override val icon = R.drawable.ic_quest_parcel_locker_deposit | ||
override val isDeleteElementEnabled = true | ||
override val achievements = listOf(POSTMAN) | ||
|
||
override fun getTitle(tags: Map<String, String>) = R.string.quest_parcel_locker_mail_in | ||
|
||
override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = | ||
getMapData().filter("nodes with amenity = parcel_locker") | ||
|
||
override fun createForm() = YesNoQuestForm() | ||
|
||
override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { | ||
tags["parcel_mail_in"] = answer.toYesNo() | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...n/java/de/westnordost/streetcomplete/quests/parcel_locker_pickup/AddParcelLockerPickup.kt
This file contains 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,33 @@ | ||
package de.westnordost.streetcomplete.quests.parcel_locker_pickup | ||
|
||
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.mapdata.filter | ||
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType | ||
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.POSTMAN | ||
import de.westnordost.streetcomplete.osm.Tags | ||
import de.westnordost.streetcomplete.quests.YesNoQuestForm | ||
import de.westnordost.streetcomplete.util.ktx.toYesNo | ||
|
||
class AddParcelLockerPickup : OsmFilterQuestType<Boolean>() { | ||
|
||
override val elementFilter = "nodes with amenity = parcel_locker and !parcel_pickup" | ||
override val changesetComment = "Specify if it's possible to pickup parcels with this locker" | ||
override val wikiLink = "Tag:amenity=parcel_locker" | ||
override val icon = R.drawable.ic_quest_parcel_locker_pickup | ||
override val isDeleteElementEnabled = true | ||
override val achievements = listOf(POSTMAN) | ||
|
||
override fun getTitle(tags: Map<String, String>) = R.string.quest_parcel_locker_pickup | ||
|
||
override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = | ||
getMapData().filter("nodes with amenity = parcel_locker") | ||
|
||
override fun createForm() = YesNoQuestForm() | ||
|
||
override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { | ||
tags["parcel_pickup"] = answer.toYesNo() | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.