mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-07 10:35:49 +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
|
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user