fix: prepare for hide-suggestions patch (#35)

This commit is contained in:
Joey Peter 2022-07-02 00:26:02 +02:00 committed by GitHub
parent cfb4132ed1
commit b2d08e9e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 31 deletions

View File

@ -73,30 +73,17 @@ public class AdRemoverAPI {
}
}
/**
* 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);
}
}
/*

View File

@ -4,8 +4,8 @@ import app.revanced.integrations.settings.SettingsEnum;
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();
}

View File

@ -5,8 +5,7 @@ import app.revanced.integrations.videoswipecontrols.helpers.BrightnessHelper;
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;

View File

@ -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;
}
}

View File

@ -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);
}
}