Skip to content

Commit

Permalink
refactor(YouTube - Miniplayer): Use 'Default' language to describe un…
Browse files Browse the repository at this point in the history
…patched Miniplayer type
  • Loading branch information
LisoUseInAIKyrios committed Dec 9, 2024
1 parent f5769ec commit be3630a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum StartPage {
/**
* Unmodified type, and same as un-patched.
*/
ORIGINAL("", null),
DEFAULT("", null),

/**
* Browse id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
}
Expand Down Expand Up @@ -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;
}

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<MiniplayerType> MINIPLAYER_TYPE = new EnumSetting<>("revanced_miniplayer_type", MiniplayerType.ORIGINAL, true);
public static final EnumSetting<MiniplayerType> 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);
Expand Down Expand Up @@ -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<StartPage> CHANGE_START_PAGE = new EnumSetting<>("revanced_change_start_page", StartPage.ORIGINAL, true);
public static final EnumSetting<StartPage> 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);
Expand Down
6 changes: 3 additions & 3 deletions patches/src/main/resources/addresources/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<string-array name="revanced_miniplayer_type_entry_values">
<!-- Enum names from the extension. -->
<item>DISABLED</item>
<item>ORIGINAL</item>
<item>DEFAULT</item>
<item>MINIMAL</item>
<item>TABLET</item>
<item>MODERN_1</item>
Expand All @@ -172,7 +172,7 @@
</string-array>
<string-array name="revanced_miniplayer_type_legacy_entry_values">
<!-- Enum names from the extension. -->
<item>ORIGINAL</item>
<item>DEFAULT</item>
<item>MINIMAL</item>
<item>TABLET</item>
<item>MODERN_1</item>
Expand Down Expand Up @@ -201,7 +201,7 @@
</string-array>
<string-array name="revanced_change_start_page_entry_values">
<!-- Enum names from extension -->
<item>ORIGINAL</item>
<item>DEFAULT</item>
<!-- Intent Action -->
<item>SEARCH</item>
<item>SHORTS</item>
Expand Down
2 changes: 1 addition & 1 deletion patches/src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_miniplayer_screen_summary">Change the style of the in app minimized player</string>
<string name="revanced_miniplayer_type_title">Miniplayer type</string>
<string name="revanced_miniplayer_type_entry_0">Disabled</string>
<string name="revanced_miniplayer_type_entry_1">Original</string>
<string name="revanced_miniplayer_type_entry_1">Default</string>
<string name="revanced_miniplayer_type_entry_2">Minimal</string>
<string name="revanced_miniplayer_type_entry_3">Tablet</string>
<string name="revanced_miniplayer_type_entry_4">Modern 1</string>
Expand Down

0 comments on commit be3630a

Please sign in to comment.