mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-28 21:00:19 +02:00
feat(YouTube Music): add Hide sample shelf
patch
This commit is contained in:
parent
bfda7b4a3e
commit
788d0fd06c
@ -0,0 +1,53 @@
|
|||||||
|
package app.revanced.patches.music.general.sampleshelf
|
||||||
|
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
|
import app.revanced.patches.music.utils.integrations.Constants.COMPONENTS_PATH
|
||||||
|
import app.revanced.patches.music.utils.litho.LithoFilterPatch
|
||||||
|
import app.revanced.patches.music.utils.settings.CategoryType
|
||||||
|
import app.revanced.patches.music.utils.settings.SettingsPatch
|
||||||
|
|
||||||
|
@Patch(
|
||||||
|
name = "Hide sample shelf",
|
||||||
|
description = "Adds an option to hide the sample shelf from the homepage.",
|
||||||
|
dependencies = [
|
||||||
|
LithoFilterPatch::class,
|
||||||
|
SettingsPatch::class
|
||||||
|
],
|
||||||
|
compatiblePackages = [
|
||||||
|
CompatiblePackage(
|
||||||
|
"com.google.android.apps.youtube.music",
|
||||||
|
[
|
||||||
|
"6.21.52",
|
||||||
|
"6.22.52",
|
||||||
|
"6.23.56",
|
||||||
|
"6.25.53",
|
||||||
|
"6.26.51",
|
||||||
|
"6.27.54",
|
||||||
|
"6.28.53",
|
||||||
|
"6.29.58",
|
||||||
|
"6.31.55",
|
||||||
|
"6.33.52"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@Suppress("unused")
|
||||||
|
object HideSampleShelfPatch : BytecodePatch(emptySet()) {
|
||||||
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
|
SettingsPatch.addMusicPreference(
|
||||||
|
CategoryType.GENERAL,
|
||||||
|
"revanced_hide_samples_shelf",
|
||||||
|
"false"
|
||||||
|
)
|
||||||
|
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val FILTER_CLASS_DESCRIPTOR =
|
||||||
|
"$COMPONENTS_PATH/SampleShelfFilter;"
|
||||||
|
}
|
@ -178,6 +178,8 @@ Some features may not work properly in the old player layout."</string>
|
|||||||
<string name="revanced_hide_premium_renewal_title">Hide premium renewal banner</string>
|
<string name="revanced_hide_premium_renewal_title">Hide premium renewal banner</string>
|
||||||
<string name="revanced_hide_samples_button_summary">Hides the samples button.</string>
|
<string name="revanced_hide_samples_button_summary">Hides the samples button.</string>
|
||||||
<string name="revanced_hide_samples_button_title">Hide samples button</string>
|
<string name="revanced_hide_samples_button_title">Hide samples button</string>
|
||||||
|
<string name="revanced_hide_samples_shelf_summary">Hides the samples shelf from the homepage.</string>
|
||||||
|
<string name="revanced_hide_samples_shelf_title">Hide samples shelf</string>
|
||||||
<string name="revanced_hide_terms_container_summary">Hides terms of service container.</string>
|
<string name="revanced_hide_terms_container_summary">Hides terms of service container.</string>
|
||||||
<string name="revanced_hide_terms_container_title">Hide terms container</string>
|
<string name="revanced_hide_terms_container_title">Hide terms container</string>
|
||||||
<string name="revanced_hide_upgrade_button_summary">Hides the upgrade button.</string>
|
<string name="revanced_hide_upgrade_button_summary">Hides the upgrade button.</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user