-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 quests for capacity=
, capacity:disabled=
and orientation=
for amenity=parking
#497
Conversation
There is still one thing I need to address: I don't know how I access the tags of the object in question when creating the form, so that I can skip adding the "Other Answer" for the AddDisabledCapacity quest. Can someone point me in the right direction or show me where in the code something like that is already done? |
capacity=
, capacity:disabled=
and orientation
for parking areascapacity=
, capacity:disabled=
and orientation=
for parking areas
capacity=
, capacity:disabled=
and orientation=
for parking areascapacity=
, capacity:disabled=
and orientation=
for amenity=parking
You can access the You seem to copy a lot of pretty huge vector graphics here. I would much prefer creating the orientation drawables like the parking overlay does it. |
Was the third quest ever rejected upstream? On first glance, it looks potentially useful to me, but I don't have an overview over discussions / decisions already taken on that matter. |
Yes, it was rejected: streetcomplete#4163 (comment) |
Ah, I see, makes sense. Added one more comment in that ticket. Thanks for looking it up! |
I have tried to create the images for the parking orientation quest dynamically to no avail now for some time. I simply cannot make dynamically created drawables play nicely in a Quest where a selection is to be made, and there are no quests where drawables are dynamically created in a simple "select one" context. I have now remade the form to be a simple text radio select, which I hope will suffice. If deemed insufficient, I can also remove this quest for now. |
Curious: What problem did you encounter? To the Android system, it shouldn't matter if one drawable is a vector drawable, a raster drawable or some completely custom drawable that draws itself dynamically. But who knows, maybe there is a bug in the recycler view, or the recycler view never triggers a redraw on a drawable or something |
How do the capacity quest work exactly?
You can create the drawable using This works for me, but the image disappears if it is selected. |
I think the quest for the general capacity should explain this as a hint that it is about the total amount of all parking spaces.
|
I would like to bring this PR to completion, as I still have a lot of ideas for PRs for SCEE that I would like to start working on. :)
If I understand correctly, you also struggled getting this to work, so I would conclude that it is not (in whole) due to my lack of experience with Android development, but something that may be out of scope for now. So I see three options on how to continue regarding the
How do you want to proceed @Helium314? |
I have a added hint about the capacity to I have also made it possible to answer 0 for the disabled capacity quest. (I chose to tag |
I don't really remember, as that was quite a while ago... but I think getting the images to show was quite simple, and I didn't investigate further after noticing the issue when selecting the image (I think I was already working on something else when I noticed, and didn't bother to check further for the time being). I think it's worth trying to use the |
I have tried once again and can now report where I'm stuck. In contrast to a simple resource, the function SCEE/app/src/main/java/de/westnordost/streetcomplete/quests/cycleway/AddCyclewayForm.kt Line 171 in 4e58ad7
So I tried doing the same thing: override val items = ParkingOrientation.values().map { it.asItem(requireContext()) } It at least compiles fine, but as soon as the quest is opened, the following error occurs:
I am unsure how to "attach" this fragment to a context, as it works in |
The issue is that Instead of |
Thank you! That was the last piece to the puzzle! Good news: It works! I managed to reproduce what @Helium314 mentioned was possible. video_2024-03-24_19-11-49.mp4
Pinging @westnordost, maybe you can make conclusions from this video if your theory is correct? (And maybe even know how to fix it if it's a quick fix? 😳) |
Sorry, no idea |
While I don't have an idea what's causing this, a simple solution is converting the drawable to a bitmap drawable (using @wielandb why did you choose to add new strings for parking orientation instead of using the existing ones? They are used for the same thing, and are already translated. |
When the quest was a radio-select quest, I used strings with more explanation which were then boiled down to the one word descriptions. I removed them now and used the already available ones. |
Looks good now, only a few rather minor things I noticed:
|
Implemented all your suggestions. Should be ready for review now. 🙂 |
This PR adds 3 quests relating to parking mapped as
amenity=parking
: