-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixed text alignment for RTL selects #5689
Conversation
@@ -137,8 +137,6 @@ void setUpButton(TextView button, int index) { | |||
button.setTextSize(TypedValue.COMPLEX_UNIT_DIP, QuestionFontSizeUtils.getQuestionFontSize()); | |||
button.setText(HtmlUtils.textToHtml(prompt.getSelectChoiceText(filteredItems.get(index)))); | |||
button.setTag(items.indexOf(filteredItems.get(index))); | |||
button.setGravity(LocalizedApplicationKt.isLTR(context) ? Gravity.START : Gravity.END); |
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.
It looks like we no longer need to do that programmatically.
9404b3d
to
47725da
Compare
I think this is the right behavior and forcing text that comes from an LTR language like English to be displayed on the right was wrong. @seadowg do you agree? |
Not sure I understand the problem here. Either way, I reckon this would be better to discuss with @alyblenkin. |
We used to force text that is from LTR languages to be displayed on the right side if the layout is RTL and the other way around. To me, this approach was wrong and also caused issues like #5684 |
Hey @grzesiek2010, sorry for the slow response on this one! I agree that it was wrong to display LTR language on the right with RTL layouts. So we should always default to the language direction: LTR language + RTL layout = displayed on the left |
Thanks @alyblenkin so I'm adding the |
@grzesiek2010 And what about differences between Android 5.1 and 13 (at the screenshots above)? Which one is the correct behavior? |
13 is the correct one and that is what you should see on most of the Android versions. If there is something wrong with the oldest versions Android 5 or 5 and 6 that's acceptable I would say. |
To me, it's a correct behavior. It's in RTL so elements are displayed from right to left but the labels come from an LTR language so they are on the left (in their containers). I would say that using LTR labels with RTL layout doesn't make sense so that's why it's confusing. I hope our users won't do that. |
Tested with Success! Verified on device with Android 10 Verified cases:
|
Tested with Success! Verified on device with Android 5.1 and 13 |
Closes #5684
What has been done to verify that this works as intended?
I've tested the fix manually.
Why is this the best possible solution? Were any other approaches considered?
There is nothin to discuss here.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Please test the fix on many different Android versions. It's important to check those older - Android 5.
Do we need any specific form for testing your changes? If so, please attach one.
No.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.