diff --git a/app/src/androidTest/java/de/westnordost/streetcomplete/quests/AddPostboxCollectionTimesTest.java b/app/src/androidTest/java/de/westnordost/streetcomplete/quests/AddPostboxCollectionTimesTest.java index c72f27aa79..d770912ad4 100644 --- a/app/src/androidTest/java/de/westnordost/streetcomplete/quests/AddPostboxCollectionTimesTest.java +++ b/app/src/androidTest/java/de/westnordost/streetcomplete/quests/AddPostboxCollectionTimesTest.java @@ -11,7 +11,7 @@ public void testNoTimes() { bundle.putBoolean(AddCollectionTimesForm.NO_TIMES_SPECIFIED, true); verify( - new StringMapEntryAdd("note:collection_times","no times specified on the box")); + new StringMapEntryAdd("collection_times:signed","no")); } public void testTimes() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHours.java b/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHours.java index 8cfd3adbf0..d664f3f8a2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHours.java +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHours.java @@ -55,7 +55,7 @@ public class AddOpeningHours extends SimpleOverpassQuestType " tourism = information and information = office or" + " leisure ~ " + TextUtils.join("|",leisures) + " or" + " office ~ " + TextUtils.join("|",offices) + ")" + - " and !opening_hours and name" + + " and !opening_hours and name and opening_hours:signed != no" + " and (access !~ private|no)"; // exclude ones without access to general public } @@ -67,6 +67,11 @@ public class AddOpeningHours extends SimpleOverpassQuestType @Override public void applyAnswerTo(Bundle answer, StringMapChangesBuilder changes) { String openingHours = answer.getString(AddOpeningHoursForm.OPENING_HOURS); + if(answer.getBoolean(AddOpeningHoursForm.NO_SIGN)) + { + changes.add("opening_hours:signed", "no"); + return; + } if(openingHours != null) { changes.add("opening_hours", openingHours); diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHoursForm.java b/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHoursForm.java index 6595b9f449..079565392f 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHoursForm.java +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/AddOpeningHoursForm.java @@ -10,7 +10,6 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; -import android.widget.Toast; import java.util.ArrayList; import java.util.List; @@ -31,6 +30,7 @@ public class AddOpeningHoursForm extends AbstractQuestFormAnswerFragment { public static final String OPENING_HOURS = "opening_hours"; + public static final String NO_SIGN = "no_sign"; private static final String OPENING_HOURS_DATA = "oh_data", IS_ADD_MONTHS_MODE = "oh_add_months"; @@ -84,6 +84,7 @@ private void initOpeningHoursAdapter(View contentView, Bundle savedInstanceState private void addOtherAnswers() { + addOtherAnswer(R.string.quest_openingHours_no_sign, this::confirmNoSign); addOtherAnswer(R.string.quest_openingHours_answer_no_regular_opening_hours, this::showInputCommentDialog); addOtherAnswer(R.string.quest_openingHours_answer_247, this::showConfirm24_7Dialog); addOtherAnswer(R.string.quest_openingHours_answer_seasonal_opening_hours, this::changeToMonthsMode); @@ -168,6 +169,20 @@ private void showConfirm24_7Dialog() .show(); } + private void confirmNoSign() + { + new AlertDialogBuilder(getActivity()) + .setTitle(R.string.quest_generic_confirmation_title) + .setPositiveButton(R.string.quest_generic_confirmation_yes, (dialog, which) -> + { + Bundle data = new Bundle(); + data.putBoolean(NO_SIGN, true); + applyImmediateAnswer(data); + }) + .setNegativeButton(R.string.quest_generic_confirmation_no, null) + .show(); + } + private void changeToMonthsMode() { isAlsoAddingMonths = true; diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.java b/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.java index d09b2aedeb..bb60527ab9 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.java +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.java @@ -18,7 +18,7 @@ public class AddPostboxCollectionTimes extends SimpleOverpassQuestType @Override protected String getTagFilters() { - return "nodes with amenity=post_box and !collection_times and !note:collection_times and (access !~ private|no)"; + return "nodes with amenity=post_box and !collection_times and collection_times:signed != no and (access !~ private|no)"; } @Override public AbstractQuestAnswerFragment createForm() @@ -31,7 +31,7 @@ public class AddPostboxCollectionTimes extends SimpleOverpassQuestType boolean noTimes = answer.getBoolean(AddCollectionTimesForm.NO_TIMES_SPECIFIED); if(noTimes) { - changes.add("note:collection_times","no times specified on the box"); + changes.add("collection_times:signed","no"); } else { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2d258c0ade..b6ff471773 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -455,6 +455,7 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards Invalidate Invalidating the cache causes the quests to be updated next time they are downloaded. The quest cache is invalidated automatically after one week and immediately when a quest you solved turns out to be already answered by someone else. You need to describe what is on the sign. If there is no sign, you should ask for the opening hours inside. + No opening hours sign none, but cyclists may use road in both directions Usually looks like this: Metal @@ -610,7 +611,6 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards The building was tagged as: Is this correct and is it not just part of a building? What defines the speed limit? - "Download" Is this playground publicly accessible? How are the footway and cycleway laid out here?