Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 0ce6aa8

Browse files
TheJeterLPoSumAtrIX
authored andcommitted
fix: prepare for hide-suggestions patch (#35)
1 parent 3a2655b commit 0ce6aa8

5 files changed

Lines changed: 15 additions & 31 deletions

File tree

app/src/main/java/app/revanced/integrations/adremover/AdRemoverAPI.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,17 @@ public static void hideShortsButton(View view) {
7373
}
7474
}
7575

76-
/**
77-
* Removes the InfoCardSuggestions
78-
*
79-
* @param InfoCardOverlayPresenter
80-
* @return
81-
*/
82-
public static Object removeInfoCardSuggestions(Object InfoCardOverlayPresenter) {
83-
if (!SettingsEnum.INFO_CARDS_SHOWN_BOOLEAN.getBoolean()) InfoCardOverlayPresenter = null;
84-
String message = InfoCardOverlayPresenter == null ? "RemoveInfoCardSuggestions: true" : "RemoveInfoCardSuggestions: false";
85-
LogHelper.debug(AdRemoverAPI.class, message);
86-
return InfoCardOverlayPresenter;
87-
}
88-
8976
/**
9077
* Removes the Suggestions
9178
*
92-
* @param showSuggestions
9379
* @return
9480
*/
95-
public static Boolean removeSuggestions(Boolean showSuggestions) {
96-
if (!SettingsEnum.SUGGESTIONS_SHOWN_BOOLEAN.getBoolean()) showSuggestions = false;
97-
String message = showSuggestions ? "RemoveSuggestions: true" : "RemoveSuggestions: false";
81+
public static void hideSuggestions(View view) {
82+
String message = SettingsEnum.SUGGESTIONS_SHOWN_BOOLEAN.getBoolean() ? "Infocard suggestions: shown" : "Infocards: hidden";
9883
LogHelper.debug(AdRemoverAPI.class, message);
99-
return showSuggestions;
84+
if (!SettingsEnum.SUGGESTIONS_SHOWN_BOOLEAN.getBoolean()) {
85+
view.setVisibility(View.GONE);
86+
}
10087
}
10188

10289
/*

app/src/main/java/app/revanced/integrations/patches/AutoRepeatPatch.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
public class AutoRepeatPatch {
66

7-
//ToDo: Write Patch for it.
8-
//See https://drive.google.com/file/d/1hLl71Mm3oAtgTjNvsYZi3CUutCPx2gjS/view?usp=sharing for where it needs to be used.
7+
8+
//Used by app.revanced.patches.youtube.layout.autorepeat.patch.AutoRepeatPatch
99
public static boolean shouldAutoRepeat() {
1010
return SettingsEnum.PREFERRED_AUTO_REPEAT_BOOLEAN.getBoolean();
1111
}

app/src/main/java/app/revanced/integrations/patches/HDRMaxBrightnessPatch.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
public class HDRMaxBrightnessPatch {
77

8-
//ToDo: Write Patch for it.
9-
//See https://drive.google.com/file/d/1rIJzsaMQouH_2__EcVY5Dg6l7ji9vsyP/view?usp=sharing for where it needs to be used.
8+
//Used by app/revanced/patches/youtube/misc/hdrbrightness/patch/HDRBrightnessPatch
109
public static float getHDRBrightness(float original) {
1110
if (!SettingsEnum.USE_HDR_BRIGHTNESS_BOOLEAN.getBoolean()) return original;
1211
return SettingsEnum.ENABLE_SWIPE_BRIGHTNESS_BOOLEAN.getBoolean() ? BrightnessHelper.getBrightness() : -1.0f;
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package app.revanced.integrations.patches;
22

3-
import app.revanced.integrations.adremover.AdRemoverAPI;
3+
import app.revanced.integrations.settings.SettingsEnum;
44

55
public class HideInfoCardSuggestionsPatch {
66

7-
//TODO: Create Patch
8-
//Not used yet
9-
public static void HideInfoCardSuggestions(Object InfoCardOverlayPresenter) {
10-
AdRemoverAPI.removeInfoCardSuggestions(InfoCardOverlayPresenter);
7+
public static int hideInfoCardSuggestions() {
8+
return SettingsEnum.INFO_CARDS_SHOWN_BOOLEAN.getBoolean() ? 0 : 8;
119
}
1210
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package app.revanced.integrations.patches;
22

3+
import android.view.View;
4+
35
import app.revanced.integrations.adremover.AdRemoverAPI;
46

57
public class HideSuggestionsPatch {
68

7-
//TODO: Create Patch
8-
//Not used yet
9-
public static void HideSuggestions(boolean showSuggestions) {
10-
AdRemoverAPI.removeSuggestions(showSuggestions);
9+
public static void hideSuggestions(View view) {
10+
AdRemoverAPI.hideSuggestions(view);
1111
}
1212

1313
}

0 commit comments

Comments
 (0)