-
-
Notifications
You must be signed in to change notification settings - Fork 58
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 support for location plugins #772
base: main
Are you sure you want to change the base?
Conversation
…pdatedSearchable()
This should be reviewable now. I have added some UI for the departures with mock data in debug mode: UI demoWith map view:The Screen_recording_20240505_135903.webmWithout map view:This one doesn't look as good, as there is lots of unused space (I mainly focused on the view that includes the map) I am wondering if the background of LineType-Icon and LineName should vary between line-types: blue for busses, red for trains, etc. This might not fit very well with the material theming though. (Maybe blend the colors?) Right now, scrolling the departures works only if the Missing things:
|
…tion plugins for that
Swap the destination and departure columns , make destination fill the available space
It would make sense to apply the line colors that the transport provider uses, usually lines are color-coded in some way. And to make them fit in, you can adjust the tone of the color (light mode: 40 for container, 100 for content, dark mode: 80 for container, 20 for content). If that still looks bad, you can try to blend them, like how the WeatherIconColors are slightly adjusted to match the theme. |
Both look nice, I have two ideas:
I'd still display the address though on the larger variant, if the smaller one gets discarded. What do you think about using icons for the line type, like I have it currently implemented? And by the way, how do you come up with these mock-ups? Figma? |
I was considering this as well. I think it comes down to the question whether the small map is actually usable. Because if it's not, there is no point in showing it at all.
Yes. But first I need to figure out how to format addresses properly. Because right now the only supported address format is "[street] [house number]" which isn't used in half of the world.
Yes, the user indication now shows the direction you're looking at. I think these two information belong together so it makes sense to have them in one place. And it doesn't make a lot of sense two have two spinning arrows for essentially the same information.
It will still be visible in the compact (list) view. And I will bring it back for the mapless variant.
Yeah, makes sense. My mockup has no indication for the type of transport. But I would reduce the spacing by a bit.
I use Penpot, which is a Figma alternative that's FOSS and self-hostable. |
You mean not showing a map at all, in any type of location result? I disagree, a map helps to put the location into context. Let's say I am searching for some location and I get two results with the same name. Only a map really helps to distinguish between them. And even the small map is useful to see "ah, that one is downtown" or "further out". This especially applies to the area where one is from, since I argue after living somewhere for a while you know the map of the city to a certain degree, where a zoomed-out view with both your location and the POI visible tells you a lot.
Hooray! :) |
But how small can we make the map until that information is no longer conveyed? By the way, how did you come up with the list for |
I'd say the small variant you proposed is around that limit.
No, not at all. I picked the "most common" from https://taginfo.openstreetmap.org/tags. OSM tags consist of key-value pairs like Kvaesitso/data/openstreetmaps/src/main/java/de/mm20/launcher2/openstreetmaps/OsmLocation.kt Lines 71 to 79 in 3dd7be2
I chose an enum because I think handling strings that enumerate on something is cumbersome. Exposing that enum to the SDK sounds good to me, and after all, anyone could draft a quick PR for categories that are missing. |
Do you know if there are some ready-to-use human-readable labels for these tags available somewhere? Maybe I could save my translators some time if I could import these labels from OSM instead of adding and translating them manually. Edit: OSMAnd seems to have some, maybe I can import them from there: https://github.com/osmandapp/OsmAnd/blob/master/OsmAnd/res/values-de/phrases.xml |
I think the only thing left to do is fix OSM categories? And then this can be merged? |
I suppose so. One more thing though, is the |
Oh, true. Some providers legally require this. |
And, actually, |
… item was updated
Yet another breaking change in the plugin API. Sorry about that, make sure to update launcher and plugin sdk. |
No problem... Actually, one unrelated problem to that: getting a localized string for |
Oh, by the way, if you add strings for categories, please add them to |
I've added some tag matching to categorize the OSM locations. This seems to alleviate itself when the launcher is restarted (?) ...Aaand I just noticed that you've asked me to copy relevant localization strings over from OsmAnd. Sorry, I will clean them up tomorrow! |
They should update when the item is refreshed. So it should fix itself when the user taps an item (?)
All good, and thanks for fixing the categories |
I can't say that this was the case. But now I cannnot test that anymore because the locations I had marked as favorite in the emulator got replaced (by me). So this could be an issue once this update lands and people already have locations saved? Actually, this should be testable by building the current release version, marking a location as favorite and then switching back to this branch. |
I just tested it:
|
- run providers in parallel - flatten code
Yes, category works fine. But is long pressing now required for refreshing? Also, I had a look at OsmAnd strings; They use a different naming scheme. |
Always has been?
Alright. Gotta move them back to |
Oh, I thought that locations always refresh themselves if they are opened up and the data is older than (now) 1 minute I have added some best-effort parsing for That being said, it is a unversioned library with version code set to |
Oh yeah, right. That's what I meant. You are right, single tap leads to the same result.
Like what?
Better fork it (copy the source code to a new module in |
Successor to #769.