fixing LTR layout

This commit is contained in:
LisoUseInAIKyrios 2023-03-14 22:40:05 +04:00
parent 52ac4acff3
commit 5e518855d1

View File

@ -434,14 +434,14 @@ public class ReturnYouTubeDislike {
// left separator // left separator
final Rect leftSeparatorBounds = new Rect(0, 0, 3, 54); final Rect leftSeparatorBounds = new Rect(0, 0, 3, 54);
String leftSeparatorString = ReVancedUtils.isRightToLeftTextLayout() String leftSeparatorString = ReVancedUtils.isRightToLeftTextLayout()
? "\u200F " // u200F = right to left character ? "\u200F " // u200F = right to left character
: "\u2FF0 "; // u2FF0 = left to right character : "\u200E "; // u200E = left to right character
Spannable leftSeparatorSpan = new SpannableString(leftSeparatorString); Spannable leftSeparatorSpan = new SpannableString(leftSeparatorString);
ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape()); ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape());
shapeDrawable.getPaint().setColor(separatorColor); shapeDrawable.getPaint().setColor(separatorColor);
shapeDrawable.setBounds(leftSeparatorBounds); shapeDrawable.setBounds(leftSeparatorBounds);
leftSeparatorSpan.setSpan(new VerticallyCenteredImageSpan(shapeDrawable), 0, 1, leftSeparatorSpan.setSpan(new VerticallyCenteredImageSpan(shapeDrawable), 1, 2,
Spannable.SPAN_INCLUSIVE_EXCLUSIVE); Spannable.SPAN_INCLUSIVE_EXCLUSIVE); // drawable cannot overwrite RTL or LTR character
builder.append(leftSeparatorSpan); builder.append(leftSeparatorSpan);
} }