mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-01 00:02:55 +01:00
fix: prepare for hide-suggestions patch (#35)
This commit is contained in:
parent
3a2655b38b
commit
0ce6aa854c
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user