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

Drop MCC hack for layouts #5298

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Drop MCC hack for layouts #5298

merged 2 commits into from
Oct 11, 2023

Conversation

FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Oct 10, 2023

As suggested in #5280 (review), this PR removes the mobile country code hack that provides different layouts depending on the country the quest is located in. A similar change has been made for the fire hydrant quest in #4369.
Now, no more layouts-mccXXX folders are left 🎉

Still left to remove in a future PR:

  • The traffic_sign_background color (used in vector drawables) is still localized for SE, FI and IS via values-mccXXX/colors.xml files.
  • The vibrating_button_illustration drawable image (used in quest_traffic_lights_vibration layout) is still localized for GB and AU via drawable-mccXXX-YYYdpi folders.
  • The MCC logic is still included in AbstractQuestForm.

I'm not sure how to approach the color and drawable localizations. @westnordost do you have a suggestion?

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, very nice!

@westnordost
Copy link
Member

I'm not sure how to approach the color and drawable localizations. @westnordost do you have a suggestion?

The Drawables are a bit of a black box in code, i.e. I don't think it would be feasible (not sure if possible) to modify their properties (i.e. some color) at runtime.

So, the traffic_sign_background would need to be removed from these drawables and instead new drawables like background_maxspeed_sign_yellow.xml need to be created. Which drawables are used for the layout then needs to be set prammatically.

@westnordost westnordost merged commit fbef023 into streetcomplete:master Oct 11, 2023
@FloEdelmann FloEdelmann deleted the drop-mcc-layouts branch October 11, 2023 11:52
@matkoniecz
Copy link
Member

Thanks! I remember how confused I was by this mechanism (and still not entirely sure how it worked)

@FloEdelmann FloEdelmann added the hacktoberfest-accepted pull request that should be treated as eligible for Hacktoberfest event label Oct 15, 2023
@westnordost westnordost mentioned this pull request Dec 20, 2023
@FloEdelmann FloEdelmann self-assigned this Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup hacktoberfest-accepted pull request that should be treated as eligible for Hacktoberfest event
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

3 participants