mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
feat(YouTube - Hide Shorts components): Selectively hide Shorts for home / subscription / search (#2925)
This commit is contained in:
parent
e25a3033a5
commit
497c067e80
3 changed files with 33 additions and 13 deletions
|
@ -14,6 +14,8 @@ import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||||
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.*
|
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.*
|
||||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||||
|
import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch
|
||||||
|
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
|
@ -25,7 +27,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
IntegrationsPatch::class,
|
IntegrationsPatch::class,
|
||||||
LithoFilterPatch::class,
|
LithoFilterPatch::class,
|
||||||
HideShortsComponentsResourcePatch::class,
|
HideShortsComponentsResourcePatch::class,
|
||||||
ResourceMappingPatch::class
|
ResourceMappingPatch::class,
|
||||||
|
NavigationBarHookPatch::class,
|
||||||
|
PlayerTypeHookPatch::class
|
||||||
],
|
],
|
||||||
compatiblePackages = [
|
compatiblePackages = [
|
||||||
CompatiblePackage(
|
CompatiblePackage(
|
||||||
|
|
|
@ -17,22 +17,32 @@ object HideShortsComponentsResourcePatch : ResourcePatch() {
|
||||||
AddResourcesPatch(this::class)
|
AddResourcesPatch(this::class)
|
||||||
|
|
||||||
SettingsPatch.PreferenceScreen.SHORTS.addPreferences(
|
SettingsPatch.PreferenceScreen.SHORTS.addPreferences(
|
||||||
SwitchPreference("revanced_hide_shorts"),
|
SwitchPreference("revanced_hide_shorts_home"),
|
||||||
SwitchPreference("revanced_hide_shorts_join_button"),
|
SwitchPreference("revanced_hide_shorts_subscriptions"),
|
||||||
SwitchPreference("revanced_hide_shorts_subscribe_button"),
|
SwitchPreference("revanced_hide_shorts_search"),
|
||||||
SwitchPreference("revanced_hide_shorts_subscribe_button_paused"),
|
|
||||||
SwitchPreference("revanced_hide_shorts_thanks_button"),
|
// Shorts player components.
|
||||||
|
// Ideally each group should be ordered similar to how they appear in the UI
|
||||||
|
// since this Setting menu currently uses the ordering used here.
|
||||||
|
|
||||||
|
// Vertical row of buttons on right side of the screen.
|
||||||
SwitchPreference("revanced_hide_shorts_like_button"),
|
SwitchPreference("revanced_hide_shorts_like_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_dislike_button"),
|
SwitchPreference("revanced_hide_shorts_dislike_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_comments_button"),
|
SwitchPreference("revanced_hide_shorts_comments_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_remix_button"),
|
|
||||||
SwitchPreference("revanced_hide_shorts_share_button"),
|
SwitchPreference("revanced_hide_shorts_share_button"),
|
||||||
SwitchPreference("revanced_hide_shorts_info_panel"),
|
SwitchPreference("revanced_hide_shorts_remix_button"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_sound_button"),
|
||||||
|
|
||||||
|
// Everything else.
|
||||||
|
SwitchPreference("revanced_hide_shorts_thanks_button"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_join_button"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_subscribe_button"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_subscribe_button_paused"),
|
||||||
SwitchPreference("revanced_hide_shorts_channel_bar"),
|
SwitchPreference("revanced_hide_shorts_channel_bar"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_info_panel"),
|
||||||
|
SwitchPreference("revanced_hide_shorts_full_video_link_label"),
|
||||||
SwitchPreference("revanced_hide_shorts_video_title"),
|
SwitchPreference("revanced_hide_shorts_video_title"),
|
||||||
SwitchPreference("revanced_hide_shorts_sound_metadata_label"),
|
SwitchPreference("revanced_hide_shorts_sound_metadata_label"),
|
||||||
SwitchPreference("revanced_hide_shorts_full_video_link_label"),
|
|
||||||
SwitchPreference("revanced_hide_shorts_sound_button"),
|
|
||||||
SwitchPreference("revanced_hide_shorts_navigation_bar"),
|
SwitchPreference("revanced_hide_shorts_navigation_bar"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -479,9 +479,15 @@
|
||||||
<string name="revanced_hide_seekbar_thumbnail_summary_off">Thumbnail seekbar is shown</string>
|
<string name="revanced_hide_seekbar_thumbnail_summary_off">Thumbnail seekbar is shown</string>
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="layout.hide.shorts.HideShortsComponentsResourcePatch">
|
<patch id="layout.hide.shorts.HideShortsComponentsResourcePatch">
|
||||||
<string name="revanced_hide_shorts_title">Hide Shorts in feed</string>
|
<string name="revanced_hide_shorts_home_title">Hide Shorts in home feed</string>
|
||||||
<string name="revanced_hide_shorts_summary_on">Shorts are hidden</string>
|
<string name="revanced_hide_shorts_home_summary_on">Shorts in home feed are hidden</string>
|
||||||
<string name="revanced_hide_shorts_summary_off">Shorts are shown</string>
|
<string name="revanced_hide_shorts_home_summary_off">Shorts in home feed are shown</string>
|
||||||
|
<string name="revanced_hide_shorts_subscriptions_title">Hide Shorts in subscription feed</string>
|
||||||
|
<string name="revanced_hide_shorts_subscriptions_summary_on">Shorts in subscription feed are hidden</string>
|
||||||
|
<string name="revanced_hide_shorts_subscriptions_summary_off">Shorts in subscription feed are shown</string>
|
||||||
|
<string name="revanced_hide_shorts_search_title">Hide Shorts in search results</string>
|
||||||
|
<string name="revanced_hide_shorts_search_summary_on">Shorts in search results are hidden</string>
|
||||||
|
<string name="revanced_hide_shorts_search_summary_off">Shorts in search results are shown</string>
|
||||||
<string name="revanced_hide_shorts_join_button_title">Hide join button</string>
|
<string name="revanced_hide_shorts_join_button_title">Hide join button</string>
|
||||||
<string name="revanced_hide_shorts_join_button_summary_on">Join button is hidden</string>
|
<string name="revanced_hide_shorts_join_button_summary_on">Join button is hidden</string>
|
||||||
<string name="revanced_hide_shorts_join_button_summary_off">Join button is shown</string>
|
<string name="revanced_hide_shorts_join_button_summary_off">Join button is shown</string>
|
||||||
|
|
Loading…
Reference in a new issue