Skip to content

Commit

Permalink
fix: prepare for hide-suggestions patch (ReVanced#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJeterLP authored and oSumAtrIX committed Jul 2, 2022
1 parent 3a2655b commit 0ce6aa8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,17 @@ public static void hideShortsButton(View view) {
}
}

/**
* Removes the InfoCardSuggestions
*
* @param InfoCardOverlayPresenter
* @return
*/
public static Object removeInfoCardSuggestions(Object InfoCardOverlayPresenter) {
if (!SettingsEnum.INFO_CARDS_SHOWN_BOOLEAN.getBoolean()) InfoCardOverlayPresenter = null;
String message = InfoCardOverlayPresenter == null ? "RemoveInfoCardSuggestions: true" : "RemoveInfoCardSuggestions: false";
LogHelper.debug(AdRemoverAPI.class, message);
return InfoCardOverlayPresenter;
}

/**
* Removes the Suggestions
*
* @param showSuggestions
* @return
*/
public static Boolean removeSuggestions(Boolean showSuggestions) {
if (!SettingsEnum.SUGGESTIONS_SHOWN_BOOLEAN.getBoolean()) showSuggestions = false;
String message = showSuggestions ? "RemoveSuggestions: true" : "RemoveSuggestions: false";
public static void hideSuggestions(View view) {
String message = SettingsEnum.SUGGESTIONS_SHOWN_BOOLEAN.getBoolean() ? "Infocard suggestions: shown" : "Infocards: hidden";
LogHelper.debug(AdRemoverAPI.class, message);
return showSuggestions;
if (!SettingsEnum.SUGGESTIONS_SHOWN_BOOLEAN.getBoolean()) {
view.setVisibility(View.GONE);
}
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class AutoRepeatPatch {

//ToDo: Write Patch for it.
//See https://drive.google.com/file/d/1hLl71Mm3oAtgTjNvsYZi3CUutCPx2gjS/view?usp=sharing for where it needs to be used.

//Used by app.revanced.patches.youtube.layout.autorepeat.patch.AutoRepeatPatch
public static boolean shouldAutoRepeat() {
return SettingsEnum.PREFERRED_AUTO_REPEAT_BOOLEAN.getBoolean();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

public class HDRMaxBrightnessPatch {

//ToDo: Write Patch for it.
//See https://drive.google.com/file/d/1rIJzsaMQouH_2__EcVY5Dg6l7ji9vsyP/view?usp=sharing for where it needs to be used.
//Used by app/revanced/patches/youtube/misc/hdrbrightness/patch/HDRBrightnessPatch
public static float getHDRBrightness(float original) {
if (!SettingsEnum.USE_HDR_BRIGHTNESS_BOOLEAN.getBoolean()) return original;
return SettingsEnum.ENABLE_SWIPE_BRIGHTNESS_BOOLEAN.getBoolean() ? BrightnessHelper.getBrightness() : -1.0f;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package app.revanced.integrations.patches;

import app.revanced.integrations.adremover.AdRemoverAPI;
import app.revanced.integrations.settings.SettingsEnum;

public class HideInfoCardSuggestionsPatch {

//TODO: Create Patch
//Not used yet
public static void HideInfoCardSuggestions(Object InfoCardOverlayPresenter) {
AdRemoverAPI.removeInfoCardSuggestions(InfoCardOverlayPresenter);
public static int hideInfoCardSuggestions() {
return SettingsEnum.INFO_CARDS_SHOWN_BOOLEAN.getBoolean() ? 0 : 8;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package app.revanced.integrations.patches;

import android.view.View;

import app.revanced.integrations.adremover.AdRemoverAPI;

public class HideSuggestionsPatch {

//TODO: Create Patch
//Not used yet
public static void HideSuggestions(boolean showSuggestions) {
AdRemoverAPI.removeSuggestions(showSuggestions);
public static void hideSuggestions(View view) {
AdRemoverAPI.hideSuggestions(view);
}

}

0 comments on commit 0ce6aa8

Please sign in to comment.