mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-31 23:25:50 +01:00
fix(YouTube): Merge multiple layout patches into Hide Layout Components
(#721)
This commit is contained in:
parent
5f49e92579
commit
c76d8b166e
@ -1,14 +0,0 @@
|
||||
package app.revanced.integrations.youtube.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.integrations.youtube.settings.Settings;
|
||||
import app.revanced.integrations.shared.Utils;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class HideAlbumCardsPatch {
|
||||
public static void hideAlbumCard(View view) {
|
||||
if (!Settings.HIDE_ALBUM_CARDS.get()) return;
|
||||
Utils.hideViewByLayoutParams(view);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package app.revanced.integrations.youtube.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.integrations.youtube.settings.Settings;
|
||||
import app.revanced.integrations.shared.Utils;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class HideCrowdfundingBoxPatch {
|
||||
//Used by app.revanced.patches.youtube.layout.hidecrowdfundingbox.patch.HideCrowdfundingBoxPatch
|
||||
public static void hideCrowdfundingBox(View view) {
|
||||
if (!Settings.HIDE_CROWDFUNDING_BOX.get()) return;
|
||||
Utils.hideViewByLayoutParams(view);
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package app.revanced.integrations.youtube.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.integrations.youtube.settings.Settings;
|
||||
import app.revanced.integrations.shared.Utils;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class HideFilterBarPatch {
|
||||
public static int hideInFeed(final int height) {
|
||||
if (Settings.HIDE_FILTER_BAR_FEED_IN_FEED.get()) return 0;
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
public static void hideInRelatedVideos(final View chipView) {
|
||||
if (!Settings.HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS.get()) return;
|
||||
|
||||
Utils.hideViewByLayoutParams(chipView);
|
||||
}
|
||||
|
||||
public static int hideInSearch(final int height) {
|
||||
if (Settings.HIDE_FILTER_BAR_FEED_IN_SEARCH.get()) return 0;
|
||||
|
||||
return height;
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package app.revanced.integrations.youtube.patches;
|
||||
|
||||
import app.revanced.integrations.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class HideFloatingMicrophoneButtonPatch {
|
||||
public static boolean hideFloatingMicrophoneButton(final boolean original) {
|
||||
return Settings.HIDE_FLOATING_MICROPHONE_BUTTON.get() || original;
|
||||
}
|
||||
}
|
@ -383,6 +383,51 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
return !Settings.HIDE_VIDEO_CHANNEL_WATERMARK.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static void hideAlbumCard(View view) {
|
||||
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_ALBUM_CARDS, view);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static void hideCrowdfundingBox(View view) {
|
||||
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_CROWDFUNDING_BOX, view);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static boolean hideFloatingMicrophoneButton(final boolean original) {
|
||||
return original || Settings.HIDE_FLOATING_MICROPHONE_BUTTON.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static int hideInFeed(final int height) {
|
||||
return Settings.HIDE_FILTER_BAR_FEED_IN_FEED.get()
|
||||
? 0
|
||||
: height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static int hideInSearch(int height) {
|
||||
return Settings.HIDE_FILTER_BAR_FEED_IN_SEARCH.get()
|
||||
? 0
|
||||
: height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static void hideInRelatedVideos(View chipView) {
|
||||
Utils.hideViewBy0dpUnderCondition(Settings.HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS, chipView);
|
||||
}
|
||||
|
||||
private static final boolean HIDE_DOODLES_ENABLED = Settings.HIDE_DOODLES.get();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user