feat(YouTube/Hide layout components): add Hide videos with low views settings

This commit is contained in:
inotia00 2023-11-11 23:38:59 +09:00
parent 1ea0780723
commit 628ae11721
4 changed files with 11 additions and 5 deletions

View File

@ -47,6 +47,7 @@ object LayoutComponentsPatch : BytecodePatch() {
LithoFilterPatch.addFilter("$COMPONENTS_PATH/CommunityPostFilter;")
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsFilter;")
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LayoutComponentsUniversalFilter;")
LithoFilterPatch.addFilter("$COMPONENTS_PATH/LowViewsFilter;")
/**
* Add settings

View File

@ -70,14 +70,14 @@ internal object ResourceHelper {
updatePatchStatusSettings("Header", headerName)
}
internal fun ResourceContext.updatePatchStatusLabel(appName: String) {
updatePatchStatusSettings("Label", appName)
}
internal fun ResourceContext.updatePatchStatusIcon(iconName: String) {
updatePatchStatusSettings("Icon", "@string/revanced_icon_$iconName")
}
internal fun ResourceContext.updatePatchStatusLabel(appName: String) {
updatePatchStatusSettings("Label", appName)
}
internal fun ResourceContext.updatePatchStatusTheme(themeName: String) {
updatePatchStatusSettings("Theme", themeName)
}

View File

@ -587,6 +587,9 @@ Known issue: Autoplay does not work."</string>
<string name="revanced_hide_video_ads_summary_off">Video ads are shown.</string>
<string name="revanced_hide_video_ads_summary_on">Video ads are hidden.</string>
<string name="revanced_hide_video_ads_title">Hide video ads</string>
<string name="revanced_hide_video_with_low_view_summary">"Hide videos with less than 1,000 views exposed to the home feed.
Some videos, including those from channels you subscribe to, may not be hidden even if they have fewer than 1,000 views."</string>
<string name="revanced_hide_video_with_low_view_title">Hide videos with low views</string>
<string name="revanced_hide_view_products_summary_off">View products banner is shown.</string>
<string name="revanced_hide_view_products_summary_on">View products banner is hidden.</string>
<string name="revanced_hide_view_products_title">Hide view products banner</string>

View File

@ -245,7 +245,9 @@
<SwitchPreference android:title="@string/revanced_hide_movie_shelf_title" android:key="revanced_hide_movie_shelf" android:defaultValue="false" android:summaryOn="@string/revanced_hide_movie_shelf_summary_on" android:summaryOff="@string/revanced_hide_movie_shelf_summary_off" />
<SwitchPreference android:title="@string/revanced_hide_search_bar_title" android:key="revanced_hide_search_bar" android:defaultValue="false" android:summaryOn="@string/revanced_hide_search_bar_summary_on" android:summaryOff="@string/revanced_hide_search_bar_summary_off" />
<SwitchPreference android:title="@string/revanced_hide_ticket_shelf_title" android:key="revanced_hide_ticket_shelf" android:defaultValue="true" android:summaryOn="@string/revanced_hide_ticket_shelf_summary_on" android:summaryOff="@string/revanced_hide_ticket_shelf_summary_off" />
<SwitchPreference android:title="@string/revanced_hide_timed_reactions_title" android:key="revanced_hide_timed_reactions" android:defaultValue="true" android:summaryOn="@string/revanced_hide_timed_reactions_summary_on" android:summaryOff="@string/revanced_hide_timed_reactions_summary_off" />SETTINGS: HIDE_LAYOUT_COMPONENTS -->
<SwitchPreference android:title="@string/revanced_hide_timed_reactions_title" android:key="revanced_hide_timed_reactions" android:defaultValue="true" android:summaryOn="@string/revanced_hide_timed_reactions_summary_on" android:summaryOff="@string/revanced_hide_timed_reactions_summary_off" />
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_experimental_flag" />
<SwitchPreference android:title="@string/revanced_hide_video_with_low_view_title" android:key="revanced_hide_video_with_low_view" android:defaultValue="false" android:summary="@string/revanced_hide_video_with_low_view_summary" />SETTINGS: HIDE_LAYOUT_COMPONENTS -->
<!-- SETTINGS: HIDE_DESCRIPTION_COMPONENTS
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_description_title" />