diff --git a/app/src/main/java/app/revanced/integrations/patches/FullscreenPanelsRemoverPatch.java b/app/src/main/java/app/revanced/integrations/patches/FullscreenPanelsRemoverPatch.java new file mode 100644 index 0000000000..cb35874ede --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/FullscreenPanelsRemoverPatch.java @@ -0,0 +1,13 @@ +package app.revanced.integrations.patches; + +import android.view.View; + +import app.revanced.integrations.settings.SettingsEnum; + +public class FullscreenPanelsRemoverPatch { + + public int getFullsceenPanelsVisibility() { + return SettingsEnum.FULLSCREEN_PANELS_SHOWN.getBoolean() ? View.VISIBLE : View.GONE; + } + +} diff --git a/app/src/main/java/app/revanced/integrations/patches/HideAutoplayButtonPatch.java b/app/src/main/java/app/revanced/integrations/patches/HideAutoplayButtonPatch.java new file mode 100644 index 0000000000..7a65432401 --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/HideAutoplayButtonPatch.java @@ -0,0 +1,15 @@ +package app.revanced.integrations.patches; + +import app.revanced.integrations.settings.SettingsEnum; + +public class HideAutoplayButtonPatch { + + public static boolean isButtonShown() { + return SettingsEnum.AUTOPLAY_BUTTON_SHOWN.getBoolean(); + } + + public static boolean isButtonHidden() { + return !isButtonShown(); + } + +} diff --git a/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java b/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java index e7aa17bb52..0d5301de6a 100644 --- a/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java +++ b/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java @@ -6,7 +6,9 @@ public class HideInfoCardSuggestionsPatch { - public static int hideInfoCardSuggestions() { - return SettingsEnum.INFO_CARDS_SHOWN.getBoolean() ? View.VISIBLE : View.GONE; + public static void hideInfoCardSuggestions(View view) { + if (!SettingsEnum.INFO_CARDS_SHOWN.getBoolean()) { + view.setVisibility(View.GONE); + } } } diff --git a/app/src/main/java/app/revanced/integrations/patches/MinimizedPlaybackPatch.java b/app/src/main/java/app/revanced/integrations/patches/MinimizedPlaybackPatch.java new file mode 100644 index 0000000000..513039665d --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/MinimizedPlaybackPatch.java @@ -0,0 +1,11 @@ +package app.revanced.integrations.patches; + +import app.revanced.integrations.settings.SettingsEnum; + +public class MinimizedPlaybackPatch { + + public static boolean isMinimizedPlaybackEnabled() { + return SettingsEnum.ENABLE_MINIMIZED_PLAYBACK.getBoolean(); + } + +} diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 919ee5ecab..12ea93ec1e 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -52,10 +52,12 @@ public enum SettingsEnum { INFO_CARDS_SHOWN("revanced_info_cards_enabled", false, ReturnType.BOOLEAN), BRANDING_SHOWN("revanced_branding_watermark_enabled", false, ReturnType.BOOLEAN), CAST_BUTTON_SHOWN("revanced_cast_button_enabled", false, ReturnType.BOOLEAN), + AUTOPLAY_BUTTON_SHOWN("revanced_autoplay_button_enabled", false, ReturnType.BOOLEAN), //ToDo: Add to prefs USE_TABLET_MINIPLAYER("revanced_tablet_miniplayer", false, ReturnType.BOOLEAN), CREATE_BUTTON_SHOWN("revanced_create_button_enabled", false, ReturnType.BOOLEAN), USE_NEW_ACTIONBAR("revanced_new_actionbar", true, ReturnType.BOOLEAN), SHORTS_BUTTON_SHOWN("revanced_shorts_button_enabled", false, ReturnType.BOOLEAN), + FULLSCREEN_PANELS_SHOWN("revanced_fullscreen_panels_enabled", false, ReturnType.BOOLEAN), //ToDo: Add to prefs //Misc. Settings AUTOREPEAT_BUTTON_SHOWN("revanced_pref_auto_repeat_button", false, ReturnType.BOOLEAN), @@ -63,6 +65,7 @@ public enum SettingsEnum { PREFERRED_AUTO_REPEAT("revanced_pref_auto_repeat", true, ReturnType.BOOLEAN), USE_HDR_AUTO_BRIGHTNESS("revanced_pref_hdr_autobrightness", true, ReturnType.BOOLEAN), TAP_SEEKING_ENABLED("revanced_enable_tap_seeking", true, ReturnType.BOOLEAN), + ENABLE_MINIMIZED_PLAYBACK("revanced_enable_minimized_playback", true, ReturnType.BOOLEAN), //Swipe controls ENABLE_SWIPE_BRIGHTNESS("revanced_enable_swipe_brightness", true, ReturnType.BOOLEAN), diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/StringRef.java b/app/src/main/java/app/revanced/integrations/sponsorblock/StringRef.java index 30b303101e..423199909d 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/StringRef.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/StringRef.java @@ -1,9 +1,7 @@ package app.revanced.integrations.sponsorblock; -import android.content.Context; import android.content.res.Resources; - import androidx.annotation.NonNull; import java.util.HashMap; @@ -14,17 +12,6 @@ public class StringRef { private static Resources resources; private static String packageName; - /** - * Called in Application onCreate, should be called as soon as possible when after application startup - * - * @param context Any context, it will be used to obtain string resources - */ - public static void setContext(Context context) { - if (context == null) return; - resources = context.getApplicationContext().getResources(); - packageName = context.getPackageName(); - } - private static final HashMap strings = new HashMap<>(); /**