From df8edcc382d5d4871ce9f8768a5974c9f5aa1d4b Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Sun, 1 Sep 2024 02:59:12 +0900 Subject: [PATCH] fix(YouTube Music - Return YouTube Dislike): Likes and dislikes are switched in RTL layout --- .../music/returnyoutubedislike/ReturnYouTubeDislike.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/music/returnyoutubedislike/ReturnYouTubeDislike.java b/app/src/main/java/app/revanced/integrations/music/returnyoutubedislike/ReturnYouTubeDislike.java index a604cb5025..a0239b604f 100644 --- a/app/src/main/java/app/revanced/integrations/music/returnyoutubedislike/ReturnYouTubeDislike.java +++ b/app/src/main/java/app/revanced/integrations/music/returnyoutubedislike/ReturnYouTubeDislike.java @@ -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, @@ -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());