Skip to content

Commit

Permalink
feat(youtube/general-ads): remove hiding video shelf
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
oSumAtrIX committed Jan 28, 2023
1 parent 32dc8a8 commit 04147c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
@@ -1,7 +1,6 @@
package app.revanced.integrations.patches;

import android.view.View;

import app.revanced.integrations.adremover.AdRemoverAPI;
import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
Expand Down Expand Up @@ -32,7 +31,6 @@ public GeneralAdsPatch() {
var paidContent = new BlockRule(SettingsEnum.ADREMOVER_PAID_CONTENT_REMOVAL, "paid_content_overlay");
var merchandise = new BlockRule(SettingsEnum.ADREMOVER_MERCHANDISE_REMOVAL, "product_carousel");
var infoPanel = new BlockRule(SettingsEnum.ADREMOVER_INFO_PANEL_REMOVAL, "publisher_transparency_panel", "single_item_information_panel");
var suggestions = new BlockRule(SettingsEnum.ADREMOVER_SUGGESTIONS_REMOVAL, "horizontal_video_shelf");
var latestPosts = new BlockRule(SettingsEnum.ADREMOVER_HIDE_LATEST_POSTS, "post_shelf");
var channelGuidelines = new BlockRule(SettingsEnum.ADREMOVER_HIDE_CHANNEL_GUIDELINES, "channel_guidelines_entry_banner");
var artistCard = new BlockRule(SettingsEnum.HIDE_ARTIST_CARD, "official_card");
Expand Down Expand Up @@ -69,7 +67,6 @@ public GeneralAdsPatch() {
buttonedAd,
communityPosts,
paidContent,
suggestions,
latestPosts,
movieAds,
chapterTeaser,
Expand Down
@@ -1,14 +1,13 @@
package app.revanced.integrations.settings;

import android.content.Context;

import java.util.ArrayList;
import java.util.List;

import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;

import java.util.ArrayList;
import java.util.List;

public enum SettingsEnum {
//Download Settings
// TODO: DOWNLOAD_PATH("revanced_download_path", Environment.getExternalStorageDirectory().getPath() + "/Download", ReturnType.STRING),
Expand Down Expand Up @@ -47,7 +46,6 @@ public enum SettingsEnum {
ADREMOVER_INFO_PANEL_REMOVAL("revanced_adremover_info_panel", true, ReturnType.BOOLEAN),
ADREMOVER_MEDICAL_PANEL_REMOVAL("revanced_adremover_medical_panel", true, ReturnType.BOOLEAN),
ADREMOVER_PAID_CONTENT_REMOVAL("revanced_adremover_paid_content", true, ReturnType.BOOLEAN),
ADREMOVER_SUGGESTIONS_REMOVAL("revanced_adremover_hide_suggestions", true, ReturnType.BOOLEAN),
ADREMOVER_HIDE_LATEST_POSTS("revanced_adremover_hide_latest_posts", true, ReturnType.BOOLEAN),
ADREMOVER_HIDE_CHANNEL_GUIDELINES("revanced_adremover_hide_channel_guidelines", true, ReturnType.BOOLEAN),
ADREMOVER_SELF_SPONSOR_REMOVAL("revanced_adremover_self_sponsor", true, ReturnType.BOOLEAN),
Expand Down Expand Up @@ -225,7 +223,7 @@ public enum SettingsEnum {
//

// old/new settings where old is default off, and new has inverted value and is default on
SettingsEnum invertedSettingsToMigrate[][] = {
SettingsEnum[][] invertedSettingsToMigrate = {
{DEPRECATED_FULLSCREEN_PANELS_SHOWN, HIDE_FULLSCREEN_PANELS},
{DEPRECATED_CREATE_BUTTON_ENABLED, HIDE_CREATE_BUTTON},
{DEPRECATED_SHORTS_BUTTON_SHOWN, HIDE_SHORTS_BUTTON},
Expand All @@ -235,7 +233,7 @@ public enum SettingsEnum {
{DEPRECATED_BRANDING_SHOWN, HIDE_VIDEO_WATERMARK},
{DEPRECATED_REMEMBER_VIDEO_QUALITY, REMEMBER_VIDEO_QUALITY_LAST_SELECTED},
};
for (SettingsEnum oldNewSetting[] : invertedSettingsToMigrate) {
for (SettingsEnum[] oldNewSetting : invertedSettingsToMigrate) {
// by default, old setting was default off
// migrate to new setting of default on
SettingsEnum oldSetting = oldNewSetting[0];
Expand All @@ -254,7 +252,7 @@ public enum SettingsEnum {
//
// migrate preference of prior 'default off' settings, into replacement setting with different path name but otherwise is identical
//
SettingsEnum renamedSettings[][] = {
SettingsEnum[][] renamedSettings = {
{DEPRECATED_HIDE_MIX_PLAYLISTS, HIDE_MIX_PLAYLISTS},
{DEPRECATED_HIDE_LIKE_BUTTON, HIDE_LIKE_BUTTON},
{DEPRECATED_HIDE_DISLIKE_BUTTON, HIDE_DISLIKE_BUTTON},
Expand All @@ -263,7 +261,7 @@ public enum SettingsEnum {
{DEPRECATED_HIDE_ACTION_BUTTON, HIDE_ACTION_BUTTON},
{DEPRECATED_HIDE_SHARE_BUTTON, HIDE_SHARE_BUTTON},
};
for (SettingsEnum oldNewSetting[] : renamedSettings) {
for (SettingsEnum[] oldNewSetting : renamedSettings) {
SettingsEnum oldSetting = oldNewSetting[0];
SettingsEnum newSetting = oldNewSetting[1];

Expand Down

0 comments on commit 04147c1

Please sign in to comment.