mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-31 23:25:50 +01:00
feat(YouTube - Hide layout components): Hide player shopping shelf (#723)
This commit is contained in:
parent
4d48f00d98
commit
fbaf2883cc
@ -106,7 +106,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide a view by setting its layout height and width to 1dp.
|
||||
* Hide a view by setting its layout height and width to 0dp.
|
||||
*
|
||||
* @param condition The setting to check for hiding the view.
|
||||
* @param view The view to hide.
|
||||
|
@ -251,7 +251,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
);
|
||||
|
||||
horizontalShelves = new StringFilterGroup(
|
||||
Settings.HIDE_HORIZONTAL_SHELVES,
|
||||
null, // Multiple settings use this filter.
|
||||
"horizontal_video_shelf.eml",
|
||||
"horizontal_shelf.eml",
|
||||
"horizontal_shelf_inline.eml",
|
||||
@ -458,11 +458,18 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
}
|
||||
|
||||
private static boolean hideShelves() {
|
||||
// If the player is opened while library is selected,
|
||||
// then filter any recommendations below the player.
|
||||
if (PlayerType.getCurrent().isMaximizedOrFullscreen()
|
||||
// Or if the search is active while library is selected, then also filter.
|
||||
|| NavigationBar.isSearchBarActive()) {
|
||||
// Video player can show a horizontal shopping shelf below the video.
|
||||
// It appears this is the only shelf that can appear in the player,
|
||||
// and no shelves are shown in the recommendations under the video.
|
||||
if (PlayerType.getCurrent().isMaximizedOrFullscreen()) {
|
||||
return Settings.HIDE_PLAYER_STORE_SHELF.get();
|
||||
}
|
||||
|
||||
if (!Settings.HIDE_HORIZONTAL_SHELVES.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NavigationBar.isSearchBarActive()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_MERCHANDISE_BANNERS = new BooleanSetting("revanced_hide_merchandise_banners", TRUE);
|
||||
public static final BooleanSetting HIDE_PAID_PROMOTION_LABEL = new BooleanSetting("revanced_hide_paid_promotion_label", TRUE);
|
||||
public static final BooleanSetting HIDE_PRODUCTS_BANNER = new BooleanSetting("revanced_hide_products_banner", TRUE);
|
||||
public static final BooleanSetting HIDE_PLAYER_STORE_SHELF = new BooleanSetting("revanced_hide_player_store_shelf", TRUE);
|
||||
public static final BooleanSetting HIDE_SHOPPING_LINKS = new BooleanSetting("revanced_hide_shopping_links", TRUE);
|
||||
public static final BooleanSetting HIDE_SELF_SPONSOR = new BooleanSetting("revanced_hide_self_sponsor_ads", TRUE);
|
||||
public static final BooleanSetting HIDE_VIDEO_ADS = new BooleanSetting("revanced_hide_video_ads", TRUE, true);
|
||||
|
Loading…
Reference in New Issue
Block a user