mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 08:23:00 +01:00
Fix RTL text direction not enforced when text starts with LTR characters.
Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
committed by
Greyson Parrelli
parent
42e275ef0a
commit
9fbb7683bc
@@ -135,7 +135,17 @@ public class EmojiTextView extends AppCompatTextView {
|
||||
spoilerRendererDelegate = new SpoilerRendererDelegate(this);
|
||||
}
|
||||
|
||||
textDirection = getLayoutDirection() == LAYOUT_DIRECTION_LTR ? TextDirectionHeuristics.FIRSTSTRONG_RTL : TextDirectionHeuristics.ANYRTL_LTR;
|
||||
if (getLayoutDirection() == LAYOUT_DIRECTION_LTR) {
|
||||
textDirection = TextDirectionHeuristics.FIRSTSTRONG_RTL;
|
||||
if (getTextDirection() == TEXT_DIRECTION_INHERIT) {
|
||||
setTextDirection(TEXT_DIRECTION_FIRST_STRONG_RTL);
|
||||
}
|
||||
} else {
|
||||
textDirection = TextDirectionHeuristics.ANYRTL_LTR;
|
||||
if (getTextDirection() == TEXT_DIRECTION_INHERIT) {
|
||||
setTextDirection(TEXT_DIRECTION_ANY_RTL);
|
||||
}
|
||||
}
|
||||
|
||||
setEmojiCompatEnabled(useSystemEmoji());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user