Skip to content

Commit

Permalink
Miniplayer: Adjust settings text
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Oct 19, 2024
1 parent 405508e commit 2538dec
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
// 19.29.42 // All modern players are broken and ignore tapping the miniplayer video.
// 19.30.39 // Modern 3 is less broken when double tap expand is enabled, but cannot swipe to expand when double tap is off.
// 19.31.36 // All Modern 1 buttons are missing. Unusable.
// 19.32.36 // Works without issues.
// 19.33.35 // Works without issues.
"19.34.42", // Works without issues.
// 19.32.36 // 19.32+ and beyond all work without issues.
// 19.33.35
"19.34.42",
]
)
]
Expand Down Expand Up @@ -140,33 +140,39 @@ object MiniplayerPatch : BytecodePatch(
entriesKey = "revanced_miniplayer_type_19_16_entries",
entryValuesKey = "revanced_miniplayer_type_19_16_entry_values"
)

if (VersionCheckPatch.is_19_25_or_greater) {
if (!VersionCheckPatch.is_19_29_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_double_tap_action")
}
preferences += SwitchPreference("revanced_miniplayer_drag_and_drop")
}

preferences += SwitchPreference(
key = "revanced_miniplayer_hide_expand_close",
summaryOnKey =
if (VersionCheckPatch.is_19_36_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
}

preferences +=
if (VersionCheckPatch.is_19_26_or_greater) {
"revanced_miniplayer_hide_expand_close_summary_on"
SwitchPreference(
key = "revanced_miniplayer_hide_expand_close",
titleKey = "revanced_miniplayer_hide_expand_close_title",
summaryOnKey = "revanced_miniplayer_hide_expand_close_summary_on",
)
} else {
"revanced_miniplayer_hide_expand_close_legacy_summary_on"
SwitchPreference(
key = "revanced_miniplayer_hide_expand_close",
titleKey = "revanced_miniplayer_hide_expand_close_legacy_title",
summaryOnKey = "revanced_miniplayer_hide_expand_close_legacy_summary_on",
)
}
)

if (!VersionCheckPatch.is_19_26_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward")
}

preferences += SwitchPreference("revanced_miniplayer_hide_subtext")

if (VersionCheckPatch.is_19_36_or_greater) {
preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
}

if (VersionCheckPatch.is_19_26_or_greater) {
preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
}
Expand Down
20 changes: 11 additions & 9 deletions src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1010,28 +1010,30 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_miniplayer_type_entry_4">Modern 1</string>
<string name="revanced_miniplayer_type_entry_5">Modern 2</string>
<string name="revanced_miniplayer_type_entry_6">Modern 3</string>
<string name="revanced_miniplayer_width_dip_title">Miniplayer size</string>
<string name="revanced_miniplayer_width_dip_summary">On screen size, in pixels</string>
<string name="revanced_miniplayer_width_dip_invalid_toast">Pixel size must be between %1$s and %2$s</string>
<string name="revanced_miniplayer_rounded_corners_title">Enable rounded corners</string>
<string name="revanced_miniplayer_rounded_corners_summary_on">Corners are rounded</string>
<string name="revanced_miniplayer_rounded_corners_summary_off">Corners are square</string>
<string name="revanced_miniplayer_double_tap_action_title">Enable double-tap and pinch to resize</string>
<string name="revanced_miniplayer_double_tap_action_summary_on">Double-tap action and pinch to resize is enabled\n\n• Double tap to increase miniplayer size\n• Double tap again to restore original size</string>
<string name="revanced_miniplayer_double_tap_action_summary_off">Double-tap action and pinch to resize is disabled</string>
<string name="revanced_miniplayer_drag_and_drop_title">Enable drag and drop</string>
<string name="revanced_miniplayer_drag_and_drop_summary_on">Drag and drop is enabled\n\nMiniplayer can be dragged to any corner of the screen</string>
<string name="revanced_miniplayer_drag_and_drop_summary_off">Drag and drop is disabled</string>
<string name="revanced_miniplayer_hide_expand_close_title">Hide expand and close buttons</string>
<string name="revanced_miniplayer_hide_expand_close_summary_on">Buttons are hidden\n\nTap to expand, swipe to close</string>
<string name="revanced_miniplayer_hide_expand_close_title">Hide close button</string>
<string name="revanced_miniplayer_hide_expand_close_summary_on">Close button is hidden</string>
<string name="revanced_miniplayer_hide_expand_close_summary_off">Close button is shown</string>
<string name="revanced_miniplayer_hide_expand_close_legacy_title">Hide expand and close buttons</string>
<string name="revanced_miniplayer_hide_expand_close_legacy_summary_on">Buttons are hidden\n\nSwipe to expand or close</string>
<string name="revanced_miniplayer_hide_expand_close_summary_off">Expand and close buttons are shown</string>
<string name="revanced_miniplayer_hide_expand_close_legacy_summary_off">Expand and close buttons are shown</string>
<string name="revanced_miniplayer_hide_subtext_title">Hide subtexts</string>
<string name="revanced_miniplayer_hide_subtext_summary_on">Subtexts are hidden</string>
<string name="revanced_miniplayer_hide_subtext_summary_off">Subtexts are shown</string>
<string name="revanced_miniplayer_hide_rewind_forward_title">Hide skip forward and back buttons</string>
<string name="revanced_miniplayer_hide_rewind_forward_summary_on">Skip forward and back are hidden</string>
<string name="revanced_miniplayer_hide_rewind_forward_summary_off">Skip forward and back are shown</string>
<string name="revanced_miniplayer_rounded_corners_title">Use rounded corners</string>
<string name="revanced_miniplayer_rounded_corners_summary_on">Corners are rounded</string>
<string name="revanced_miniplayer_rounded_corners_summary_off">Corners are square</string>
<string name="revanced_miniplayer_width_dip_title">Initial size</string>
<string name="revanced_miniplayer_width_dip_summary">Initial on screen size, in pixels</string>
<string name="revanced_miniplayer_width_dip_invalid_toast">Pixel size must be between %1$s and %2$s</string>
<string name="revanced_miniplayer_opacity_title">Overlay opacity</string>
<string name="revanced_miniplayer_opacity_summary">Opacity value between 0-100, where 0 is transparent</string>
<string name="revanced_miniplayer_opacity_invalid_toast">Miniplayer overlay opacity must be between 0-100</string>
Expand Down

0 comments on commit 2538dec

Please sign in to comment.