From 6ca7946e8f3d5be76241b88f1d7a5a881629dda9 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 27 Dec 2023 05:01:48 +0100 Subject: [PATCH] fix(YouTube - Hide layout components): Hide emergency box when enabled --- .../patches/components/LayoutComponentsFilter.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java index db088ad62f..afc9b84572 100644 --- a/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/patches/components/LayoutComponentsFilter.java @@ -130,6 +130,11 @@ public LayoutComponentsFilter() { "channel_guidelines_entry_banner" ); + final var emergencyBox = new StringFilterGroup( + SettingsEnum.HIDE_EMERGENCY_BOX, + "emergency_onebox" + ); + // The player audio track button does the exact same function as the audio track flyout menu option. // But if the copy url button is shown, these button clashes and the the audio button does not work. // Previously this was a setting to show/hide the player button. @@ -239,6 +244,7 @@ public LayoutComponentsFilter() { medicalPanel, videoQualityMenuFooter, infoPanel, + emergencyBox, subscribersCommunityGuidelines, channelGuidelines, audioTrackButton, @@ -258,10 +264,10 @@ public boolean isFiltered(@Nullable String identifier, String path, byte[] proto return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); } } - + // The groups are excluded from the filter due to the exceptions list below. // Filter them separately here. - if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata) + if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata) return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex); if (matchedGroup != custom && exceptions.matches(path))