-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4008 from FloEdelmann/bicycle-rental-capacity
Add bicycle rental capacity quest
- Loading branch information
Showing
10 changed files
with
128 additions
and
1 deletion.
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
39 changes: 39 additions & 0 deletions
39
...n/java/de/westnordost/streetcomplete/quests/bike_rental_capacity/AddBikeRentalCapacity.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,39 @@ | ||
package de.westnordost.streetcomplete.quests.bike_rental_capacity | ||
|
||
import de.westnordost.streetcomplete.R | ||
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.osm.osmquests.Tags | ||
import de.westnordost.streetcomplete.data.user.achievements.QuestTypeAchievement.BICYCLIST | ||
import de.westnordost.streetcomplete.osm.updateWithCheckDate | ||
import de.westnordost.streetcomplete.quests.bike_parking_capacity.AddBikeParkingCapacityForm | ||
|
||
class AddBikeRentalCapacity : OsmFilterQuestType<Int>() { | ||
|
||
override val elementFilter = """ | ||
nodes, ways with | ||
amenity = bicycle_rental | ||
and access !~ private|no | ||
and bicycle_rental = docking_station | ||
and (!capacity or capacity older today -6 years) | ||
""" | ||
|
||
override val changesetComment = "Add bicycle rental capacities" | ||
override val wikiLink = "Tag:amenity=bicycle_rental" | ||
override val icon = R.drawable.ic_quest_bicycle_rental_capacity | ||
override val isDeleteElementEnabled = true | ||
override val questTypeAchievements = listOf(BICYCLIST) | ||
|
||
override fun getTitle(tags: Map<String, String>) = R.string.quest_bicycle_rental_capacity_title | ||
|
||
override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = | ||
getMapData().filter("nodes, ways with amenity = bicycle_rental") | ||
|
||
override fun createForm() = AddBikeParkingCapacityForm.create(showClarificationText = false) | ||
|
||
override fun applyAnswerTo(answer: Int, tags: Tags, timestampEdited: Long) { | ||
tags.updateWithCheckDate("capacity", answer.toString()) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="40dp" | ||
android:height="40dp" | ||
android:viewportWidth="40" | ||
android:viewportHeight="40"> | ||
<path | ||
android:pathData="m9.3642,4.5455h21.272c1.8134,0 3.2733,1.4599 3.2733,3.2733v24.363c0,1.8134 -1.4599,3.2733 -3.2733,3.2733h-21.272c-1.8134,0 -3.2733,-1.4599 -3.2733,-3.2733v-24.363c0,-1.8134 1.4599,-3.2733 3.2733,-3.2733z" | ||
android:strokeWidth="3" | ||
android:fillColor="#495aad" | ||
android:strokeColor="#fff"/> | ||
<path | ||
android:pathData="m17.703,27.947a3.8926,3.8926 0,0 1,-3.8926 3.8926,3.8926 3.8926,0 0,1 -3.8926,-3.8926 3.8926,3.8926 0,0 1,3.8926 -3.8926,3.8926 3.8926,0 0,1 3.8926,3.8926m12.685,-0.0007a3.8926,3.8926 0,0 1,-3.8926 3.8926,3.8926 3.8926,0 0,1 -3.8926,-3.8926 3.8926,3.8926 0,0 1,3.8926 -3.8926,3.8926 3.8926,0 0,1 3.8926,3.8926m-14.413,-5.9952 l4.9196,5.9736h5.6228l-3.8656,-5.9736h-6.6768m6.6768,-1.4056 l1.7126,-0.0035m-3.4696,7.3826 l1.757,-7.3795m-8.7851,7.3795 l2.9288,-8.7198h2.8112" | ||
android:strokeWidth="1.3527" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#fff"/> | ||
<path | ||
android:pathData="m29.274,10.126c-0.8883,-0.8865 -2.115,-1.4299 -3.4692,-1.4198 -2.2398,0 -4.1805,1.5122 -4.8118,3.524h-10.588l-1.2217,1.2192v0.8128l2.0362,2.0321h1.2217l1.2217,-1.2192h0.4072l1.2217,1.2192h2.4434l1.2217,-1.2192h2.0362c0.5905,2.0524 2.5313,3.4661 4.7507,3.4457 2.7489,0.0203 4.9682,-2.1945 4.9682,-4.9176 0,-1.3615 -0.5498,-2.5911 -1.4381,-3.4776zM28.3199,12.557c0.2698,0.2693 0.4379,0.6402 0.4379,1.0466 0.0204,0.8332 -0.6517,1.5038 -1.5069,1.5038 -0.8145,0 -1.4866,-0.6708 -1.4866,-1.4836 0,-0.8128 0.672,-1.4835 1.5069,-1.5038 0.4072,0 0.7789,0.1677 1.0487,0.437z" | ||
android:fillColor="#fff"/> | ||
</vector> |
34 changes: 34 additions & 0 deletions
34
app/src/main/res/drawable/ic_quest_bicycle_rental_capacity.xml
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,34 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="128dp" | ||
android:height="128dp" | ||
android:viewportWidth="128" | ||
android:viewportHeight="128"> | ||
<path | ||
android:pathData="m128,64c0,35.346 -28.654,64 -64,64s-64,-28.654 -64,-64 28.654,-64 64,-64 64,28.654 64,64" | ||
android:strokeWidth=".2" | ||
android:fillColor="#ca72e2"/> | ||
<path | ||
android:pathData="m36.222,24h55.056c4.694,0 8.472,3.779 8.472,8.472v63.056c0,4.694 -3.779,8.472 -8.472,8.472h-55.056c-4.694,0 -8.472,-3.779 -8.472,-8.472v-63.056c0,-4.694 3.779,-8.472 8.472,-8.472z" | ||
android:strokeAlpha="0.2" | ||
android:strokeWidth="8" | ||
android:fillColor="#00000000" | ||
android:strokeColor="#000"/> | ||
<path | ||
android:pathData="m36.347,20.111h55.056c4.694,0 8.472,3.779 8.472,8.472v63.056c0,4.694 -3.779,8.472 -8.472,8.472h-55.056c-4.694,0 -8.472,-3.779 -8.472,-8.472v-63.056c0,-4.694 3.779,-8.472 8.472,-8.472z" | ||
android:strokeAlpha="0.98995" | ||
android:strokeWidth="8" | ||
android:fillColor="#495aad" | ||
android:strokeColor="#fff"/> | ||
<path | ||
android:pathData="m87.877,34.851c-2.299,-2.295 -5.474,-3.701 -8.979,-3.675 -5.797,0 -10.82,3.914 -12.454,9.121h-27.405l-3.162,3.156v2.104l5.27,5.26h3.162l3.162,-3.156h1.054l3.162,3.156h6.324l3.162,-3.156h5.27c1.528,5.312 6.552,8.971 12.296,8.918 7.115,0.053 12.859,-5.68 12.859,-12.728 0,-3.524 -1.423,-6.706 -3.722,-9.001zM85.408,41.143c0.698,0.697 1.133,1.657 1.133,2.709 0.053,2.156 -1.687,3.892 -3.9,3.892 -2.108,0 -3.848,-1.736 -3.848,-3.84s1.739,-3.84 3.9,-3.892c1.054,0 2.016,0.434 2.714,1.131z" | ||
android:strokeWidth=".74457" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="m39.599,67.319c2.299,-2.295 5.474,-3.701 8.979,-3.675 5.797,0 10.82,3.914 12.454,9.121h27.405l3.162,3.156v2.104l-5.27,5.26h-3.162l-3.162,-3.156h-1.054l-3.162,3.156h-6.324l-3.162,-3.156h-5.27c-1.528,5.312 -6.552,8.971 -12.296,8.918 -7.115,0.053 -12.859,-5.68 -12.859,-12.728 0,-3.524 1.423,-6.706 3.722,-9.001zM42.068,73.611c-0.698,0.697 -1.133,1.657 -1.133,2.709 -0.053,2.156 1.687,3.892 3.9,3.892 2.108,0 3.848,-1.736 3.848,-3.84s-1.739,-3.84 -3.9,-3.892c-1.054,0 -2.016,0.434 -2.714,1.131z" | ||
android:strokeWidth=".74457" | ||
android:fillColor="#fff"/> | ||
<path | ||
android:pathData="m36.348,16.111c-6.84,0 -12.473,5.63 -12.473,12.471v63.057c0,6.84 5.632,12.473 12.473,12.473h55.055c6.84,0 12.473,-5.632 12.473,-12.473v-63.057c0,-6.84 -5.632,-12.471 -12.473,-12.471zM36.348,24.111h55.055c2.547,0 4.473,1.924 4.473,4.471v63.057c0,2.547 -1.926,4.473 -4.473,4.473h-55.055c-2.547,0 -4.473,-1.926 -4.473,-4.473v-63.057c0,-2.547 1.926,-4.471 4.473,-4.471z" | ||
android:fillColor="#fff" | ||
android:fillAlpha="0.98995"/> | ||
</vector> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.