diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestType.kt b/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestType.kt index 6bcc3bc9ca..f10ac108d5 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestType.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestType.kt @@ -12,6 +12,12 @@ import de.westnordost.streetcomplete.quests.AbstractQuestForm * Most QuestType inherit from [OsmElementQuestType][de.westnordost.streetcomplete.data.osm.osmquests.OsmElementQuestType] */ interface QuestType : EditType { + /** Hint text to be shown when the user taps on the ℹ️ button */ + val hint: Int? get() = null + + /** Hint pictures to be shown when the user taps on the ℹ️ button */ + val hintImages: List get() = emptyList() + /** the string resource id that explains why this quest is disabled by default or zero if it is * not disabled by default. * diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt index 2902b7f9b7..abf21b47e8 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt @@ -1,9 +1,11 @@ package de.westnordost.streetcomplete.quests +import android.graphics.drawable.Drawable import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.ImageView import androidx.annotation.AnyThread import androidx.core.os.bundleOf import androidx.core.view.isGone @@ -30,7 +32,6 @@ import de.westnordost.streetcomplete.view.CharSequenceText import de.westnordost.streetcomplete.view.ResText import de.westnordost.streetcomplete.view.Text import de.westnordost.streetcomplete.view.setText -import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import org.koin.android.ext.android.inject @@ -59,7 +60,6 @@ abstract class AbstractQuestForm : override val bottomSheetTitle get() = binding.speechBubbleTitleContainer override val bottomSheetContent get() = binding.speechbubbleContentContainer override val floatingBottomView get() = binding.okButtonContainer - override val backButton get() = binding.closeButton protected val scrollView: NestedScrollView get() = binding.scrollView private var startedOnce = false @@ -90,6 +90,8 @@ abstract class AbstractQuestForm : private var initialMapRotation = 0f private var initialMapTilt = 0f + private var infoIsExpanded: Boolean = false + // overridable by child classes open val contentLayoutResId: Int? = null open val contentPadding = true @@ -117,6 +119,8 @@ abstract class AbstractQuestForm : setTitle(resources.getString(questType.title)) setTitleHintLabel(null) + setHint(questType.hint?.let { resources.getString(it) }) + setHintImages(questType.hintImages.mapNotNull { requireContext().getDrawable(it) }) binding.okButton.setOnClickListener { if (!isFormComplete()) { @@ -126,6 +130,10 @@ abstract class AbstractQuestForm : } } + infoIsExpanded = false + binding.infoButton.setOnClickListener { toggleInfoArea() } + binding.infoArea.setOnClickListener { toggleInfoArea() } + // no content? -> hide the content container if (binding.content.childCount == 0) { binding.content.visibility = View.GONE @@ -155,6 +163,38 @@ abstract class AbstractQuestForm : binding.titleHintLabel.text = text } + protected fun setHint(text: CharSequence?) { + binding.infoText.isGone = text == null + binding.infoText.text = text + updateInfoButtonVisibility() + } + + protected fun setHintImages(images: List) { + binding.infoPictures.isGone = images.isEmpty() + binding.infoPictures.removeAllViews() + for (image in images) { + val imageView = ImageView(requireContext()) + imageView.setImageDrawable(image) + imageView.scaleType + binding.infoPictures.addView(imageView) + } + updateInfoButtonVisibility() + } + + private fun toggleInfoArea() { + infoIsExpanded = !infoIsExpanded + binding.infoButton.setImageResource( + if (infoIsExpanded) R.drawable.ic_info_filled_24dp + else R.drawable.ic_info_outline_24dp + ) + binding.infoButton.isActivated = infoIsExpanded + binding.infoArea.isGone = !infoIsExpanded + } + + private fun updateInfoButtonVisibility() { + binding.infoButton.isGone = binding.infoText.isGone && binding.infoPictures.isGone + } + /** Inflate given layout resource id into the content view and return the inflated view */ protected fun setContentView(resourceId: Int): View { if (binding.content.childCount > 0) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/LeaveNoteInsteadFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/LeaveNoteInsteadFragment.kt index f1557434c2..4ab5a5fc61 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/LeaveNoteInsteadFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/LeaveNoteInsteadFragment.kt @@ -39,7 +39,6 @@ class LeaveNoteInsteadFragment : AbstractCreateNoteFragment() { override val bottomSheetTitle get() = binding.speechBubbleTitleContainer override val bottomSheetContent get() = binding.speechbubbleContentContainer override val floatingBottomView get() = binding.okButtonContainer - override val backButton get() = binding.closeButton override val okButton get() = binding.okButton override val okButtonContainer get() = binding.okButtonContainer diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacity.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacity.kt index 167594f352..3d0f42127d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacity.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacity.kt @@ -31,13 +31,14 @@ class AddBikeParkingCapacity : OsmFilterQuestType() { override val icon = R.drawable.ic_quest_bicycle_parking_capacity override val isDeleteElementEnabled = true override val achievements = listOf(BICYCLIST) + override val hint = R.string.quest_bikeParkingCapacity_hint override fun getTitle(tags: Map) = R.string.quest_bikeParkingCapacity_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().filter("nodes, ways with amenity = bicycle_parking") - override fun createForm() = AddBikeParkingCapacityForm.create(showClarificationText = true) + override fun createForm() = AddBikeParkingCapacityForm() override fun applyAnswerTo(answer: Int, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags.updateWithCheckDate("capacity", answer.toString()) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacityForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacityForm.kt index 0d98f86d73..4caec5a46c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacityForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/bike_parking_capacity/AddBikeParkingCapacityForm.kt @@ -2,8 +2,6 @@ package de.westnordost.streetcomplete.quests.bike_parking_capacity import android.os.Bundle import android.view.View -import androidx.core.os.bundleOf -import androidx.core.view.isGone import androidx.core.widget.doAfterTextChanged import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.databinding.QuestBikeParkingCapacityBinding @@ -19,8 +17,6 @@ class AddBikeParkingCapacityForm : AbstractOsmQuestForm() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - val showClarificationText = arguments?.getBoolean(ARG_SHOW_CLARIFICATION) ?: false - binding.clarificationText.isGone = !showClarificationText binding.capacityInput.doAfterTextChanged { checkIsFormComplete() } } @@ -29,14 +25,4 @@ class AddBikeParkingCapacityForm : AbstractOsmQuestForm() { override fun onClickOk() { applyAnswer(capacity) } - - companion object { - private const val ARG_SHOW_CLARIFICATION = "show_clarification" - - fun create(showClarificationText: Boolean): AddBikeParkingCapacityForm { - val form = AddBikeParkingCapacityForm() - form.arguments = bundleOf(ARG_SHOW_CLARIFICATION to showClarificationText) - return form - } - } } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/bike_rental_capacity/AddBikeRentalCapacity.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/bike_rental_capacity/AddBikeRentalCapacity.kt index 20eeb34f90..0d6392e081 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/bike_rental_capacity/AddBikeRentalCapacity.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/bike_rental_capacity/AddBikeRentalCapacity.kt @@ -32,7 +32,7 @@ class AddBikeRentalCapacity : OsmFilterQuestType() { override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().filter("nodes, ways with amenity = bicycle_rental") - override fun createForm() = AddBikeParkingCapacityForm.create(showClarificationText = false) + override fun createForm() = AddBikeParkingCapacityForm() override fun applyAnswerTo(answer: Int, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags.updateWithCheckDate("capacity", answer.toString()) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevels.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevels.kt index 582751f12f..2ea461d4f9 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevels.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevels.kt @@ -27,6 +27,8 @@ class AddBuildingLevels : OsmFilterQuestType() { override val achievements = listOf(BUILDING) override val defaultDisabledMessage = R.string.default_disabled_msg_difficult_and_time_consuming + override val hint = R.string.quest_buildingLevels_hint + override fun getTitle(tags: Map) = when { tags.containsKey("building:part") -> R.string.quest_buildingLevels_title_buildingPart2 else -> R.string.quest_buildingLevels_title2 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/cycleway/AddCycleway.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/cycleway/AddCycleway.kt index 49f0579323..6203fcd7e7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/cycleway/AddCycleway.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/cycleway/AddCycleway.kt @@ -72,6 +72,8 @@ class AddCycleway( "US-AZ", "US-TX" ) + override val hint = R.string.quest_street_side_puzzle_tutorial + override fun getTitle(tags: Map) = when { parseCyclewaySides(tags, false) != null -> R.string.quest_cycleway_resurvey_title else -> R.string.quest_cycleway_title2 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddDietTypeForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddDietTypeForm.kt index ad6c299a16..42bbce3c16 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddDietTypeForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddDietTypeForm.kt @@ -1,11 +1,7 @@ package de.westnordost.streetcomplete.quests.diet_type -import android.os.Bundle -import android.view.View import androidx.appcompat.app.AlertDialog -import androidx.core.os.bundleOf import de.westnordost.streetcomplete.R -import de.westnordost.streetcomplete.databinding.QuestDietTypeExplanationBinding import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm import de.westnordost.streetcomplete.quests.AnswerItem import de.westnordost.streetcomplete.quests.diet_type.DietAvailability.DIET_NO @@ -23,7 +19,6 @@ class AddDietTypeForm : AbstractOsmQuestForm() { } override val contentLayoutResId = R.layout.quest_diet_type_explanation - private val binding by contentViewBinding(QuestDietTypeExplanationBinding::bind) override val buttonPanelAnswers = listOf( AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(DIET_NO) }, @@ -31,27 +26,6 @@ class AddDietTypeForm : AbstractOsmQuestForm() { AnswerItem(R.string.quest_hasFeature_only) { applyAnswer(DIET_ONLY) }, ) - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - val resId = arguments?.getInt(ARG_DIET) ?: 0 - if (resId > 0) { - binding.descriptionLabel.setText(resId) - } else { - binding.descriptionLabel.visibility = View.GONE - } - } - - companion object { - private const val ARG_DIET = "diet_explanation" - - fun create(dietExplanationResId: Int): AddDietTypeForm { - val form = AddDietTypeForm() - form.arguments = bundleOf(ARG_DIET to dietExplanationResId) - return form - } - } - private fun confirmNoFood() { val ctx = context ?: return AlertDialog.Builder(ctx) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddHalal.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddHalal.kt index 0eadbeca77..f06e77ebc0 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddHalal.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddHalal.kt @@ -31,12 +31,14 @@ class AddHalal : OsmFilterQuestType() { override val achievements = listOf(CITIZEN) override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside_regional_warning + override val hint = R.string.quest_dietType_explanation_halal + override fun getTitle(tags: Map) = R.string.quest_dietType_halal_name_title2 override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().asSequence().filter { it.isPlaceOrDisusedShop() } - override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_halal) + override fun createForm() = AddDietTypeForm() override fun applyAnswerTo(answer: DietAvailabilityAnswer, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { when (answer) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddKosher.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddKosher.kt index 62bf7e3ad9..fd5ae1c25d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddKosher.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddKosher.kt @@ -31,12 +31,14 @@ class AddKosher : OsmFilterQuestType() { override val achievements = listOf(CITIZEN) override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside_regional_warning + override val hint = R.string.quest_dietType_explanation_kosher + override fun getTitle(tags: Map) = R.string.quest_dietType_kosher_name_title2 override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().asSequence().filter { it.isPlaceOrDisusedShop() } - override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_kosher) + override fun createForm() = AddDietTypeForm() override fun applyAnswerTo(answer: DietAvailabilityAnswer, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { when (answer) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegan.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegan.kt index 8752a25321..bc79a7e245 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegan.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegan.kt @@ -35,12 +35,14 @@ class AddVegan : OsmFilterQuestType() { override val achievements = listOf(VEG, CITIZEN) override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val hint = R.string.quest_dietType_explanation_vegan + override fun getTitle(tags: Map) = R.string.quest_dietType_vegan_title2 override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().asSequence().filter { it.isPlaceOrDisusedShop() } - override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_vegan) + override fun createForm() = AddDietTypeForm() override fun applyAnswerTo(answer: DietAvailabilityAnswer, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { when (answer) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegetarian.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegetarian.kt index 995fd6ad24..ed707d19b6 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegetarian.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/diet_type/AddVegetarian.kt @@ -31,12 +31,14 @@ class AddVegetarian : OsmFilterQuestType() { override val achievements = listOf(VEG, CITIZEN) override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val hint = R.string.quest_dietType_explanation_vegetarian + override fun getTitle(tags: Map) = R.string.quest_dietType_vegetarian_title2 override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().asSequence().filter { it.isPlaceOrDisusedShop() } - override fun createForm() = AddDietTypeForm.create(R.string.quest_dietType_explanation_vegetarian) + override fun createForm() = AddDietTypeForm() override fun applyAnswerTo(answer: DietAvailabilityAnswer, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { when (answer) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestrians.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestrians.kt index 8f57b1c6f6..0944b5ccd9 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestrians.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestrians.kt @@ -8,7 +8,6 @@ import de.westnordost.streetcomplete.osm.ROADS_ASSUMED_TO_BE_PAVED import de.westnordost.streetcomplete.osm.Tags import de.westnordost.streetcomplete.osm.surface.ANYTHING_PAVED import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.HAS_SEPARATE_SIDEWALK -import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.IS_LIVING_STREET import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.NO import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.YES @@ -63,7 +62,6 @@ class AddProhibitedForPedestrians : OsmFilterQuestType tags["highway"] = "living_street" } } } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestriansForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestriansForm.kt index 042713f605..674ab40e28 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestriansForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/foot/AddProhibitedForPedestriansForm.kt @@ -1,50 +1,17 @@ package de.westnordost.streetcomplete.quests.foot -import androidx.appcompat.app.AlertDialog import de.westnordost.streetcomplete.R -import de.westnordost.streetcomplete.databinding.DialogLivingStreetConfirmationBinding -import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm -import de.westnordost.streetcomplete.quests.AnswerItem +import de.westnordost.streetcomplete.quests.AListQuestForm +import de.westnordost.streetcomplete.quests.TextItem import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.HAS_SEPARATE_SIDEWALK -import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.IS_LIVING_STREET import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.NO import de.westnordost.streetcomplete.quests.foot.ProhibitedForPedestriansAnswer.YES -import de.westnordost.streetcomplete.util.ktx.livingStreetSignDrawableResId -class AddProhibitedForPedestriansForm : AbstractOsmQuestForm() { +class AddProhibitedForPedestriansForm : AListQuestForm() { - override val contentLayoutResId = R.layout.quest_prohibited_for_pedestrians_separate_sidewalk_explanation - - override val buttonPanelAnswers = listOf( - AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(NO) }, - AnswerItem(R.string.quest_generic_hasFeature_yes) { applyAnswer(YES) }, - AnswerItem(R.string.quest_sidewalk_value_yes) { applyAnswer(HAS_SEPARATE_SIDEWALK) } + override val items = listOf( + TextItem(YES, R.string.quest_accessible_for_pedestrians_prohibited), + TextItem(NO, R.string.quest_accessible_for_pedestrians_allowed), + TextItem(HAS_SEPARATE_SIDEWALK, R.string.quest_accessible_for_pedestrians_separate_sidewalk), ) - - // the living street answer stuff is copied from AddMaxSpeedForm - override val otherAnswers: List get() { - val result = mutableListOf() - - val highwayTag = element.tags["highway"]!! - if (countryInfo.hasLivingStreet && MAYBE_LIVING_STREET.contains(highwayTag)) { - result.add(AnswerItem(R.string.quest_maxspeed_answer_living_street) { confirmLivingStreet() }) - } - return result - } - - private fun confirmLivingStreet() { - val ctx = context ?: return - val dialogBinding = DialogLivingStreetConfirmationBinding.inflate(layoutInflater) - countryInfo.livingStreetSignDrawableResId?.let { dialogBinding.livingStreetImage.setImageResource(it) } - AlertDialog.Builder(ctx) - .setView(dialogBinding.root) - .setTitle(R.string.quest_maxspeed_answer_living_street_confirmation_title) - .setPositiveButton(R.string.quest_generic_confirmation_yes) { _, _ -> applyAnswer(IS_LIVING_STREET) } - .setNegativeButton(R.string.quest_generic_confirmation_no, null) - .show() - } - - companion object { - private val MAYBE_LIVING_STREET = listOf("residential", "unclassified") - } } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/foot/ProhibitedForPedestriansAnswer.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/foot/ProhibitedForPedestriansAnswer.kt index 6c85506277..c632d131b6 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/foot/ProhibitedForPedestriansAnswer.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/foot/ProhibitedForPedestriansAnswer.kt @@ -3,6 +3,5 @@ package de.westnordost.streetcomplete.quests.foot enum class ProhibitedForPedestriansAnswer { YES, NO, - IS_LIVING_STREET, HAS_SEPARATE_SIDEWALK } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleIncline.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleIncline.kt index 6dadbe720f..87a79c7613 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleIncline.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleIncline.kt @@ -46,6 +46,8 @@ class AddBicycleIncline : OsmElementQuestType { return null } + override val hint = R.string.quest_arrow_tutorial + override fun getTitle(tags: Map) = R.string.quest_bicycle_incline_title override fun createForm() = AddBicycleInclineForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddStepsIncline.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddStepsIncline.kt index cee576352e..ed98fe0507 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddStepsIncline.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddStepsIncline.kt @@ -20,6 +20,8 @@ class AddStepsIncline : OsmFilterQuestType() { override val icon = R.drawable.ic_quest_steps override val achievements = listOf(PEDESTRIAN) + override val hint = R.string.quest_arrow_tutorial + override fun getTitle(tags: Map) = R.string.quest_steps_incline_title override fun createForm() = AddInclineForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt index b303704887..dd8e7b2770 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt @@ -182,6 +182,7 @@ class AddLanesForm : AbstractOsmQuestForm() { lifecycle.removeObserver(it.puzzleView) } + setHint(requireContext().getString(R.string.quest_street_side_puzzle_tutorial)) val view = setContentView(R.layout.quest_street_lanes_puzzle) val streetLanesPuzzleBinding = QuestStreetLanesPuzzleBinding.bind(view) this.streetLanesPuzzleBinding = streetLanesPuzzleBinding diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/max_height/AddMaxHeightForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/max_height/AddMaxHeightForm.kt index 6757c6a342..ea4b5be85d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/max_height/AddMaxHeightForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/max_height/AddMaxHeightForm.kt @@ -28,9 +28,11 @@ class AddMaxHeightForm : AbstractOsmQuestForm() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - val splitWayHint = view.findViewById(R.id.splitWayHint) - splitWayHint?.text = getString(R.string.quest_maxheight_split_way_hint, getString(R.string.quest_generic_answer_differs_along_the_way)) - splitWayHint?.isGone = element.type == ElementType.NODE + if (element.type == ElementType.WAY) { + setHint(getString(R.string.quest_maxheight_split_way_hint, + getString(R.string.quest_generic_answer_differs_along_the_way) + )) + } lengthInput = LengthInputViewController( unitSelect = view.findViewById(R.id.heightUnitSelect), diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOneway.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOneway.kt index 9847e617b6..16d7ad2086 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOneway.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOneway.kt @@ -36,6 +36,8 @@ class AddOneway : OsmElementQuestType { override val hasMarkersAtEnds = true override val achievements = listOf(CAR) + override val hint = R.string.quest_arrow_tutorial + override fun getTitle(tags: Map) = R.string.quest_oneway2_title override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOneway.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOneway.kt index 62e6597dae..c3fddde79f 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOneway.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOneway.kt @@ -41,6 +41,8 @@ class AddSuspectedOneway( override val hasMarkersAtEnds = true override val achievements = listOf(CAR) + override val hint = R.string.quest_arrow_tutorial + override fun getTitle(tags: Map) = R.string.quest_oneway_title override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlass.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlass.kt index 98df5410b4..6268e86408 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlass.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlass.kt @@ -30,6 +30,8 @@ class DetermineRecyclingGlass : OsmFilterQuestType() { override val isDeleteElementEnabled = true override val achievements = listOf(CITIZEN) + override val hint = R.string.quest_determineRecyclingGlass_description_any_glass + override fun getTitle(tags: Map) = R.string.quest_recycling_glass_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlassForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlassForm.kt index 8d66baa1a1..654e42ac07 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlassForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/recycling_glass/DetermineRecyclingGlassForm.kt @@ -7,7 +7,6 @@ import de.westnordost.streetcomplete.quests.recycling_glass.RecyclingGlass.ANY import de.westnordost.streetcomplete.quests.recycling_glass.RecyclingGlass.BOTTLES class DetermineRecyclingGlassForm : AbstractOsmQuestForm() { - override val contentLayoutResId = R.layout.quest_determine_recycling_glass_explanation override val buttonPanelAnswers = listOf( AnswerItem(R.string.quest_recycling_type_any_glass) { applyAnswer(ANY) }, diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt index 590b46e401..26f41a5e71 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStation.kt @@ -5,7 +5,7 @@ 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 -import de.westnordost.streetcomplete.sanitary_dump_station.AddSanitaryDumpStationForm +import de.westnordost.streetcomplete.quests.YesNoQuestForm import de.westnordost.streetcomplete.util.ktx.toYesNo class AddSanitaryDumpStation : OsmFilterQuestType() { @@ -25,9 +25,15 @@ class AddSanitaryDumpStation : OsmFilterQuestType() { override val icon = R.drawable.ic_quest_caravan override val achievements = listOf(EditTypeAchievement.OUTDOORS) + override val hint = R.string.quest_sanitary_dump_station_description + override val hintImages = listOf( + R.drawable.sanitary_dump_station_sign1, + R.drawable.sanitary_dump_station_sign2 + ) + override fun getTitle(tags: Map) = R.string.quest_sanitary_dump_station_title - override fun createForm() = AddSanitaryDumpStationForm() + override fun createForm() = YesNoQuestForm() override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags["sanitary_dump_station"] = answer.toYesNo() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStationForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStationForm.kt deleted file mode 100644 index 2cacc78780..0000000000 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/sanitary_dump_station/AddSanitaryDumpStationForm.kt +++ /dev/null @@ -1,15 +0,0 @@ -package de.westnordost.streetcomplete.sanitary_dump_station - -import de.westnordost.streetcomplete.R -import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm -import de.westnordost.streetcomplete.quests.AnswerItem - -class AddSanitaryDumpStationForm : AbstractOsmQuestForm() { - - override val contentLayoutResId = R.layout.quest_sanitary_dump_station - - override val buttonPanelAnswers = listOf( - AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(false) }, - AnswerItem(R.string.quest_generic_hasFeature_yes) { applyAnswer(true) } - ) -} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/segregated/AddCyclewaySegregationForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/segregated/AddCyclewaySegregationForm.kt index 9c221c2a14..fe3b811e38 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/segregated/AddCyclewaySegregationForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/segregated/AddCyclewaySegregationForm.kt @@ -10,7 +10,7 @@ class AddCyclewaySegregationForm : AImageListQuestForm() { override val icon = R.drawable.ic_quest_street_shoulder override val achievements = listOf(CAR) + override val hint = R.string.quest_shoulder_explanation2 + override fun getTitle(tags: Map) = R.string.quest_shoulder_title override fun createForm() = AddShoulderForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/shoulder/AddShoulderForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/shoulder/AddShoulderForm.kt index 6957501469..2119fc897c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/shoulder/AddShoulderForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/shoulder/AddShoulderForm.kt @@ -2,7 +2,6 @@ package de.westnordost.streetcomplete.quests.shoulder import android.os.Bundle import android.view.View -import android.widget.TextView import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.quests.AStreetSideSelectForm import de.westnordost.streetcomplete.util.ktx.shoulderLineStyleResId @@ -16,7 +15,11 @@ class AddShoulderForm : AStreetSideSelectForm() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - view.findViewById(R.id.descriptionLabel).setText(R.string.quest_shoulder_explanation2) + // we have actually two hints, so we concatenate them here... + setHint( + resources.getString(R.string.quest_shoulder_explanation2) + "\n" + + resources.getString(R.string.quest_street_side_puzzle_tutorial) + ) } override fun onClickSide(isRight: Boolean) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/sidewalk/AddSidewalk.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/sidewalk/AddSidewalk.kt index 02705b2374..05112edef5 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/sidewalk/AddSidewalk.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/sidewalk/AddSidewalk.kt @@ -34,6 +34,8 @@ class AddSidewalk : OsmElementQuestType { and access !~ no|private """) + override val hint = R.string.quest_street_side_puzzle_tutorial + override fun getTitle(tags: Map) = R.string.quest_sidewalk_title override fun getApplicableElements(mapData: MapDataWithGeometry): Iterable = diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/smoothness/AddSmoothnessForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/smoothness/AddSmoothnessForm.kt index c7c833d431..22cc0c4ea4 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/smoothness/AddSmoothnessForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/smoothness/AddSmoothnessForm.kt @@ -49,9 +49,7 @@ class AddSmoothnessForm : AImageListQuestForm() { stringBuilder.replaceEmojiWithImageSpan(context, "🚲", R.drawable.ic_smoothness_city_bike) stringBuilder.replaceEmojiWithImageSpan(context, "🚗", R.drawable.ic_smoothness_car) stringBuilder.replaceEmojiWithImageSpan(context, "🚙", R.drawable.ic_smoothness_suv) - - binding.descriptionLabel.isGone = false - binding.descriptionLabel.text = stringBuilder + setHint(stringBuilder) } override val moveFavoritesToFront = false diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountForm.kt index 26f5846923..e3169e7c0f 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountForm.kt @@ -18,13 +18,6 @@ class AddStepCountForm : AbstractOsmQuestForm() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - val resId = arguments?.getInt(ARG_DESCRIPTION) ?: 0 - if (resId > 0) { - binding.descriptionLabel.setText(resId) - } else { - binding.descriptionLabel.visibility = View.GONE - } - binding.countInput.doAfterTextChanged { checkIsFormComplete() } } @@ -33,14 +26,4 @@ class AddStepCountForm : AbstractOsmQuestForm() { override fun onClickOk() { applyAnswer(count) } - - companion object { - private const val ARG_DESCRIPTION = "description" - - fun create(descriptionResId: Int): AddStepCountForm { - val form = AddStepCountForm() - form.arguments = bundleOf(ARG_DESCRIPTION to descriptionResId) - return form - } - } } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountStile.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountStile.kt index f306f5c6f5..6ef6693843 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountStile.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/step_count/AddStepCountStile.kt @@ -42,9 +42,11 @@ class AddStepCountStile : OsmElementQuestType { override val icon = R.drawable.ic_quest_steps_count_brown override val achievements = listOf(OUTDOORS) + override val hint = R.string.quest_step_count_stile_hint + override fun getTitle(tags: Map) = R.string.quest_step_count_title - override fun createForm() = AddStepCountForm.create(R.string.quest_step_count_stile_hint) + override fun createForm() = AddStepCountForm() override fun applyAnswerTo(answer: Int, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags["step_count"] = answer.toString() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/surface/AddSidewalkSurface.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/surface/AddSidewalkSurface.kt index 81ec009f9b..b133b299b3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/surface/AddSidewalkSurface.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/surface/AddSidewalkSurface.kt @@ -33,6 +33,8 @@ class AddSidewalkSurface : OsmFilterQuestType() { override val achievements = listOf(PEDESTRIAN, WHEELCHAIR) override val defaultDisabledMessage = R.string.default_disabled_msg_difficult_and_time_consuming + override val hint = R.string.quest_street_side_puzzle_tutorial + override fun getTitle(tags: Map) = R.string.quest_sidewalk_surface_title override fun createForm() = AddSidewalkSurfaceForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingBusStop.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingBusStop.kt index 2c66e824bc..2739007105 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingBusStop.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingBusStop.kt @@ -30,6 +30,13 @@ class AddTactilePavingBusStop : OsmFilterQuestType() { override val enabledInCountries = COUNTRIES_WHERE_TACTILE_PAVING_IS_COMMON override val achievements = listOf(BLIND) + override val hint = R.string.quest_generic_looks_like_this + override val hintImages = listOf( + R.drawable.tactile_paving1, + R.drawable.tactile_paving2, + R.drawable.tactile_paving3 + ) + override fun getTitle(tags: Map) = R.string.quest_busStopTactilePaving_title override fun createForm() = TactilePavingForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingCrosswalk.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingCrosswalk.kt index a710acef1b..15a55f4bed 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingCrosswalk.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingCrosswalk.kt @@ -40,6 +40,13 @@ class AddTactilePavingCrosswalk : OsmElementQuestType) = R.string.quest_tactilePaving_title_crosswalk override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingKerb.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingKerb.kt index effd433ec7..9a7801a5b7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingKerb.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingKerb.kt @@ -30,6 +30,13 @@ class AddTactilePavingKerb : OsmElementQuestType { override val enabledInCountries = COUNTRIES_WHERE_TACTILE_PAVING_IS_COMMON override val achievements = listOf(BLIND) + override val hint = R.string.quest_generic_looks_like_this + override val hintImages = listOf( + R.drawable.tactile_paving1, + R.drawable.tactile_paving2, + R.drawable.tactile_paving3 + ) + override fun getTitle(tags: Map) = R.string.quest_tactile_paving_kerb_title override fun createForm() = TactilePavingForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingSteps.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingSteps.kt index d1c59bb65c..d94b82aef5 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingSteps.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/AddTactilePavingSteps.kt @@ -30,6 +30,13 @@ class AddTactilePavingSteps : OsmFilterQuestType() { override val enabledInCountries = COUNTRIES_WHERE_TACTILE_PAVING_IS_COMMON override val achievements = listOf(BLIND) + override val hint = R.string.quest_generic_looks_like_this + override val hintImages = listOf( + R.drawable.tactile_paving1, + R.drawable.tactile_paving2, + R.drawable.tactile_paving3 + ) + override fun getTitle(tags: Map) = R.string.quest_tactilePaving_title_steps override fun createForm() = TactilePavingStepsForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingCrosswalkForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingCrosswalkForm.kt index a6e5eb81ba..70f1f87d1e 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingCrosswalkForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingCrosswalkForm.kt @@ -9,8 +9,6 @@ import de.westnordost.streetcomplete.quests.tactile_paving.TactilePavingCrosswal class TactilePavingCrosswalkForm : AbstractOsmQuestForm() { - override val contentLayoutResId = R.layout.quest_tactile_paving - override val otherAnswers get() = listOf( AnswerItem(R.string.quest_tactilePaving_incorrect) { applyAnswer(INCORRECT) } ) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingForm.kt index 27ea57d943..1efebff48b 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingForm.kt @@ -6,8 +6,6 @@ import de.westnordost.streetcomplete.quests.AnswerItem class TactilePavingForm : AbstractOsmQuestForm() { - override val contentLayoutResId = R.layout.quest_tactile_paving - override val buttonPanelAnswers = listOf( AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(false) }, AnswerItem(R.string.quest_generic_hasFeature_yes) { applyAnswer(true) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingStepsForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingStepsForm.kt index 78d5ea4c51..59a5d9dc65 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingStepsForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/tactile_paving/TactilePavingStepsForm.kt @@ -10,8 +10,6 @@ import de.westnordost.streetcomplete.quests.tactile_paving.TactilePavingStepsAns class TactilePavingStepsForm : AbstractOsmQuestForm() { - override val contentLayoutResId = R.layout.quest_tactile_paving - override val otherAnswers get() = listOf( AnswerItem(R.string.quest_tactilePaving_steps_bottom) { applyAnswer(BOTTOM) }, AnswerItem(R.string.quest_tactilePaving_steps_top) { applyAnswer(TOP) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSound.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSound.kt index 7b0d4f02f5..af737d6e46 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSound.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSound.kt @@ -10,6 +10,7 @@ import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement. import de.westnordost.streetcomplete.osm.Tags import de.westnordost.streetcomplete.osm.isCrossingWithTrafficSignals import de.westnordost.streetcomplete.osm.updateWithCheckDate +import de.westnordost.streetcomplete.quests.YesNoQuestForm import de.westnordost.streetcomplete.util.ktx.toYesNo class AddTrafficSignalsSound : OsmElementQuestType { @@ -37,6 +38,8 @@ class AddTrafficSignalsSound : OsmElementQuestType { override val icon = R.drawable.ic_quest_blind_traffic_lights_sound override val achievements = listOf(BLIND) + override val hint = R.string.quest_traffic_signals_sound_description + override fun getTitle(tags: Map) = R.string.quest_traffic_signals_sound_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = @@ -54,7 +57,7 @@ class AddTrafficSignalsSound : OsmElementQuestType { override fun isApplicableTo(element: Element): Boolean? = if (!crossingFilter.matches(element)) false else null - override fun createForm() = AddTrafficSignalsSoundForm() + override fun createForm() = YesNoQuestForm() override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags.updateWithCheckDate(SOUND_SIGNALS, answer.toYesNo()) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSoundForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSoundForm.kt deleted file mode 100644 index 289fa5acc5..0000000000 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_sound/AddTrafficSignalsSoundForm.kt +++ /dev/null @@ -1,15 +0,0 @@ -package de.westnordost.streetcomplete.quests.traffic_signals_sound - -import de.westnordost.streetcomplete.R -import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm -import de.westnordost.streetcomplete.quests.AnswerItem - -class AddTrafficSignalsSoundForm : AbstractOsmQuestForm() { - - override val contentLayoutResId = R.layout.quest_traffic_lights_sound - - override val buttonPanelAnswers = listOf( - AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(false) }, - AnswerItem(R.string.quest_generic_hasFeature_yes) { applyAnswer(true) } - ) -} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibration.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibration.kt index 63329b9581..8abc0b2386 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibration.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibration.kt @@ -41,6 +41,9 @@ class AddTrafficSignalsVibration : OsmElementQuestType { "RU" // see https://github.com/streetcomplete/StreetComplete/issues/4021 ) + override val hint = R.string.quest_traffic_signals_vibrate_description + override val hintImages = listOf(R.drawable.vibrating_button_illustration) + override fun getTitle(tags: Map) = R.string.quest_traffic_signals_vibrate_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibrationForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibrationForm.kt index 0dc1a8a10e..ecbc36cb0c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibrationForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/traffic_signals_vibrate/AddTrafficSignalsVibrationForm.kt @@ -2,20 +2,17 @@ package de.westnordost.streetcomplete.quests.traffic_signals_vibrate import android.os.Bundle import android.view.View -import android.widget.ImageView import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm import de.westnordost.streetcomplete.quests.AnswerItem class AddTrafficSignalsVibrationForm : AbstractOsmQuestForm() { - override val contentLayoutResId = R.layout.quest_traffic_lights_vibration - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - view.findViewById(R.id.buttonIllustrationImageView) - .setImageResource(getVibratingButtonIllustrationResId(countryInfo.countryCode)) + val illustrationResId = getVibratingButtonIllustrationResId(countryInfo.countryCode) + setHintImages(listOfNotNull(requireContext().getDrawable(illustrationResId))) } override val buttonPanelAnswers = listOf( diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusiness.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusiness.kt index 907b554e1a..d9c1eca325 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusiness.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusiness.kt @@ -114,12 +114,14 @@ class AddWheelchairAccessBusiness : OsmFilterQuestType() { override val achievements = listOf(WHEELCHAIR) override val defaultDisabledMessage = R.string.default_disabled_msg_go_inside + override val hint = R.string.quest_wheelchairAccess_limited_description_business + override fun getTitle(tags: Map) = R.string.quest_wheelchairAccess_outside_title override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) = getMapData().asSequence().filter { it.isPlaceOrDisusedShop() } - override fun createForm() = AddWheelchairAccessBusinessForm() + override fun createForm() = WheelchairAccessForm() override fun applyAnswerTo(answer: WheelchairAccess, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags["wheelchair"] = answer.osmValue diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusinessForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusinessForm.kt deleted file mode 100644 index 592d54bb14..0000000000 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessBusinessForm.kt +++ /dev/null @@ -1,7 +0,0 @@ -package de.westnordost.streetcomplete.quests.wheelchair_access - -import de.westnordost.streetcomplete.R - -class AddWheelchairAccessBusinessForm : WheelchairAccessForm() { - override val contentLayoutResId = R.layout.quest_wheelchair_business_explanation -} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutside.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutside.kt index a7cc144ff8..b80bffce8b 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutside.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutside.kt @@ -21,9 +21,11 @@ class AddWheelchairAccessOutside : OsmFilterQuestType() { override val icon = R.drawable.ic_quest_toilets_wheelchair override val achievements = listOf(RARE, WHEELCHAIR) + override val hint = R.string.quest_wheelchairAccess_limited_description_outside + override fun getTitle(tags: Map) = R.string.quest_wheelchairAccess_outside_title - override fun createForm() = AddWheelchairAccessOutsideForm() + override fun createForm() = WheelchairAccessForm() override fun applyAnswerTo(answer: WheelchairAccess, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags.updateWithCheckDate("wheelchair", answer.osmValue) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutsideForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutsideForm.kt deleted file mode 100644 index 914b976f5a..0000000000 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessOutsideForm.kt +++ /dev/null @@ -1,7 +0,0 @@ -package de.westnordost.streetcomplete.quests.wheelchair_access - -import de.westnordost.streetcomplete.R - -class AddWheelchairAccessOutsideForm : WheelchairAccessForm() { - override val contentLayoutResId = R.layout.quest_wheelchair_outside_explanation -} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransport.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransport.kt index 23c14f9819..92e4b66de2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransport.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransport.kt @@ -24,9 +24,11 @@ class AddWheelchairAccessPublicTransport : OsmFilterQuestType( override val icon = R.drawable.ic_quest_wheelchair override val achievements = listOf(WHEELCHAIR) + override val hint = R.string.quest_wheelchairAccess_limited_description_public_transport + override fun getTitle(tags: Map) = R.string.quest_wheelchairAccess_outside_title - override fun createForm() = AddWheelchairAccessPublicTransportForm() + override fun createForm() = WheelchairAccessForm() override fun applyAnswerTo(answer: WheelchairAccess, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags.updateWithCheckDate("wheelchair", answer.osmValue) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransportForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransportForm.kt deleted file mode 100644 index 7ba7a7586e..0000000000 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessPublicTransportForm.kt +++ /dev/null @@ -1,7 +0,0 @@ -package de.westnordost.streetcomplete.quests.wheelchair_access - -import de.westnordost.streetcomplete.R - -class AddWheelchairAccessPublicTransportForm : WheelchairAccessForm() { - override val contentLayoutResId = R.layout.quest_wheelchair_public_transport_explanation -} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToilets.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToilets.kt index 654747c6e7..3321809c72 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToilets.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToilets.kt @@ -24,9 +24,12 @@ class AddWheelchairAccessToilets : OsmFilterQuestType() { override val isDeleteElementEnabled = true override val achievements = listOf(WHEELCHAIR) + override val hint = R.string.quest_wheelchairAccess_description_toilets + override val hintImages = listOf(R.drawable.wheelchair_sign) + override fun getTitle(tags: Map) = R.string.quest_wheelchairAccess_outside_title - override fun createForm() = AddWheelchairAccessToiletsForm() + override fun createForm() = WheelchairAccessForm() override fun applyAnswerTo(answer: WheelchairAccess, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) { tags.updateWithCheckDate("wheelchair", answer.osmValue) diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsForm.kt deleted file mode 100644 index 28a7a8a855..0000000000 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsForm.kt +++ /dev/null @@ -1,7 +0,0 @@ -package de.westnordost.streetcomplete.quests.wheelchair_access - -import de.westnordost.streetcomplete.R - -class AddWheelchairAccessToiletsForm : WheelchairAccessForm() { - override val contentLayoutResId = R.layout.quest_wheelchair_toilets_explanation -} diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPart.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPart.kt index b0d5214284..4a2ca4cf4b 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPart.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPart.kt @@ -34,6 +34,9 @@ class AddWheelchairAccessToiletsPart : OsmFilterQuestType) = R.string.quest_wheelchairAccess_toiletsPart_title2 override fun createForm() = AddWheelchairAccessToiletsPartForm() diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartForm.kt index 128c74b697..88af170c76 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/wheelchair_access/AddWheelchairAccessToiletsPartForm.kt @@ -8,7 +8,6 @@ import de.westnordost.streetcomplete.quests.wheelchair_access.WheelchairAccess.N import de.westnordost.streetcomplete.quests.wheelchair_access.WheelchairAccess.YES class AddWheelchairAccessToiletsPartForm : AbstractOsmQuestForm() { - override val contentLayoutResId = R.layout.quest_wheelchair_toilets_explanation override val buttonPanelAnswers = listOf( AnswerItem(R.string.quest_generic_hasFeature_no) { applyAnswer(WheelchairAccessToiletsPart(NO)) }, diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/AbstractBottomSheetFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/AbstractBottomSheetFragment.kt index 4a5c64506a..2159ad716a 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/AbstractBottomSheetFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/AbstractBottomSheetFragment.kt @@ -45,17 +45,8 @@ abstract class AbstractBottomSheetFragment : Fragment(), IsCloseableBottomSheet /** View that floats at the bottom on top of any retracted/expanded bottom sheet */ protected abstract val floatingBottomView: View? - /** View that is only shown when the bottom sheet is expanded and acts like a back-button */ - protected abstract val backButton: View? private lateinit var bottomSheetBehavior: BottomSheetBehavior<*> - private val bottomSheetCallback = object : BottomSheetBehavior.BottomSheetCallback() { - override fun onStateChanged(bottomSheet: View, newState: Int) {} - - override fun onSlide(bottomSheet: View, slideOffset: Float) { - updateCloseButtonVisibility() - } - } private var minBottomInset = Int.MAX_VALUE @@ -65,16 +56,6 @@ abstract class AbstractBottomSheetFragment : Fragment(), IsCloseableBottomSheet override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - bottomSheet.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ -> - viewLifecycleScope.launch { - // not immediately because this is called during layout change (view.getTop() == 0) - delay(1) - updateCloseButtonVisibility() - } - } - - backButton?.setOnClickListener { activity?.onBackPressed() } - minBottomInset = Int.MAX_VALUE view.respectSystemInsets { scrollViewChild.updatePadding(bottom = it.bottom) @@ -109,8 +90,6 @@ abstract class AbstractBottomSheetFragment : Fragment(), IsCloseableBottomSheet } } - bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallback) - if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE || defaultExpanded) { expand() } @@ -136,19 +115,10 @@ abstract class AbstractBottomSheetFragment : Fragment(), IsCloseableBottomSheet bottomSheetContainer.updateLayoutParams { width = resources.getDimensionPixelSize(R.dimen.quest_form_width) } } - override fun onDestroyView() { - super.onDestroyView() - bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallback) - } - fun expand() { bottomSheetBehavior.state = STATE_EXPANDED } - private fun updateCloseButtonVisibility() { - backButton?.isGone = (bottomSheet.top) > 0 - } - @UiThread override fun onClickMapAt(position: LatLon, clickAreaSizeInMeters: Double): Boolean = false diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/CreateNoteFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/CreateNoteFragment.kt index 8d1118ef4d..21df2d1fff 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/CreateNoteFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/CreateNoteFragment.kt @@ -51,7 +51,6 @@ class CreateNoteFragment : AbstractCreateNoteFragment() { override val bottomSheetTitle get() = bottomSheetBinding.speechBubbleTitleContainer override val bottomSheetContent get() = bottomSheetBinding.speechbubbleContentContainer override val floatingBottomView get() = bottomSheetBinding.okButton - override val backButton get() = bottomSheetBinding.closeButton override val okButton get() = bottomSheetBinding.okButton override val okButtonContainer get() = bottomSheetBinding.okButtonContainer diff --git a/app/src/main/res/authors.txt b/app/src/main/res/authors.txt index 62147320b7..290da55d2c 100644 --- a/app/src/main/res/authors.txt +++ b/app/src/main/res/authors.txt @@ -285,9 +285,9 @@ surface_unpaved_horrible.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/ surface_unpaved_impassable.jpg Public Domain https://drive.google.com/file/d/1yZXynVd07IWQPKpBbrlbABzfKHkG9X7R/view?usp=sharing (Tobias Zwick) surface_unpaved_very_horrib... CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Very_horrible_ruts.jpg (Preslav) -tactile_paving_illustration... CC-BY 2.0 https://commons.wikimedia.org/wiki/File:Trajet_Ouigo,_train_low-cost_(SNCF,France)_(10072029534).jpg (jean-louis Zimmermann) - CC-BY 2.0 https://commons.wikimedia.org/wiki/File:Accessibilit%C3%A9_handicap%C3%A9s%2C_aire_autoroute_(Meyrargues%2CFR13)_(10493532264).jpg (jean-louis Zimmermann) - CC-BY 2.0 https://commons.wikimedia.org/wiki/File:Bande_podotactile_clout%C3%A9e%2C_rue_Saint_Florent_(ORANGE%2CFR84)_(10473021344).jpg (jean-louis Zimmermann) +tactile_paving1.jpg CC-0 1.0 https://commons.wikimedia.org/wiki/File:Tactile_paving_in_China_2.jpg +tactile_paving2.jpg CC-0 1.0 https://commons.wikimedia.org/wiki/File:Tactile_paving_in_a_Mass_Rapid_Transit_station_in_Singapore_-_20131105.jpg +tactile_paving3.jpg CC-BY 2.0 https://commons.wikimedia.org/wiki/File:Bande_podotactile_clout%C3%A9e%2C_rue_Saint_Florent_(ORANGE%2CFR84)_(10473021344).jpg traffic_calming_bump.jpg Public Domain Goldfinger https://commons.wikimedia.org/wiki/File%3ALe%C5%BEe%C4%87i%5Fpolicajac%5F016%2Ejpg traffic_calming_chicane.jpg CC-BY-SA 2.0 Richard Drdul https://commons.wikimedia.org/wiki/File:One-lane_chicane_1.jpg diff --git a/app/src/main/res/drawable-hdpi/tactile_paving1.jpg b/app/src/main/res/drawable-hdpi/tactile_paving1.jpg new file mode 100644 index 0000000000..5ad0c4be39 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/tactile_paving1.jpg differ diff --git a/app/src/main/res/drawable-hdpi/tactile_paving2.jpg b/app/src/main/res/drawable-hdpi/tactile_paving2.jpg new file mode 100644 index 0000000000..51645b40bf Binary files /dev/null and b/app/src/main/res/drawable-hdpi/tactile_paving2.jpg differ diff --git a/app/src/main/res/drawable-hdpi/tactile_paving3.jpg b/app/src/main/res/drawable-hdpi/tactile_paving3.jpg new file mode 100644 index 0000000000..bcb0c2e964 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/tactile_paving3.jpg differ diff --git a/app/src/main/res/drawable-hdpi/tactile_paving_illustration.jpg b/app/src/main/res/drawable-hdpi/tactile_paving_illustration.jpg deleted file mode 100644 index 8b5ef5a1f0..0000000000 Binary files a/app/src/main/res/drawable-hdpi/tactile_paving_illustration.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/tactile_paving1.jpg b/app/src/main/res/drawable-mdpi/tactile_paving1.jpg new file mode 100644 index 0000000000..96687b6516 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/tactile_paving1.jpg differ diff --git a/app/src/main/res/drawable-mdpi/tactile_paving2.jpg b/app/src/main/res/drawable-mdpi/tactile_paving2.jpg new file mode 100644 index 0000000000..e42643d3e3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/tactile_paving2.jpg differ diff --git a/app/src/main/res/drawable-mdpi/tactile_paving3.jpg b/app/src/main/res/drawable-mdpi/tactile_paving3.jpg new file mode 100644 index 0000000000..7e86ea519b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/tactile_paving3.jpg differ diff --git a/app/src/main/res/drawable-mdpi/tactile_paving_illustration.jpg b/app/src/main/res/drawable-mdpi/tactile_paving_illustration.jpg deleted file mode 100644 index 1b14094b89..0000000000 Binary files a/app/src/main/res/drawable-mdpi/tactile_paving_illustration.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/tactile_paving1.jpg b/app/src/main/res/drawable-xhdpi/tactile_paving1.jpg new file mode 100644 index 0000000000..a84b8a9068 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/tactile_paving1.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/tactile_paving2.jpg b/app/src/main/res/drawable-xhdpi/tactile_paving2.jpg new file mode 100644 index 0000000000..5178cd9b37 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/tactile_paving2.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/tactile_paving3.jpg b/app/src/main/res/drawable-xhdpi/tactile_paving3.jpg new file mode 100644 index 0000000000..c86327b4ae Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/tactile_paving3.jpg differ diff --git a/app/src/main/res/drawable-xhdpi/tactile_paving_illustration.jpg b/app/src/main/res/drawable-xhdpi/tactile_paving_illustration.jpg deleted file mode 100644 index 035dab8ca1..0000000000 Binary files a/app/src/main/res/drawable-xhdpi/tactile_paving_illustration.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/tactile_paving1.jpg b/app/src/main/res/drawable-xxhdpi/tactile_paving1.jpg new file mode 100644 index 0000000000..2d9b693bee Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/tactile_paving1.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/tactile_paving2.jpg b/app/src/main/res/drawable-xxhdpi/tactile_paving2.jpg new file mode 100644 index 0000000000..d96974ea40 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/tactile_paving2.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/tactile_paving3.jpg b/app/src/main/res/drawable-xxhdpi/tactile_paving3.jpg new file mode 100644 index 0000000000..59fd699bdf Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/tactile_paving3.jpg differ diff --git a/app/src/main/res/drawable-xxhdpi/tactile_paving_illustration.jpg b/app/src/main/res/drawable-xxhdpi/tactile_paving_illustration.jpg deleted file mode 100644 index 05865900e7..0000000000 Binary files a/app/src/main/res/drawable-xxhdpi/tactile_paving_illustration.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/ic_info_filled_24dp.xml b/app/src/main/res/drawable/ic_info_filled_24dp.xml new file mode 100644 index 0000000000..17255b7ae3 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_filled_24dp.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_info_outline_24dp.xml b/app/src/main/res/drawable/ic_info_outline_24dp.xml new file mode 100644 index 0000000000..ff356dcc90 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_outline_24dp.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/wheelchair_sign.xml b/app/src/main/res/drawable/wheelchair_sign.xml new file mode 100644 index 0000000000..3756c6b8bc --- /dev/null +++ b/app/src/main/res/drawable/wheelchair_sign.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/src/main/res/layout/cell_labeled_icon_select_right.xml b/app/src/main/res/layout/cell_labeled_icon_select_right.xml index e318708ebc..1fbc4c0d07 100644 --- a/app/src/main/res/layout/cell_labeled_icon_select_right.xml +++ b/app/src/main/res/layout/cell_labeled_icon_select_right.xml @@ -4,7 +4,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - tools:layout_width="180dp" android:padding="6dp" android:background="@drawable/image_select_cell_rounded"> diff --git a/app/src/main/res/layout/fragment_quest_answer.xml b/app/src/main/res/layout/fragment_quest_answer.xml index 20b0cf0e65..c123b4594a 100644 --- a/app/src/main/res/layout/fragment_quest_answer.xml +++ b/app/src/main/res/layout/fragment_quest_answer.xml @@ -31,51 +31,92 @@ + android:orientation="horizontal" + android:gravity="center_vertical" + android:layoutDirection="locale"> - + android:layout_weight="1" + android:orientation="vertical"> - + + + + + + + app:srcCompat = "@drawable/ic_info_outline_24dp" + android:background="?android:attr/selectableItemBackgroundBorderless" + app:tint="@color/activated_tint" + android:visibility="visible" + android:contentDescription="@string/info" + android:padding="12dp"/> - + android:showDividers="middle" + android:divider="@drawable/space_8dp"> + + + + + + + + + + diff --git a/app/src/main/res/layout/quest_bike_parking_capacity.xml b/app/src/main/res/layout/quest_bike_parking_capacity.xml index d4b429807d..2ed5e2d03e 100644 --- a/app/src/main/res/layout/quest_bike_parking_capacity.xml +++ b/app/src/main/res/layout/quest_bike_parking_capacity.xml @@ -1,51 +1,39 @@ - + android:gravity="bottom"> - + android:layout_width="wrap_content" + android:textSize="@dimen/x_large_input" + android:layout_centerVertical="true" + android:layout_toStartOf="@+id/capacityMultiplierLabel" + android:minEms="1" + android:id="@+id/capacityInput" + android:inputType="number" + android:maxLines="1" + /> - - - + android:textSize="@dimen/x_large_input" + android:layout_centerInParent="true" + android:padding="6dp" + android:text=" × " + tools:ignore="HardcodedText"/> - - - + - - + diff --git a/app/src/main/res/layout/quest_determine_recycling_glass_explanation.xml b/app/src/main/res/layout/quest_determine_recycling_glass_explanation.xml deleted file mode 100644 index 6c028e68eb..0000000000 --- a/app/src/main/res/layout/quest_determine_recycling_glass_explanation.xml +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/app/src/main/res/layout/quest_diet_type_explanation.xml b/app/src/main/res/layout/quest_diet_type_explanation.xml index 7112a339a9..52f1cbb015 100644 --- a/app/src/main/res/layout/quest_diet_type_explanation.xml +++ b/app/src/main/res/layout/quest_diet_type_explanation.xml @@ -1,21 +1,7 @@ - - - - - - - + diff --git a/app/src/main/res/layout/quest_maxheight.xml b/app/src/main/res/layout/quest_maxheight.xml index 1db9c01726..be5e6f6fd3 100644 --- a/app/src/main/res/layout/quest_maxheight.xml +++ b/app/src/main/res/layout/quest_maxheight.xml @@ -6,21 +6,12 @@ android:layout_height="wrap_content" xmlns:tools="http://schemas.android.com/tools"> - - diff --git a/app/src/main/res/layout/quest_maxheight_fi.xml b/app/src/main/res/layout/quest_maxheight_fi.xml index bfdca60875..4ac725f8d0 100644 --- a/app/src/main/res/layout/quest_maxheight_fi.xml +++ b/app/src/main/res/layout/quest_maxheight_fi.xml @@ -6,21 +6,12 @@ android:layout_height="wrap_content" xmlns:tools="http://schemas.android.com/tools"> - - diff --git a/app/src/main/res/layout/quest_maxheight_mutcd.xml b/app/src/main/res/layout/quest_maxheight_mutcd.xml index 4f1b6928ce..8dd90d66d7 100644 --- a/app/src/main/res/layout/quest_maxheight_mutcd.xml +++ b/app/src/main/res/layout/quest_maxheight_mutcd.xml @@ -5,20 +5,11 @@ android:layout_height="wrap_content" xmlns:tools="http://schemas.android.com/tools"> - - diff --git a/app/src/main/res/layout/quest_prohibited_for_pedestrians_separate_sidewalk_explanation.xml b/app/src/main/res/layout/quest_prohibited_for_pedestrians_separate_sidewalk_explanation.xml deleted file mode 100644 index 4782095d7f..0000000000 --- a/app/src/main/res/layout/quest_prohibited_for_pedestrians_separate_sidewalk_explanation.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/app/src/main/res/layout/quest_sanitary_dump_station.xml b/app/src/main/res/layout/quest_sanitary_dump_station.xml deleted file mode 100644 index eed37beff0..0000000000 --- a/app/src/main/res/layout/quest_sanitary_dump_station.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/quest_step_count.xml b/app/src/main/res/layout/quest_step_count.xml index 2d242ba016..80cbf11ccb 100644 --- a/app/src/main/res/layout/quest_step_count.xml +++ b/app/src/main/res/layout/quest_step_count.xml @@ -1,51 +1,38 @@ - + android:gravity="bottom"> - + android:layout_width="wrap_content" + android:textSize="@dimen/x_large_input" + android:layout_centerVertical="true" + android:layout_toStartOf="@+id/countMultiplierLabel" + android:minEms="1" + android:id="@+id/countInput" + android:inputType="number" + android:maxLines="1" + /> - - - + android:textSize="@dimen/x_large_input" + android:layout_centerInParent="true" + android:padding="6dp" + android:text=" × " + tools:ignore="HardcodedText"/> - - - - - + + diff --git a/app/src/main/res/layout/quest_street_lanes_puzzle.xml b/app/src/main/res/layout/quest_street_lanes_puzzle.xml index 9ce2275a03..556e1588f9 100644 --- a/app/src/main/res/layout/quest_street_lanes_puzzle.xml +++ b/app/src/main/res/layout/quest_street_lanes_puzzle.xml @@ -1,43 +1,24 @@ - + android:layout_height="wrap_content"> - - + android:layout_height="@dimen/street_side_puzzle_height"> - + android:layout_height="match_parent" /> - + - - - - - - + + + diff --git a/app/src/main/res/layout/quest_street_side_puzzle_with_last_answer_button.xml b/app/src/main/res/layout/quest_street_side_puzzle_with_last_answer_button.xml index 45bd437683..15b5060bbf 100644 --- a/app/src/main/res/layout/quest_street_side_puzzle_with_last_answer_button.xml +++ b/app/src/main/res/layout/quest_street_side_puzzle_with_last_answer_button.xml @@ -1,42 +1,23 @@ - + android:layout_height="wrap_content"> - - - - - + android:layout_height="@dimen/street_side_puzzle_height" + android:clipChildren="false" + android:clipToPadding="false" /> - - + + - + - - + diff --git a/app/src/main/res/layout/quest_tactile_paving.xml b/app/src/main/res/layout/quest_tactile_paving.xml deleted file mode 100644 index 363ddb2788..0000000000 --- a/app/src/main/res/layout/quest_tactile_paving.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout/quest_traffic_lights_sound.xml b/app/src/main/res/layout/quest_traffic_lights_sound.xml deleted file mode 100644 index 8b6cda87a1..0000000000 --- a/app/src/main/res/layout/quest_traffic_lights_sound.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/app/src/main/res/layout/quest_traffic_lights_vibration.xml b/app/src/main/res/layout/quest_traffic_lights_vibration.xml deleted file mode 100644 index 1266732fbd..0000000000 --- a/app/src/main/res/layout/quest_traffic_lights_vibration.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/app/src/main/res/layout/quest_wheelchair_business_explanation.xml b/app/src/main/res/layout/quest_wheelchair_business_explanation.xml deleted file mode 100644 index 64f64ebca8..0000000000 --- a/app/src/main/res/layout/quest_wheelchair_business_explanation.xml +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/app/src/main/res/layout/quest_wheelchair_outside_explanation.xml b/app/src/main/res/layout/quest_wheelchair_outside_explanation.xml deleted file mode 100644 index e6eb592bf8..0000000000 --- a/app/src/main/res/layout/quest_wheelchair_outside_explanation.xml +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/app/src/main/res/layout/quest_wheelchair_public_transport_explanation.xml b/app/src/main/res/layout/quest_wheelchair_public_transport_explanation.xml deleted file mode 100644 index 1ce222857f..0000000000 --- a/app/src/main/res/layout/quest_wheelchair_public_transport_explanation.xml +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/app/src/main/res/layout/quest_wheelchair_toilets_explanation.xml b/app/src/main/res/layout/quest_wheelchair_toilets_explanation.xml deleted file mode 100644 index 3ec7ee9970..0000000000 --- a/app/src/main/res/layout/quest_wheelchair_toilets_explanation.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3e3fb75fd2..cace3dfcfe 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -58,7 +58,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the Create new note Zoom in further to create a note - You can leave a note to let other mappers know about an issue here. Adjust the note’s position by moving the map: + You can leave a note to let other mappers know about an issue here. Adjust the note’s position by moving the map. Ideally, write the note in the local language, or otherwise in English. Create new track recording @@ -101,7 +101,10 @@ The info you enter is directly added to OpenStreetMap in your name, without the Are you sure that you can not determine it more specifically? - The road in the illustration is rotated the same as its center on the map. + The road in the illustration is rotated the same as on the map at its center pin location. Try rotating the map and you’ll get it. + + The arrows in the illustration point towards the directions in which the way runs on the map at its center pin location. Try rotating the map and you’ll get it. + This quest type is disabled by default because you will likely have to enter the place to be able to answer a quest of this type. This quest type is disabled by default because it is not useful in some regions and you will likely have to enter the place to be able to answer a quest of this type. @@ -126,7 +129,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the "You did not give an answer" - "close" + "More information" "Discard input?" "Discard" No @@ -639,8 +642,10 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we It’s an Assembly Point An Assembly Point is where people assemble in case of an emergency. It usually looks similar to this: - Are pedestrians forbidden to walk on this road here? - This street was tagged as having no sidewalk on either side. If there is a sidewalk but it is displayed as a separate way, please answer “sidewalk”. + Are pedestrians forbidden to walk on this road without sidewalk here? + It is forbidden. + it is allowed. + Actually, there is a sidewalk, but it is displayed separately on the map. "What’s the house number of this building?" House number: @@ -762,7 +767,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we No bicycles sold at all "How many bicycles can be parked here?" - "Note that many stands can be used to park one bicycle on each side." + "Note that you can usually park one bicycle on each side of a stand." Is there a public bicycle pump here (at least when it’s open)? Is there a working bicycle pump here? @@ -809,6 +814,10 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we regular levels (not counting the roof) Differs per building part In this case, simply input the values of the highest building part. + "For buildings on a slope, the level count starts from the ground level of the lowest side. + +A level counts as a roof level when its windows are in the roof. Subsequently, roofs with zero roof levels are not necessarily flat, just not tall enough for an entire level. + " "What kind of building is this?" Please select a more specific value. @@ -941,7 +950,7 @@ Before uploading your changes, the app checks with a <a href=\"https://www.we Only tents Backcountry camping (no facilities) Is there a sanitary dump station? - Facility for depositing human waste from a toilet holding tank of a motorhome, long haul truck, etc. Usually indicated by a sign like this: + A sanitary dump station is a facility for depositing human waste from a toilet holding tank of a motorhome, long haul truck, etc. Usually indicated by a sign like this: What kind of car wash is this? Automated @@ -1549,7 +1558,7 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards (unspecified) international - "What surface does this piece of road have?" + "What surface does this road have?" "What surface does this square have?" Is there a summit cross here? diff --git a/res/graphics/tactile paving/tactile_paving1.jpg b/res/graphics/tactile paving/tactile_paving1.jpg new file mode 100644 index 0000000000..d4842721b5 Binary files /dev/null and b/res/graphics/tactile paving/tactile_paving1.jpg differ diff --git a/res/graphics/tactile paving/tactile_paving2.jpg b/res/graphics/tactile paving/tactile_paving2.jpg new file mode 100644 index 0000000000..3e7a7e25a4 Binary files /dev/null and b/res/graphics/tactile paving/tactile_paving2.jpg differ diff --git a/res/graphics/tactile paving/tactile_paving3.jpg b/res/graphics/tactile paving/tactile_paving3.jpg new file mode 100644 index 0000000000..fbf05b31ab Binary files /dev/null and b/res/graphics/tactile paving/tactile_paving3.jpg differ diff --git a/res/graphics/wheelchair/sign.svg b/res/graphics/wheelchair/sign.svg new file mode 100644 index 0000000000..98f868d9ab --- /dev/null +++ b/res/graphics/wheelchair/sign.svg @@ -0,0 +1,8 @@ + + + + + + + +