-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
refactor+docs: use paddingRelative in AlertDialog.customView #17660
Conversation
Hey @BrayanDSO I saw this and my first reaction was " 🤦 I always forget these right/left -> start/end" RTL issues" And my second reaction was "why doesn't lint catch these?". I don't have a good answer for that - #8282 discusses it but it appears that the built-in lint checks which we do have enabled simply don't catch it and we don't have a custom check So my final reaction was "I'm sure there are more of these, maybe I can just fix them really quickly?" After some consultation (https://medium.com/android-news/rtl-support-on-android-here-is-all-you-need-know-e13f2df512e2 seemed like a good resource that summarizes all of my learning as I looked into it)... I rudely hacked a second commit on here which I think does a codebase-wide fix for all existing RTL hard-coded right/left type stuff. I say rudely because I never asked, which means I am obligated to be more than happy for you or anyone reviewing to go "nope" and just drop the commit, no offense will be taken at all But maybe the commit looks good ? Maybe we should reopen 8282 or open a new one asking for a custom lint that checks for:
We don't have a label for "Reviewer added a commit that may be crap" but that's the intended reading of me adding "Needs Author Reply" label. Act as you see fit |
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsArrayAdapter.kt
Outdated
Show resolved
Hide resolved
there is no lint that reliably catches these apparently, this was an AndroidStudio search for paddingLeft/paddingRight and altering all returned items
Still LGTM |
Thanks @BrayanDSO and thanks for letting my semi-hijack your PR. i18n and l10n (for example, LTR...) stuff I try to get whenever I see it because otherwise it seems like it just never happens as it's pretty low-interest |
Small refactor extracted from other changes
Using
start
andend
is more encouraged in Android due to support for RTL languagesAll the right and left padding values were the same, so the replacements create no differences
Checklist
Please, go through these checks before submitting the PR.