mirror of
https://github.com/revanced/revanced-integrations
synced 2024-11-22 05:02:19 +01:00
fix(youtube/return-youtube-dislike): fix right to left text layout (#333)
This commit is contained in:
commit
2dd14313a6
@ -434,14 +434,14 @@ public class ReturnYouTubeDislike {
|
||||
// left separator
|
||||
final Rect leftSeparatorBounds = new Rect(0, 0, 3, 54);
|
||||
String leftSeparatorString = ReVancedUtils.isRightToLeftTextLayout()
|
||||
? "\u200F " // u200F = right to left character
|
||||
: "\u2FF0 "; // u2FF0 = left to right character
|
||||
? "\u200F " // u200F = right to left character
|
||||
: "\u200E "; // u200E = left to right character
|
||||
Spannable leftSeparatorSpan = new SpannableString(leftSeparatorString);
|
||||
ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape());
|
||||
shapeDrawable.getPaint().setColor(separatorColor);
|
||||
shapeDrawable.setBounds(leftSeparatorBounds);
|
||||
leftSeparatorSpan.setSpan(new VerticallyCenteredImageSpan(shapeDrawable), 0, 1,
|
||||
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
leftSeparatorSpan.setSpan(new VerticallyCenteredImageSpan(shapeDrawable), 1, 2,
|
||||
Spannable.SPAN_INCLUSIVE_EXCLUSIVE); // drawable cannot overwrite RTL or LTR character
|
||||
builder.append(leftSeparatorSpan);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user