-
-
Notifications
You must be signed in to change notification settings - Fork 366
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 Bus Stop Name Suggestions, generalize Name Suggestions #6097
Add Bus Stop Name Suggestions, generalize Name Suggestions #6097
Conversation
FYI I've built a debug APK at https://github.com/mnalis/StreetComplete/actions/runs/12737099313 (if somebody else wants to test but can't compile their own)... You @kmpoppe could click on Back to the PR, I've noticed the colors are broken in dark mode (white box, too dark dropdownlist triangle) - PR version on the right: Other than that, it seems to work as advertised: on that specific example node, it offers (and applies when selected) It would also be interesting how it handles if more than one language (e.g. currently it says only |
https://overpass-turbo.eu/s/1X3K might be helpful in finding them. My quick test seems to indicate it works fine there too (e.g. https://www.openstreetmap.org/node/3839537126): small_Screen_Recording_20250112_233032_StreetComplete.Dev.mp4 |
Yes, the |
Removed forced colors to make quest_localizedname_row layout work with Light and Dark themes.
Removed the forced colours, lo and behold: Dark and Light views now work as expected. See Debug APK |
...main/java/de/westnordost/streetcomplete/quests/bus_stop_name/BusStopNameSuggestionsSource.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Flo Edelmann <[email protected]>
Hooray!
It was also a loss of general decoration around text that made the empty margins look excessive. With your newest debug APK, it got that underline, so it looks better already. I would probably look even nicer (and waste less screen real estate) if that empty space between But not a showstopper for me (unless it is easy to fix) |
...main/java/de/westnordost/streetcomplete/quests/bus_stop_name/BusStopNameSuggestionsSource.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/quests/bus_stop_name/AddBusStopNameForm.kt
Outdated
Show resolved
Hide resolved
...main/java/de/westnordost/streetcomplete/quests/bus_stop_name/BusStopNameSuggestionsSource.kt
Outdated
Show resolved
Hide resolved
Adding a centralized NameSuggestionSource, Bus- and RoadNameSuggestionSource now use their functions. De-Clutter BusNameSuggestionSource
Reworked for a central NameSuggestionSource, @mnalis could you please find another example to test with more than one name? |
Could you first review the code yourself? Glancing over it, I am sure you will still find something. |
Also, generally, I'd prefer if the bus stop name and road name quests would use the name suggestions source directly rather than having a class in-between (unless there is a good reason for it - at a glance, I don't see a good reason). |
I was debating that with myself and thought that specific classes would make more sense but alas, if you don't, I'll remove the specific classes and just work with NameSuggestion |
…onsSource in all Quests
Sure, e.g. https://www.openstreetmap.org/node/9207779395 or https://www.openstreetmap.org/node/8208818583 (Found by some manual looking at https://overpass-turbo.eu/s/1XnZ) |
Remove unused layout
(List<LatLon>.distanceTo(List<LatLon>, ...) is documented as distance of two polylines. It is only by "coincidence" that this is equal to minimum distance of two sets of points to each other)
…explanatory comments as for the parameters chosen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a few minor things, but since I had to dig into the code anyway and you certainly want to get on with the fixme name stuff to which this PR is merely the prerequisite, I just did those myself.
Other than small stuff like adding some explanatory comments and doc comments, the more important things I changed were:
- added
fun ElementGeometry.distance(point: LatLon): Double
instead of having to do this manually in thegetNames
function (stopped short of a more genericElementGeometry.distance(other: ElementGeometry)
function, because this complexity is not necessary for this purpose) - no linking to some static val of
AddRoadNameForm
from some other class - properly typed
filter
parameter ingetNames
Thanks for the edits @westnordost, the |
Resolves #5187 (Blocks #5934)
Finds Bus Stop Names around 250 m of the point the quest is asked for.
UI changed from a left-aligned simple text-input to a centered suggestion-enabled input just like road names.
Quest asked for this node, suggestions from https://www.openstreetmap.org/node/123368775 and https://www.openstreetmap.org/node/418728678
Thoughts? I'd like to get this implemented before I put #5934 to work.