Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

def MAPZEN_API_KEY = hasProperty('mapzenApiKey') ? '"' + mapzenApiKey + '"' : "null";

android {
signingConfigs {
release
}

compileSdkVersion 26
buildToolsVersion '26.0.1'
buildToolsVersion '26.0.2'
testOptions {
unitTests.returnDefaultValues = true
}
Expand Down Expand Up @@ -67,8 +67,8 @@ dependencies {
androidTestCompile "com.crittercism.dexmaker:dexmaker-mockito:1.4"

// dependency injection
compile 'com.google.dagger:dagger:2.5'
apt 'com.google.dagger:dagger-compiler:2.5'
compile 'com.google.dagger:dagger:2.6'
annotationProcessor "com.google.dagger:dagger-compiler:2.6"

// Android stuff
compile 'com.android.support:appcompat-v7:26.0.1'
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/assets/cinnabar-style-7.0.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
global:
# Sign up for a Mapzen API key to enjoy higher rate limits
# https://mapzen.com/documentation/overview/#developer-accounts-and-api-keys
sdk_mapzen_api_key: '' # set this value to your Mapzen API key
sdk_mapzen_api_key: 'zFdp5U-JTXuK-RJBybOCVQ' # set this value to your Mapzen API key

#ux/ui
ux_language: false # l10n language code, trusting OSM in v0.10 tiles, fixed in v1.0 tiles
Expand Down Expand Up @@ -722,9 +722,12 @@ sources:
#binary MVT format is used in StreetComplete as it is recommended for mobile
#https://mapzen.com/documentation/vector-tiles/)
# https has been causing problems for certain Android devices - https://github.com/westnordost/StreetComplete/issues/175
url: http://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt
# url: http://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt
url: https://tile.nextzen.org/tilezen/vector/v1/256/all/{z}/{x}/{y}.mvt
#url: '//tile.dev.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson'
#url: //localhost:8080/vector/all/{z}/{x}/{y}.json
url_params:
api_key: zFdp5U-JTXuK-RJBybOCVQ
max_zoom: 16

# # Only enable this for local debug, should not be enabled for prod (app inserts these at runtime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
public class MainActivity extends AppCompatActivity implements
OsmQuestAnswerListener, VisibleQuestListener, QuestsMapFragment.Listener, MapFragment.Listener
{
@Inject CrashReportExceptionHandler crashReportExceptionHandler;
Queue<Quest> questsToDo;

@Inject CrashReportExceptionHandler crashReportExceptionHandler;

@Inject LocationRequestFragment locationRequestFragment;
@Inject QuestAutoSyncer questAutoSyncer;
Expand All @@ -110,7 +112,6 @@ public class MainActivity extends AppCompatActivity implements
private ProgressBar progressBar;
private AnswersCounter answersCounter;

private Queue<Quest> questsToDo;

private boolean downloadServiceIsBound;
private QuestDownloadService.Interface downloadService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.westnordost.streetcomplete.data.osm;

import android.util.Log;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to leave the logging so long as the debug level (Log.d?) is disabled in production!


import java.util.Collections;

import de.westnordost.osmapi.map.data.Element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public TagFilterExpression parse(String input)
}
}

private int expectAnyNumberOfSpaces()
private int expectAnyNumberOfSpaces() throws ParseException
{
int count = 0;
while(input.nextIsAndAdvance(' ')) count++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@
import de.westnordost.streetcomplete.data.QuestTypes;
import de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao;
import de.westnordost.streetcomplete.data.osmnotes.OsmNoteQuestType;
import de.westnordost.streetcomplete.quests.baby_changing_table.AddBabyChangingTable;
import de.westnordost.streetcomplete.quests.bike_parking_capacity.AddBikeParkingCapacity;
import de.westnordost.streetcomplete.quests.bike_parking_cover.AddBikeParkingCover;
import de.westnordost.streetcomplete.quests.building_levels.AddBuildingLevels;
import de.westnordost.streetcomplete.quests.bus_stop_lit.AddBusStopLit;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused quests! e.g. baby_changing_table

import de.westnordost.streetcomplete.quests.bus_stop_bench.AddBusStopBench;
import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter;
import de.westnordost.streetcomplete.quests.passenger_information_display.AddPassengerInformationDisplay;
import de.westnordost.streetcomplete.quests.crossing_type.AddCrossingType;
import de.westnordost.streetcomplete.quests.curb_ramps_tactile_pavings.CheckCurbRamps_TactilePavings;
import de.westnordost.streetcomplete.quests.road_name.data.PutRoadNameSuggestionsHandler;
import de.westnordost.streetcomplete.quests.road_name.data.RoadNameSuggestionsDao;
import de.westnordost.streetcomplete.quests.tactile_paving.AddTactilePavingBusStop;
import de.westnordost.streetcomplete.quests.sidewalk_lit.SidewalkLit;
import de.westnordost.streetcomplete.quests.sidewalk_surface.AddFootwaySurface;
import de.westnordost.streetcomplete.quests.bin.AddBin;

@Module
Expand All @@ -32,18 +30,17 @@ public class QuestModule
RoadNameSuggestionsDao roadNameSuggestionsDao,
PutRoadNameSuggestionsHandler putRoadNameSuggestionsHandler)
{
QuestType[] questTypesOrderedByImportance = {
QuestType[] questTypesOrderedByImportance = new QuestType[]{
// ↓ notes
osmNoteQuestType,

new SidewalkLit(o),
new AddFootwaySurface(o),
new CheckCurbRamps_TactilePavings(o),
new AddBusStopBench(o),
new AddBusStopShelter(o),
new AddBusStopLit(o),
new AddBin(o),
new AddPassengerInformationDisplay(o),
new AddTactilePavingBusStop(o)
new AddBin(o)
};

return new QuestTypes(Arrays.asList(questTypesOrderedByImportance));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,42 @@
import de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment;
import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment;

public class AddBusStopLit extends SimpleOverpassQuestType
{
@Inject public AddBusStopLit(OverpassMapDataDao overpassServer) { super(overpassServer); }
public class AddBusStopLit extends SimpleOverpassQuestType {
@Inject
public AddBusStopLit(OverpassMapDataDao overpassServer) {
super(overpassServer);
}

@Override protected String getTagFilters()
{
@Override
protected String getTagFilters() {
return "nodes with (public_transport=platform or (highway=bus_stop and public_transport!=stop_position)) and !lit";
}

public AbstractQuestAnswerFragment createForm()
{
public AbstractQuestAnswerFragment createForm() {
return new YesNoQuestAnswerFragment();
}

public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes)
{
public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes) {
String yesno = answer.getBoolean(YesNoQuestAnswerFragment.ANSWER) ? "yes" : "no";
changes.add("lit", yesno);
}

@Override public String getCommitMessage() { return "Add bus stop lit"; }
@Override public int getIcon() { return R.drawable.ic_quest_bus; }
@Override public int getTitle(Map<String, String> tags)
{
@Override
public String getCommitMessage() {
return "Add bus stop lit";
}

@Override
public int getIcon() {
return R.drawable.ic_quest_bus;
}

@Override
public int getTitle(Map<String, String> tags) {
boolean hasName = tags.containsKey("name");
if(hasName) return R.string.quest_busStopLit_name_title;
else return R.string.quest_busStopLit_title;
if (hasName) return R.string.quest_busStopLit_question2;
else return R.string.quest_busStopLit_question2;

}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package de.westnordost.streetcomplete.quests.crossing_markings;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disable for now - we will want to add as ways, hopefully under a different schema.


import android.os.Bundle;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.data.osm.SimpleOverpassQuestType;
import de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder;
import de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao;
import de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment;

public class AddCrossingMarkings extends SimpleOverpassQuestType
{
@Inject public AddCrossingMarkings(OverpassMapDataDao overpassServer) { super(overpassServer); }

@Override
protected String getTagFilters() { return "nodes with highway=crossing and !crossing"; }

public AbstractQuestAnswerFragment createForm()
{
return new AddCrossingMarkingsForm();
}

public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes)
{
List<String> values = answer.getStringArrayList(AddCrossingMarkingsForm.OSM_VALUES);
if(values != null && values.size() == 1)
{

changes.add("crossing", values.get(0));
}
}

@Override public String getCommitMessage() { return "Add crossing type"; }
@Override public int getIcon() { return R.drawable.ic_quest_pedestrian_crossing; }
@Override public int getTitle(Map<String, String> tags)
{
return R.string.quest_crossing_type_title;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package de.westnordost.streetcomplete.quests.crossing_markings;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.quests.ImageListQuestAnswerFragment;

public class AddCrossingMarkingsForm extends ImageListQuestAnswerFragment
{
private final OsmItem[] TYPES = new OsmItem[] {
new OsmItem("traffic_signals", R.drawable.crossing_type_signals, R.string.quest_crossing_type_signals),
new OsmItem("uncontrolled", R.drawable.crossing_type_zebra, R.string.quest_crossing_type_uncontrolled),
new OsmItem("unmarked", R.drawable.crossing_type_unmarked, R.string.quest_crossing_type_unmarked)
};

@Override protected OsmItem[] getItems() { return TYPES; }
@Override protected int getItemsPerRow() { return 3; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package de.westnordost.streetcomplete.quests.curb_ramps_tactile_pavings;

import android.os.Bundle;

import java.util.Map;

import javax.inject.Inject;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.data.osm.SimpleOverpassQuestType;
import de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder;
import de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao;
import de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment;
import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment;

public class CheckCurbRamps_TactilePavings extends SimpleOverpassQuestType
{
@Inject public CheckCurbRamps_TactilePavings(OverpassMapDataDao overpassServer)
{ super(overpassServer); }

@Override protected String getTagFilters()
{
//return "nodes, ways with "(("footway"="crossing") "and" ("kerb"="lowered"))";

return "nodes with (" +
"(kerb=lowered)" +
"and (!tactile_paving))";
}

public AbstractQuestAnswerFragment createForm()
{
return new YesNoQuestAnswerFragment();
}

public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes)
{
String yesno = answer.getBoolean(YesNoQuestAnswerFragment.ANSWER) ? "yes" : "no";
changes.add("curb_ramps", yesno);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have an image? Would be handy for users to know what counts as 'tactile paving'.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this isn't necessary to change before release - only if it's super super easy and fast.

@Override public String getCommitMessage() { return "Add curb ramps"; }
@Override public int getIcon() { return R.drawable.ic_quest_street_surface_paved_detail; }
@Override public int getTitle(Map<String, String> tags)
{
boolean hasName = tags.containsKey("name");
if(hasName) return R.string.quest_curb_ramps;
else return R.string.quest_curb_ramps;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package de.westnordost.streetcomplete.quests.sidewalk_lit;
import android.os.Bundle;
import android.util.Log;

import java.util.Map;

import javax.inject.Inject;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.data.osm.SimpleOverpassQuestType;
import de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder;
import de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao;
import de.westnordost.streetcomplete.quests.AbstractQuestAnswerFragment;
//import de.westnordost.streetcomplete.quests.RangeQuestAnswerFragment;
//import de.westnordost.streetcomplete.quests.TwoLevelQuestAnswerFragment;
import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment;

public class SidewalkLit extends SimpleOverpassQuestType
{
@Inject public SidewalkLit(OverpassMapDataDao overpassServer) { super(overpassServer); }

@Override protected String getTagFilters()
{
return "ways with (" +
"((highway=footway) and (footway=sidewalk)" +
" or foot=yes" +
") and !lit)";
}


public AbstractQuestAnswerFragment createForm()
{
return new YesNoQuestAnswerFragment();
}

public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes)
{
String yesno = answer.getBoolean(SidewalkLitForm.ANSWER) ? "yes" : "no";
changes.add("lit", yesno);
}

@Override public String getCommitMessage() { return "Add sidewalk lit"; }
@Override public int getIcon() { return R.drawable.ic_quest_lantern; }
@Override public int getTitle(Map<String, String> tags)
{
boolean hasName = tags.containsKey("name");
if(hasName) return R.string.quest_SidewalkLit_title;
else return R.string.quest_SidewalkLit_title;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.westnordost.streetcomplete.quests.sidewalk_lit;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import de.westnordost.streetcomplete.R;
import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment;

public class SidewalkLitForm extends YesNoQuestAnswerFragment
{
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View view = super.onCreateView(inflater, container, savedInstanceState);
setContentView(R.layout.sidewalk_lit);


return view;
}
}
Loading