From be3630afaf2122edede643d9b9d51810aa4f2fe0 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:13:39 +0400 Subject: [PATCH] refactor(YouTube - Miniplayer): Use 'Default' language to describe unpatched Miniplayer type --- .../youtube/patches/ChangeStartPagePatch.java | 2 +- .../extension/youtube/patches/MiniplayerPatch.java | 12 ++++++------ .../extension/youtube/settings/Settings.java | 4 ++-- .../main/resources/addresources/values/arrays.xml | 6 +++--- .../main/resources/addresources/values/strings.xml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeStartPagePatch.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeStartPagePatch.java index 350e5787d0..66606c71e5 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeStartPagePatch.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeStartPagePatch.java @@ -18,7 +18,7 @@ public enum StartPage { /** * Unmodified type, and same as un-patched. */ - ORIGINAL("", null), + DEFAULT("", null), /** * Browse id. diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/MiniplayerPatch.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/MiniplayerPatch.java index 80bb57f838..9842f50598 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/MiniplayerPatch.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/MiniplayerPatch.java @@ -30,7 +30,7 @@ public enum MiniplayerType { */ DISABLED(false, null), /** Unmodified type, and same as un-patched. */ - ORIGINAL(null, null), + DEFAULT(null, null), /** * Exactly the same as MINIMAL and only here for migration of user settings. * Eventually this should be deleted. @@ -182,7 +182,7 @@ public boolean isAvailable() { * effectively disabling the miniplayer. */ public static boolean getMiniplayerOnCloseHandler(boolean original) { - return CURRENT_TYPE == ORIGINAL + return CURRENT_TYPE == DEFAULT ? original : CURRENT_TYPE == DISABLED; } @@ -201,7 +201,7 @@ public static boolean getLegacyTabletMiniplayerOverride(boolean original) { * Injection point. */ public static boolean getModernMiniplayerOverride(boolean original) { - return CURRENT_TYPE == ORIGINAL + return CURRENT_TYPE == DEFAULT ? original : CURRENT_TYPE.isModern(); } @@ -229,7 +229,7 @@ public static void adjustMiniplayerOpacity(ImageView view) { * Injection point. */ public static boolean getModernFeatureFlagsActiveOverride(boolean original) { - if (CURRENT_TYPE == ORIGINAL) { + if (CURRENT_TYPE == DEFAULT) { return original; } @@ -240,7 +240,7 @@ public static boolean getModernFeatureFlagsActiveOverride(boolean original) { * Injection point. */ public static boolean enableMiniplayerDoubleTapAction(boolean original) { - if (CURRENT_TYPE == ORIGINAL) { + if (CURRENT_TYPE == DEFAULT) { return original; } @@ -251,7 +251,7 @@ public static boolean enableMiniplayerDoubleTapAction(boolean original) { * Injection point. */ public static boolean enableMiniplayerDragAndDrop(boolean original) { - if (CURRENT_TYPE == ORIGINAL) { + if (CURRENT_TYPE == DEFAULT) { return original; } diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java index 5f256fb960..dd116ec117 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java @@ -142,7 +142,7 @@ public class Settings extends BaseSettings { public static final IntegerSetting PLAYER_OVERLAY_OPACITY = new IntegerSetting("revanced_player_overlay_opacity", 100, true); public static final BooleanSetting OPEN_VIDEOS_FULLSCREEN_PORTRAIT = new BooleanSetting("revanced_open_videos_fullscreen_portrait", FALSE); // Miniplayer - public static final EnumSetting MINIPLAYER_TYPE = new EnumSetting<>("revanced_miniplayer_type", MiniplayerType.ORIGINAL, true); + public static final EnumSetting MINIPLAYER_TYPE = new EnumSetting<>("revanced_miniplayer_type", MiniplayerType.DEFAULT, true); private static final Availability MINIPLAYER_ANY_MODERN = MINIPLAYER_TYPE.availability(MODERN_1, MODERN_2, MODERN_3, MODERN_4); public static final BooleanSetting MINIPLAYER_DOUBLE_TAP_ACTION = new BooleanSetting("revanced_miniplayer_double_tap_action", TRUE, true, MINIPLAYER_ANY_MODERN); public static final BooleanSetting MINIPLAYER_DRAG_AND_DROP = new BooleanSetting("revanced_miniplayer_drag_and_drop", TRUE, true, MINIPLAYER_ANY_MODERN); @@ -204,7 +204,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting SPOOF_APP_VERSION = new BooleanSetting("revanced_spoof_app_version", FALSE, true, "revanced_spoof_app_version_user_dialog_message"); public static final BooleanSetting TABLET_LAYOUT = new BooleanSetting("revanced_tablet_layout", FALSE, true, "revanced_tablet_layout_user_dialog_message"); public static final BooleanSetting WIDE_SEARCHBAR = new BooleanSetting("revanced_wide_searchbar", FALSE, true); - public static final EnumSetting CHANGE_START_PAGE = new EnumSetting<>("revanced_change_start_page", StartPage.ORIGINAL, true); + public static final EnumSetting CHANGE_START_PAGE = new EnumSetting<>("revanced_change_start_page", StartPage.DEFAULT, true); public static final StringSetting SPOOF_APP_VERSION_TARGET = new StringSetting("revanced_spoof_app_version_target", IS_19_17_OR_GREATER ? "19.35.36" : "17.33.42", true, parent(SPOOF_APP_VERSION)); // Custom filter public static final BooleanSetting CUSTOM_FILTER = new BooleanSetting("revanced_custom_filter", FALSE); diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index bc66bb4bea..8eaf1de678 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -155,7 +155,7 @@ DISABLED - ORIGINAL + DEFAULT MINIMAL TABLET MODERN_1 @@ -172,7 +172,7 @@ - ORIGINAL + DEFAULT MINIMAL TABLET MODERN_1 @@ -201,7 +201,7 @@ - ORIGINAL + DEFAULT SEARCH SHORTS diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index 82f37cd657..c3154cd6d1 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1028,7 +1028,7 @@ This is because Crowdin requires temporarily flattening this file and removing t Change the style of the in app minimized player Miniplayer type Disabled - Original + Default Minimal Tablet Modern 1