Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smoothness quest #3257

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
dd1c4a0
add first version of smoothness quest
Helium314 Sep 4, 2021
7586221
update surface quest
Helium314 Sep 6, 2021
abe0146
fix wrong surface form and add smoothness.kt
Helium314 Sep 7, 2021
f65259f
add images
Helium314 Sep 7, 2021
fce2eb9
update strings and adjust layouts a bit
Helium314 Sep 10, 2021
2372f92
remove some unused things, update forms
Helium314 Sep 11, 2021
190ccd4
let the app crash on unknown surface where the quest can't be asked
Helium314 Sep 12, 2021
fec7dfb
small changes as suggested by @westnordost
Helium314 Sep 12, 2021
e7ee462
move some code to newly added SmoothnessItem
Helium314 Sep 12, 2021
675fa23
split smoothness quest into path and road quests
Helium314 Sep 12, 2021
7a71040
add achievements
Helium314 Sep 12, 2021
8d65c2c
fix typo
Helium314 Sep 13, 2021
7ceee01
fix typo, part2
Helium314 Sep 13, 2021
281ad0d
surface quest: remove smoothness if surface value changed on resurvey
Helium314 Sep 13, 2021
2a7ab9b
Merge branch 'smoothness' of https://github.com/Helium314/StreetCompl…
Helium314 Sep 13, 2021
d4c7c40
update images (and strings a little bit)
Helium314 Sep 13, 2021
c47ccd1
update photos and strings
Helium314 Sep 14, 2021
d434da9
remove path tags from road element filter
Helium314 Sep 15, 2021
cec1bf7
update images and strings
Helium314 Sep 16, 2021
766c8ac
Merge branch 'smoothness' of https://github.com/Helium314/StreetCompl…
Helium314 Sep 16, 2021
0bad5ea
update strings and authors
Helium314 Sep 19, 2021
93dc875
update images
Helium314 Sep 22, 2021
e5af15d
update descriptions
Helium314 Oct 2, 2021
594c644
update strings
Helium314 Oct 9, 2021
656aa32
try adding surface to question (not working properly)
Helium314 Oct 9, 2021
469fdd4
Merge branch 'master' into smoothness
westnordost Dec 16, 2021
e65e4ba
remove strings added by botched merge
westnordost Dec 18, 2021
f4e1bc3
Merge branch 'master' into smoothness
westnordost Dec 21, 2021
a8529a0
fix another merge issue
westnordost Dec 21, 2021
8d63996
formatting + only show smoothness quest for the same roads the surfac…
westnordost Dec 21, 2021
2ef1825
use computed properties instead of functions where possible
westnordost Dec 21, 2021
44e0102
(provisionally) change title wording so that it does not contradict t…
westnordost Dec 21, 2021
de00a4f
remove unfinished feature that doesn't work
westnordost Dec 21, 2021
2f09e33
add vehicle-type emojis
westnordost Dec 21, 2021
9dc3d80
fix another problem after merge
westnordost Dec 21, 2021
92fe735
refine wordings
westnordost Dec 22, 2021
640367a
select new image for bad asphalt, 3:2 for intermediate and bad asphalt
westnordost Dec 22, 2021
c368c72
better picture for excellent paving stones
westnordost Dec 23, 2021
4f98420
further refine wording for sett after conferring in #language channel…
westnordost Dec 23, 2021
66aff91
intermediate paving stones 3:2
westnordost Dec 23, 2021
6c05903
add hint that it is about the big picture, not some details
westnordost Dec 29, 2021
f078974
refine descriptions a bit more (include mention of "rough asphalt")
westnordost Dec 29, 2021
58815c3
very bad sett 3:2
westnordost Dec 29, 2021
012bd4d
replace image for intermediate sett
westnordost Dec 29, 2021
9bd7e8a
replace image for good sett
westnordost Dec 29, 2021
6b52ad9
replace image for bad sett
westnordost Dec 29, 2021
f802eef
bad sett 3:2
westnordost Dec 30, 2021
39ca513
larger cutout of original photo for context
westnordost Dec 30, 2021
4e8f759
better image for very bad asphalt
westnordost Dec 30, 2021
6ab0c7b
add picture for very bad paving stones
westnordost Dec 30, 2021
36e6445
excellent asphalt 3:2
westnordost Dec 30, 2021
191163a
good asphalt 3:2
westnordost Dec 30, 2021
83feb06
compacted 3:2
westnordost Jan 1, 2022
b92754e
paving stones intermediate 3:2
westnordost Jan 1, 2022
4cc7ab2
intermediate compacted 3:2
westnordost Jan 1, 2022
3aea27f
very bad compacted 3:2
westnordost Jan 1, 2022
0a67489
intermediate and bad gravel 3:2
westnordost Jan 1, 2022
22344e6
add changelog entry to credit the main contributors
westnordost Jan 1, 2022
472a899
replace very bad gravel photo
westnordost Jan 1, 2022
2438369
use same picture for horrible gravel and horrible compacted
westnordost Jan 1, 2022
bbf8303
very horrible unpaved 3:2
westnordost Jan 1, 2022
588d652
also remove smoothness if surface is wrong
westnordost Jan 1, 2022
b3f14d0
descriptions for compacted etc
westnordost Jan 2, 2022
13cef40
3:2 impassable with less weird image
westnordost Jan 2, 2022
73cb663
update licenses
westnordost Jan 3, 2022
7437c79
Merge branch 'master' into smoothness
westnordost Jan 3, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import de.westnordost.streetcomplete.quests.self_service.AddSelfServiceLaundry
import de.westnordost.streetcomplete.quests.shop_type.CheckShopType
import de.westnordost.streetcomplete.quests.shop_type.SpecifyShopType
import de.westnordost.streetcomplete.quests.sidewalk.AddSidewalk
import de.westnordost.streetcomplete.quests.smoothness.AddSmoothness
import de.westnordost.streetcomplete.quests.sport.AddSport
import de.westnordost.streetcomplete.quests.steps_incline.AddStepsIncline
import de.westnordost.streetcomplete.quests.steps_ramp.AddStepsRamp
Expand Down Expand Up @@ -341,6 +342,7 @@ import javax.inject.Singleton
AddTracktype(), // widely used in map rendering - OSM Carto, OsmAnd...
AddCycleway(countryInfos), // for any cyclist routers (and cyclist maps)
AddLanes(), // abstreet, certainly most routing engines - often requires way to be split
AddSmoothness(),

// footways
AddPathSurface(), // used by OSM Carto, BRouter, OsmAnd, OSRM, graphhopper...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package de.westnordost.streetcomplete.quests.smoothness

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.meta.ALL_ROADS
import de.westnordost.streetcomplete.data.meta.ANYTHING_PAVED
import de.westnordost.streetcomplete.data.meta.updateWithCheckDate
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder
import de.westnordost.streetcomplete.quests.surface.Surface

class AddSmoothness : OsmFilterQuestType<SmoothnessAnswer>() {

// maybe exclude service roads? or driveways?
override val elementFilter = """
ways with highway
and highway ~ ${(ALL_PATHS_EXCEPT_STEPS + ALL_ROADS).joinToString("|")}
and surface ~ ${SURFACES_FOR_SMOOTHNESS.joinToString("|")}
and access !~ private|no
and (!conveying or conveying = no)
and (!indoor or indoor = no)
and !cycleway:surface and !footway:surface
and (
!smoothness
or smoothness older today -4 years
)
"""
/* resurvey:
* what it more/less likely to change?
* paved and good/intermediate might stay that way for a long time
* excellent might soon change to good
* bad roads might get repaired
* unpaved roads are likely to change anyway
* metal should stay the way it is for a long time
* */
westnordost marked this conversation as resolved.
Show resolved Hide resolved

override val commitMessage = "Add smoothness"
override val wikiLink = "Key:smoothness"
override val icon = R.drawable.ic_quest_street_surface_detail
override val isSplitWayEnabled = true

override fun getTitle(tags: Map<String, String>): Int {
val hasName = tags.containsKey("name")
val isSquare = tags["area"] == "yes"
val isPath = tags["highway"] in ALL_PATHS_EXCEPT_STEPS
return when {
hasName -> R.string.quest_smoothness_name_title
isSquare -> R.string.quest_smoothness_square_title
isPath -> R.string.quest_smoothness_path_title
else -> R.string.quest_smoothness_road_title
}
}

override fun createForm() = AddSmoothnessForm()

override fun applyAnswerTo(answer: SmoothnessAnswer, changes: StringMapChangesBuilder) {
when (answer) {
is SmoothnessValueAnswer -> changes.updateWithCheckDate("smoothness", answer.osmValue)
is WrongSurfaceAnswer -> changes.delete("surface")
}
}
}

// smoothness is not asked for steps
// "pedestrian" is in here so the path answers are shown instead of road answers (which focus on cars)
val ALL_PATHS_EXCEPT_STEPS = listOf("footway", "cycleway", "path", "bridleway", "pedestrian")

// surfaces that are actually used in AddSmoothnessForm
// should only contain values that are in the Surface class
private val SURFACES_FOR_SMOOTHNESS = listOf(
"asphalt", "sett", "paving_stones", "compacted", "gravel"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
package de.westnordost.streetcomplete.quests.smoothness

import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AlertDialog
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AImageListQuestAnswerFragment
import de.westnordost.streetcomplete.quests.OtherAnswer
import de.westnordost.streetcomplete.quests.surface.Surface
import de.westnordost.streetcomplete.quests.surface.asItem
import de.westnordost.streetcomplete.view.image_select.Item
import de.westnordost.streetcomplete.view.image_select.ItemViewHolder

class AddSmoothnessForm : AImageListQuestAnswerFragment<Smoothness, SmoothnessAnswer>() {

override val otherAnswers = listOf(
OtherAnswer(R.string.quest_smoothness_wrong_surface) { surfaceWrong() },
OtherAnswer(R.string.quest_smoothness_obstacle) { showObstacleHint() }
)

private val surfaceTag get() = osmElement!!.tags["surface"]

private val highwayTag get() = osmElement!!.tags["highway"]

// show only answers that make sense for the tagged surface
// numbers 0-7 are excellent - impassible, ordered like Smoothness class
// TODO: leave unused surfaces in here for future extension of the quest? or remove?
override val items get() = when {
// paving stones on roads will not be "excellent" as they get easily damaged by cars
surfaceTag == "paving_stones" && !ALL_PATHS_EXCEPT_STEPS.contains(highwayTag) -> getAnswers(1,4)
listOf("asphalt", "paving_stones", "concrete", "metal").contains(surfaceTag) -> getAnswers(0,4)
listOf("sett", "unhewn_cobblestone", "compacted", "grass_paver").contains(surfaceTag) -> getAnswers(2,6)
listOf("gravel", "fine_gravel", "pebbles").contains(surfaceTag) -> getAnswers(3,6)
listOf("dirt", "grass").contains(surfaceTag) -> getAnswers(3,7)
else -> getAnswers(0,7)
}

override val itemsPerRow = 1

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
imageSelector.cellLayoutId = R.layout.cell_labeled_icon_select_smoothness
}

override val moveFavoritesToFront = false

override fun onClickOk(selectedItems: List<Smoothness>) {
applyAnswer(SmoothnessValueAnswer(selectedItems.single().osmValue))
}

private fun showObstacleHint() {
activity?.let { AlertDialog.Builder(it)
.setMessage(R.string.quest_smoothness_obstacle_hint)
.setPositiveButton(android.R.string.ok, null)
.show()
}
}

// this requires Smoothness class to be sorted from best to worst!
private fun getAnswers(minSmoothness: Int, maxSmoothness: Int): List<Item<Smoothness>> {
val answers = mutableListOf<Item<Smoothness>>()
for (smoothness in Smoothness.values().sliceArray(minSmoothness..maxSmoothness))
answers.add(Item(smoothness, getImage(smoothness), smoothness.title, getDescription(smoothness)))
return answers
}

private fun getDescription(smoothness: Smoothness) = when (smoothness) {
Helium314 marked this conversation as resolved.
Show resolved Hide resolved
Smoothness.EXCELLENT -> when (surfaceTag) {
"paving_stones" -> R.string.quest_smoothness_description_excellent_paving_stones
else -> R.string.quest_smoothness_description_excellent
}
Smoothness.GOOD -> when (surfaceTag) {
"paving_stones" -> R.string.quest_smoothness_description_good_paving_stones
else -> R.string.quest_smoothness_description_good
}
Smoothness.INTERMEDIATE -> when (surfaceTag) {
"paving_stones", "sett" -> R.string.quest_smoothness_description_intermediate_paving_stones
"compacted" -> R.string.quest_smoothness_description_intermediate_compacted
else -> when (highwayTag) {
in ALL_PATHS_EXCEPT_STEPS -> R.string.quest_smoothness_description_intermediate_path
else -> R.string.quest_smoothness_description_intermediate
}
}
Smoothness.BAD -> when (surfaceTag) {
"sett" -> R.string.quest_smoothness_description_bad_sett
"paving_stones" -> R.string.quest_smoothness_description_bad_paving_stones
else -> when (highwayTag) {
in ALL_PATHS_EXCEPT_STEPS -> R.string.quest_smoothness_description_bad_path
else -> R.string.quest_smoothness_description_bad_road
}
}
Smoothness.VERY_BAD -> when (highwayTag) {
in ALL_PATHS_EXCEPT_STEPS -> R.string.quest_smoothness_description_very_bad_path
else -> R.string.quest_smoothness_description_very_bad_road
}
Smoothness.HORRIBLE -> when (highwayTag) {
in ALL_PATHS_EXCEPT_STEPS -> R.string.quest_smoothness_description_horrible
else -> R.string.quest_smoothness_description_horrible
}
Smoothness.VERY_HORRIBLE -> when (highwayTag) {
in ALL_PATHS_EXCEPT_STEPS -> R.string.quest_smoothness_description_very_horrible
else -> R.string.quest_smoothness_description_very_horrible
}
Smoothness.IMPASSABLE -> when (highwayTag) {
in ALL_PATHS_EXCEPT_STEPS -> R.string.quest_smoothness_description_impassable
else -> R.string.quest_smoothness_description_impassable
}
}

private fun getImage(smoothness: Smoothness) = when (smoothness) {
Helium314 marked this conversation as resolved.
Show resolved Hide resolved
Smoothness.EXCELLENT -> when (surfaceTag) {
"paving_stones" -> R.drawable.surface_paving_stones_excellent
else -> R.drawable.surface_asphalt_excellent
}
Smoothness.GOOD -> when (surfaceTag) {
"paving_stones" -> R.drawable.surface_paving_stones_good
else -> R.drawable.surface_asphalt_good
}
Smoothness.INTERMEDIATE -> when (surfaceTag) {
"paving_stones" -> R.drawable.surface_paving_stones_intermediate
"sett" -> R.drawable.surface_sett_intermediate
"compacted" -> R.drawable.surface_compacted_intermediate
else -> R.drawable.surface_asphalt_intermediate
}
Smoothness.BAD -> when (surfaceTag) {
"paving_stones" -> R.drawable.surface_paving_stones_bad
"sett" -> R.drawable.surface_sett_bad
"gravel" -> R.drawable.surface_gravel_bad
"compacted" -> R.drawable.surface_compacted_bad
else -> R.drawable.surface_asphalt_bad
}
Smoothness.VERY_BAD -> when (surfaceTag) {
"paving_stones" -> R.drawable.surface_paving_stones_very_bad
"sett" -> R.drawable.surface_sett_very_bad
else -> R.drawable.surface_asphalt_very_bad
}
// TODO: need images for the values below (and replace the ones above)
Smoothness.HORRIBLE -> R.drawable.surface_paved_area
Smoothness.VERY_HORRIBLE -> R.drawable.surface_paved_area
Smoothness.IMPASSABLE -> R.drawable.surface_paved_area
}

private fun surfaceWrong() {
val surfaceType = Surface.values().find { it.osmValue == surfaceTag }

if (surfaceType != null) {
showWrongSurfaceDialog(surfaceType)
} else {
// this should not happen: smoothness quest is not asked for unknown surfaces
composeNote()
}
Helium314 marked this conversation as resolved.
Show resolved Hide resolved
}

private fun showWrongSurfaceDialog(surface: Surface) {
val inflater = LayoutInflater.from(requireContext())
val inner = inflater.inflate(R.layout.dialog_quest_smoothness_wrong_surface, null, false)
ItemViewHolder(inner.findViewById(R.id.item_view)).bind(surface.asItem())

AlertDialog.Builder(requireContext())
.setView(inner)
.setPositiveButton(R.string.quest_generic_hasFeature_yes) { _, _ -> composeNote() } // TODO: maybe do something else?
Helium314 marked this conversation as resolved.
Show resolved Hide resolved
.setNegativeButton(R.string.quest_generic_hasFeature_no) { _, _ -> applyAnswer(WrongSurfaceAnswer) }
.show()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.westnordost.streetcomplete.quests.smoothness

import de.westnordost.streetcomplete.R

enum class Smoothness(val osmValue: String, val title: Int) {
EXCELLENT("excellent", R.string.quest_smoothness_title_excellent),
GOOD("good", R.string.quest_smoothness_title_good),
INTERMEDIATE("intermediate", R.string.quest_smoothness_title_intermediate),
BAD("bad", R.string.quest_smoothness_title_bad),
VERY_BAD("very_bad", R.string.quest_smoothness_title_very_bad),
HORRIBLE("horrible", R.string.quest_smoothness_title_horrible),
VERY_HORRIBLE("very_horrible", R.string.quest_smoothness_title_very_horrible),
IMPASSABLE("impassable", R.string.quest_smoothness_title_impassable),
}
Helium314 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.westnordost.streetcomplete.quests.smoothness

sealed class SmoothnessAnswer

data class SmoothnessValueAnswer(val osmValue: String): SmoothnessAnswer()

object WrongSurfaceAnswer: SmoothnessAnswer()
14 changes: 14 additions & 0 deletions app/src/main/res/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ surface_sett.jpg CC-BY-SA 3.0 https://commons.wikimedia.org/w
surface_unpaved.jpg CC-BY 2.0 https://www.flickr.com/photos/ian_munroe/3633361321
surface_wood.jpg CC-BY-SA 4.0 https://commons.wikimedia.org/wiki/File:Wooden_Bridge_In_Midst_of_Kaziranga_Wild_life_Sanctuary.jpg (Pavan Goswami)
surface_woodchips.jpg CC-BY-SA 3.0 https://commons.wikimedia.org/wiki/File:Woodchips_surface.jpg (10992-osm)
surface_asphalt_excellent.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Asphalt_-_excellent.jpg (Supaplex030)
surface_asphalt_good.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Asphalt_-_good.jpg (Supaplex030)
surface_asphalt_intermediate.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Asphalt_-_intermediate.jpg (Supaplex030)
surface_asphalt_bad.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Asphalt_-_bad.jpg (Supaplex030)
surface_asphalt_very_bad.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Asphalt_-_very_bad.jpg (Supaplex030)
surface_sett_good.jpg public domain https://wiki.openstreetmap.org/wiki/File:Flattened_sett.jpg (Westnordost)
surface_sett_bad.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Sett_-_bad.jpg (Supaplex030)
surface_sett_very_bad.jpg public domain https://wiki.openstreetmap.org/wiki/File:Very_bad_sett.jpg (Westnordost)
surface_paving_stones_good.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Paving_stones_-_good.jpg (Supaplex030)
surface_paving_stones_bad.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Paving_stones_-_bad.jpg (Supaplex030)
surface_compacted_intermediate.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Compacted_-_intermediate.jpg (Supaplex030)
surface_compacted_bad.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Compacted_-_bad.jpg (Supaplex030)
surface_gravel_bad.jpg CC-BY-SA 4.0 https://wiki.openstreetmap.org/wiki/File:Gravel_-_bad.jpg (Supaplex030)
surface_paving_stones_excellent.jpg CC0 https://wiki.openstreetmap.org/wiki/File:Pretty_natural_stone_used_for_paving.jpg (Mateusz Konieczny)
Helium314 marked this conversation as resolved.
Show resolved Hide resolved

tactile_paving_illustration... CC-BY 2.0 https://www.flickr.com/photos/jeanlouis_zimmermann/10072029534/in/album-72157635218804514/
CC-BY 2.0 https://www.flickr.com/photos/jeanlouis_zimmermann/10493532264/in/album-72157635218804514/
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions app/src/main/res/layout/cell_labeled_icon_select_smoothness.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:padding="6dp"
android:background="@drawable/image_select_cell_rounded">

<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="0.6"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
tools:src="@drawable/surface_asphalt_bad_400"
/>

<LinearLayout
android:layout_width="0dp"
android:layout_weight="0.4"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/ImageSelectTitle"
tools:text="@string/quest_smoothness_title_excellent" />

<TextView
android:id="@+id/descriptionView"
style="@style/ImageSelectDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="@string/quest_smoothness_description_excellent" />

</LinearLayout>

</LinearLayout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/cell_labeled_image_select.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:scaleType="fitCenter"
tools:src="@drawable/surface_asphalt"
Expand All @@ -33,7 +33,7 @@
android:layout_height="wrap_content"
android:layout_alignStart="@+id/imageView"
android:layout_alignEnd="@+id/imageView"
android:layout_alignParentBottom="true"
android:layout_alignBottom="@+id/imageView"
westnordost marked this conversation as resolved.
Show resolved Hide resolved
android:layout_centerHorizontal="true"
style="@style/ImageSelectLabel"
tools:text="@string/quest_surface_value_asphalt"
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/res/layout/dialog_quest_smoothness_wrong_surface.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/dialog_horizontal_margin">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/quest_smoothness_surface_value"
android:textAppearance="@android:style/TextAppearance.Theme.Dialog"/>

<include
android:id="@+id/item_view"
layout="@layout/cell_labeled_image_select"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/quest_address_answer_no_housenumber_message2b"
android:textAppearance="@android:style/TextAppearance.Theme.Dialog"/>

</LinearLayout>
Loading