Skip to content

Commit

Permalink
feat(YouTube - Comments): Add Hide 'Chat summary' (#4110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ILoveOpenSourceApplications authored Dec 12, 2024
1 parent c696b5f commit 269493c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ final class CommentsFilter extends Filter {
private final ByteArrayFilterGroup emojiPickerBufferGroup;

public CommentsFilter() {
var chatSummary = new StringFilterGroup(
Settings.HIDE_COMMENTS_CHAT_SUMMARY,
"live_chat_summary_banner.eml"
);

var commentsByMembers = new StringFilterGroup(
Settings.HIDE_COMMENTS_BY_MEMBERS_HEADER,
"sponsorships_comments_header.eml",
Expand Down Expand Up @@ -54,6 +59,7 @@ public CommentsFilter() {
);

addPathCallbacks(
chatSummary,
commentsByMembers,
comments,
createAShort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public class Settings extends BaseSettings {
public static final StringSetting EXTERNAL_DOWNLOADER_PACKAGE_NAME = new StringSetting("revanced_external_downloader_name",
"org.schabi.newpipe" /* NewPipe */, parentsAny(EXTERNAL_DOWNLOADER, EXTERNAL_DOWNLOADER_ACTION_BUTTON));
// Comments
public static final BooleanSetting HIDE_COMMENTS_CHAT_SUMMARY = new BooleanSetting("revanced_hide_comments_chat_summary", FALSE);
public static final BooleanSetting HIDE_COMMENTS_BY_MEMBERS_HEADER = new BooleanSetting("revanced_hide_comments_by_members_header", FALSE);
public static final BooleanSetting HIDE_COMMENTS_CREATE_A_SHORT_BUTTON = new BooleanSetting("revanced_hide_comments_create_a_short_button", TRUE);
public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
PreferenceScreenPreference(
"revanced_comments_screen",
preferences = setOf(
SwitchPreference("revanced_hide_comments_chat_summary"),
SwitchPreference("revanced_hide_comments_by_members_header"),
SwitchPreference("revanced_hide_comments_section"),
SwitchPreference("revanced_hide_comments_create_a_short_button"),
Expand Down
3 changes: 3 additions & 0 deletions patches/src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ You will not be notified of any unexpected events."</string>

<string name="revanced_comments_screen_title">Comments</string>
<string name="revanced_comments_screen_summary">Hide or show comments section components</string>
<string name="revanced_hide_comments_chat_summary_title">Hide \'Chat summary\' </string>
<string name="revanced_hide_comments_chat_summary_summary_on">\'Chat summary\' is hidden</string>
<string name="revanced_hide_comments_chat_summary_summary_off">\'Chat summary\' is shown</string>
<string name="revanced_hide_comments_by_members_header_title">Hide \'Comments by members\' header</string>
<string name="revanced_hide_comments_by_members_header_summary_on">\'Comments by members\' header is hidden</string>
<string name="revanced_hide_comments_by_members_header_summary_off">\'Comments by members\' header is shown</string>
Expand Down

0 comments on commit 269493c

Please sign in to comment.