Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit c76d8b1

Browse files
fix(YouTube): Merge multiple layout patches into Hide Layout Components (#721)
1 parent 5f49e92 commit c76d8b1

File tree

5 files changed

+45
-66
lines changed

5 files changed

+45
-66
lines changed

app/src/main/java/app/revanced/integrations/youtube/patches/HideAlbumCardsPatch.java

-14
This file was deleted.

app/src/main/java/app/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch.java

-15
This file was deleted.

app/src/main/java/app/revanced/integrations/youtube/patches/HideFilterBarPatch.java

-27
This file was deleted.

app/src/main/java/app/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch.java

-10
This file was deleted.

app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java

+45
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,51 @@ public static boolean showWatermark() {
383383
return !Settings.HIDE_VIDEO_CHANNEL_WATERMARK.get();
384384
}
385385

386+
/**
387+
* Injection point.
388+
*/
389+
public static void hideAlbumCard(View view) {
390+
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_ALBUM_CARDS, view);
391+
}
392+
393+
/**
394+
* Injection point.
395+
*/
396+
public static void hideCrowdfundingBox(View view) {
397+
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_CROWDFUNDING_BOX, view);
398+
}
399+
400+
/**
401+
* Injection point.
402+
*/
403+
public static boolean hideFloatingMicrophoneButton(final boolean original) {
404+
return original || Settings.HIDE_FLOATING_MICROPHONE_BUTTON.get();
405+
}
406+
407+
/**
408+
* Injection point.
409+
*/
410+
public static int hideInFeed(final int height) {
411+
return Settings.HIDE_FILTER_BAR_FEED_IN_FEED.get()
412+
? 0
413+
: height;
414+
}
415+
416+
/**
417+
* Injection point.
418+
*/
419+
public static int hideInSearch(int height) {
420+
return Settings.HIDE_FILTER_BAR_FEED_IN_SEARCH.get()
421+
? 0
422+
: height;
423+
}
424+
425+
/**
426+
* Injection point.
427+
*/
428+
public static void hideInRelatedVideos(View chipView) {
429+
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS, chipView);
430+
}
386431

387432
private static final boolean HIDE_DOODLES_ENABLED = Settings.HIDE_DOODLES.get();
388433

0 commit comments

Comments
 (0)