-
-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(youtube/hide-seekbar): more fine grained hiding of seekbar (#2252)
Co-authored-by: oSumAtrIX <[email protected]>
- Loading branch information
1 parent
94f31f8
commit 0f07bf4
Showing
4 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...in/kotlin/app/revanced/patches/youtube/layout/seekbar/resource/SeekbarPreferencesPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package app.revanced.patches.youtube.layout.seekbar.resource | ||
|
||
import app.revanced.patcher.data.ResourceContext | ||
import app.revanced.patcher.patch.* | ||
import app.revanced.patcher.patch.annotations.DependsOn | ||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch | ||
import app.revanced.patches.shared.settings.preference.BasePreference | ||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen | ||
import app.revanced.patches.shared.settings.preference.impl.StringResource | ||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch | ||
import java.io.Closeable | ||
|
||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class]) | ||
class SeekbarPreferencesPatch : ResourcePatch, Closeable { | ||
override fun execute(context: ResourceContext): PatchResult { | ||
|
||
// Nothing to do here. All work is done in close method. | ||
|
||
return PatchResultSuccess() | ||
} | ||
|
||
override fun close() { | ||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( | ||
PreferenceScreen( | ||
"revanced_seekbar_preference_screen", | ||
StringResource("revanced_seekbar_preference_screen_title", "Seekbar settings"), | ||
seekbarPreferences | ||
) | ||
) | ||
} | ||
|
||
companion object { | ||
private val seekbarPreferences = mutableListOf<BasePreference>() | ||
|
||
internal fun addPreferences(vararg preferencesToAdd: BasePreference) { | ||
seekbarPreferences.addAll(preferencesToAdd) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters