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

Fixed text alignment for RTL selects #5689

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.odk.collect.android.utilities.Appearances;
import org.odk.collect.audioclips.Clip;
import org.odk.collect.imageloader.GlideImageLoader;
import org.odk.collect.strings.localization.LocalizedApplicationKt;

import java.io.File;
import java.util.ArrayList;
Expand Down Expand Up @@ -137,8 +136,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);
Copy link
Member Author

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.

button.setTextAlignment(LocalizedApplicationKt.isLTR(context) ? View.TEXT_ALIGNMENT_TEXT_START : View.TEXT_ALIGNMENT_TEXT_END);
}

boolean isItemSelected(List<Selection> selectedItems, @NonNull Selection item) {
Expand Down