Skip to content

Commit

Permalink
refactor: Use name Seekbar thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Oct 24, 2024
1 parent 6a7eb20 commit ab659de
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
8 changes: 4 additions & 4 deletions api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -1832,14 +1832,14 @@ public final class app/revanced/patches/youtube/layout/searchbar/WideSearchbarPa
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}

public final class app/revanced/patches/youtube/layout/seekbar/FullscreenSeekbarThumbnailsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/seekbar/FullscreenSeekbarThumbnailsPatch;
public final class app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}

public final class app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch;
public final class app/revanced/patches/youtube/layout/seekbar/SeekbarThumbnailsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/seekbar/SeekbarThumbnailsPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.util.resultOrThrow

@Patch(
name = "Fullscreen seekbar thumbnails",
name = "Seekbar thumbnails",
description = "Adds an option to use high quality fullscreen seekbar thumbnails.",
dependencies = [IntegrationsPatch::class, AddResourcesPatch::class, VersionCheckPatch::class],
compatiblePackages = [
Expand All @@ -30,22 +30,24 @@ import app.revanced.util.resultOrThrow
]
)
@Suppress("unused")
object FullscreenSeekbarThumbnailsPatch : BytecodePatch(
object SeekbarThumbnailsPatch : BytecodePatch(
setOf(FullscreenSeekbarThumbnailsQualityFingerprint)
) {
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/youtube/patches/FullscreenSeekbarThumbnailsPatch;"
"Lapp/revanced/integrations/youtube/patches/SeekbarThumbnailsPatch;"

override fun execute(context: BytecodeContext) {
AddResourcesPatch(this::class)

SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences(
if (!VersionCheckPatch.is_19_17_or_greater) {
SwitchPreference( key = "revanced_seekbar_fullscreen_high_quality",
summaryOnKey = "revanced_seekbar_fullscreen_high_quality_legacy_summary_on",
summaryOffKey = "revanced_seekbar_fullscreen_high_quality_legacy_summary_on")
SwitchPreference(
key = "revanced_seekbar_thumbnails_high_quality",
summaryOnKey = "revanced_seekbar_thumbnails_high_quality_legacy_summary_on",
summaryOffKey = "revanced_seekbar_thumbnails_high_quality_legacy_summary_on"
)
} else {
SwitchPreference("revanced_seekbar_fullscreen_high_quality")
SwitchPreference("revanced_seekbar_thumbnails_high_quality")
}
)

Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,12 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_wide_searchbar_summary_on">Wide search bar is enabled</string>
<string name="revanced_wide_searchbar_summary_off">Wide search bar is disabled</string>
</patch>
<patch id="layout.seekbar.FullscreenSeekbarThumbnailsPatch">
<string name="revanced_seekbar_fullscreen_high_quality_title">Enable high quality thumbnails</string>
<string name="revanced_seekbar_fullscreen_high_quality_summary_on">Seekbar thumbnails are high quality</string>
<string name="revanced_seekbar_fullscreen_high_quality_summary_off">Seekbar thumbnails are medium quality</string>
<string name="revanced_seekbar_fullscreen_high_quality_legacy_summary_on">Fullscreen seekbar thumbnails are high quality</string>
<string name="revanced_seekbar_fullscreen_high_quality_legacy_summary_off">Fullscreen seekbar thumbnails are medium quality</string>
<patch id="layout.seekbar.SeekbarThumbnailsPatch">
<string name="revanced_seekbar_thumbnails_high_quality_title">Enable high quality thumbnails</string>
<string name="revanced_seekbar_thumbnails_high_quality_summary_on">Seekbar thumbnails are high quality</string>
<string name="revanced_seekbar_thumbnails_high_quality_summary_off">Seekbar thumbnails are medium quality</string>
<string name="revanced_seekbar_thumbnails_high_quality_legacy_summary_on">Fullscreen seekbar thumbnails are high quality</string>
<string name="revanced_seekbar_thumbnails_high_quality_legacy_summary_off">Fullscreen seekbar thumbnails are medium quality</string>
</patch>
<patch id="layout.seekbar.RestoreOldSeekbarThumbnailsPatch">
<string name="revanced_restore_old_seekbar_thumbnails_title">Restore old seekbar thumbnails</string>
Expand Down

0 comments on commit ab659de

Please sign in to comment.