Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(YouTube Music - Return YouTube Dislike): Likes and dislikes are s…
Browse files Browse the repository at this point in the history
…witched in RTL layout
  • Loading branch information
inotia00 authored and Francesco146 committed Aug 31, 2024
1 parent 2a8cb5a commit df8edcc
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ public class ReturnYouTubeDislike {
@NonNull
private static SpannableString createDislikeSpan(@NonNull Spanned oldSpannable,
@NonNull RYDVoteData voteData) {
// Note: Some locales use right to left layout (Arabic, Hebrew, etc).
// If making changes to this code, change device settings to a RTL language and verify layout is correct.
String oldLikesString = oldSpannable.toString();

// YouTube creators can hide the like count on a video,
Expand Down Expand Up @@ -191,8 +189,8 @@ private static SpannableString createDislikeSpan(@NonNull Spanned oldSpannable,

// middle separator
String middleSeparatorString = compactLayout
? " " + MIDDLE_SEPARATOR_CHARACTER + " "
: " \u2009" + MIDDLE_SEPARATOR_CHARACTER + "\u2009 "; // u2009 = 'narrow space' character
? "\u200E " + MIDDLE_SEPARATOR_CHARACTER + " "
: "\u200E \u2009" + MIDDLE_SEPARATOR_CHARACTER + "\u2009 "; // u2009 = 'narrow space' character
final int shapeInsertionIndex = middleSeparatorString.length() / 2;
Spannable middleSeparatorSpan = new SpannableString(middleSeparatorString);
ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape());
Expand Down

0 comments on commit df8edcc

Please sign in to comment.