mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-15 05:47:17 +02:00
feat(YouTube - Shorts components): Add Hide in watch history
setting
This commit is contained in:
parent
48a3bd0275
commit
f2363bc954
@ -140,8 +140,9 @@ public final class ShortsShelfFilter extends Filter {
|
|||||||
final boolean hideHomeAndRelatedVideos = Settings.HIDE_SHORTS_SHELF_HOME_RELATED_VIDEOS.get();
|
final boolean hideHomeAndRelatedVideos = Settings.HIDE_SHORTS_SHELF_HOME_RELATED_VIDEOS.get();
|
||||||
final boolean hideSubscriptions = Settings.HIDE_SHORTS_SHELF_SUBSCRIPTIONS.get();
|
final boolean hideSubscriptions = Settings.HIDE_SHORTS_SHELF_SUBSCRIPTIONS.get();
|
||||||
final boolean hideSearch = Settings.HIDE_SHORTS_SHELF_SEARCH.get();
|
final boolean hideSearch = Settings.HIDE_SHORTS_SHELF_SEARCH.get();
|
||||||
|
final boolean hideHistory = Settings.HIDE_SHORTS_SHELF_HISTORY.get();
|
||||||
|
|
||||||
if (hideHomeAndRelatedVideos && hideSubscriptions && hideSearch) {
|
if (hideHomeAndRelatedVideos && hideSubscriptions && hideSearch && hideHistory) {
|
||||||
// Shorts suggestions can load in the background if a video is opened and
|
// Shorts suggestions can load in the background if a video is opened and
|
||||||
// then immediately minimized before any suggestions are loaded.
|
// then immediately minimized before any suggestions are loaded.
|
||||||
// In this state the player type will show minimized, which makes it not possible to
|
// In this state the player type will show minimized, which makes it not possible to
|
||||||
@ -165,7 +166,7 @@ public final class ShortsShelfFilter extends Filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Avoid checking navigation button status if all other Shorts should show.
|
// Avoid checking navigation button status if all other Shorts should show.
|
||||||
if (!hideHomeAndRelatedVideos && !hideSubscriptions) {
|
if (!hideHomeAndRelatedVideos && !hideSubscriptions && !hideHistory) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +176,7 @@ public final class ShortsShelfFilter extends Filter {
|
|||||||
|
|
||||||
switch (browseId) {
|
switch (browseId) {
|
||||||
case BROWSE_ID_HISTORY, BROWSE_ID_LIBRARY, BROWSE_ID_NOTIFICATION_INBOX -> {
|
case BROWSE_ID_HISTORY, BROWSE_ID_LIBRARY, BROWSE_ID_NOTIFICATION_INBOX -> {
|
||||||
return false;
|
return hideHistory;
|
||||||
}
|
}
|
||||||
case BROWSE_ID_SUBSCRIPTIONS -> {
|
case BROWSE_ID_SUBSCRIPTIONS -> {
|
||||||
return hideSubscriptions;
|
return hideSubscriptions;
|
||||||
|
@ -420,7 +420,7 @@ public class Settings extends BaseSettings {
|
|||||||
public static final BooleanSetting HIDE_SHORTS_SHELF_HOME_RELATED_VIDEOS = new BooleanSetting("revanced_hide_shorts_shelf_home_related_videos", TRUE);
|
public static final BooleanSetting HIDE_SHORTS_SHELF_HOME_RELATED_VIDEOS = new BooleanSetting("revanced_hide_shorts_shelf_home_related_videos", TRUE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_SHELF_SUBSCRIPTIONS = new BooleanSetting("revanced_hide_shorts_shelf_subscriptions", TRUE);
|
public static final BooleanSetting HIDE_SHORTS_SHELF_SUBSCRIPTIONS = new BooleanSetting("revanced_hide_shorts_shelf_subscriptions", TRUE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_SHELF_SEARCH = new BooleanSetting("revanced_hide_shorts_shelf_search", TRUE);
|
public static final BooleanSetting HIDE_SHORTS_SHELF_SEARCH = new BooleanSetting("revanced_hide_shorts_shelf_search", TRUE);
|
||||||
public static final BooleanSetting HIDE_SHORTS_SHELF_HISTORY = new BooleanSetting("revanced_hide_shorts_shelf_history", FALSE);
|
public static final BooleanSetting HIDE_SHORTS_SHELF_HISTORY = new BooleanSetting("revanced_hide_shorts_shelf_history", TRUE);
|
||||||
public static final IntegerSetting CHANGE_SHORTS_REPEAT_STATE = new IntegerSetting("revanced_change_shorts_repeat_state", 0);
|
public static final IntegerSetting CHANGE_SHORTS_REPEAT_STATE = new IntegerSetting("revanced_change_shorts_repeat_state", 0);
|
||||||
|
|
||||||
// PreferenceScreen: Shorts - Shorts player components
|
// PreferenceScreen: Shorts - Shorts player components
|
||||||
|
@ -585,6 +585,7 @@
|
|||||||
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_home_related_videos_title" android:key="revanced_hide_shorts_shelf_home_related_videos" android:summaryOn="@string/revanced_hide_shorts_shelf_home_related_videos_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_home_related_videos_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_home_related_videos_title" android:key="revanced_hide_shorts_shelf_home_related_videos" android:summaryOn="@string/revanced_hide_shorts_shelf_home_related_videos_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_home_related_videos_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_subscriptions_title" android:key="revanced_hide_shorts_shelf_subscriptions" android:summaryOn="@string/revanced_hide_shorts_shelf_subscriptions_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_subscriptions_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_subscriptions_title" android:key="revanced_hide_shorts_shelf_subscriptions" android:summaryOn="@string/revanced_hide_shorts_shelf_subscriptions_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_subscriptions_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
||||||
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_search_title" android:key="revanced_hide_shorts_shelf_search" android:summaryOn="@string/revanced_hide_shorts_shelf_search_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_search_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_search_title" android:key="revanced_hide_shorts_shelf_search" android:summaryOn="@string/revanced_hide_shorts_shelf_search_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_search_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
||||||
|
<SwitchPreference android:title="@string/revanced_hide_shorts_shelf_history_title" android:key="revanced_hide_shorts_shelf_history" android:summaryOn="@string/revanced_hide_shorts_shelf_history_summary_on" android:summaryOff="@string/revanced_hide_shorts_shelf_history_summary_off" android:dependency="revanced_hide_shorts_shelf" />
|
||||||
<PreferenceCategory android:title="@string/revanced_preference_category_experimental_flag" android:layout="@layout/revanced_settings_preferences_category"/>
|
<PreferenceCategory android:title="@string/revanced_preference_category_experimental_flag" android:layout="@layout/revanced_settings_preferences_category"/>
|
||||||
<ListPreference android:entries="@array/revanced_change_shorts_repeat_state_entries" android:title="@string/revanced_change_shorts_repeat_state_title" android:key="revanced_change_shorts_repeat_state" android:entryValues="@array/revanced_change_shorts_repeat_state_entry_values" />SETTINGS: SHORTS_COMPONENTS -->
|
<ListPreference android:entries="@array/revanced_change_shorts_repeat_state_entries" android:title="@string/revanced_change_shorts_repeat_state_title" android:key="revanced_change_shorts_repeat_state" android:entryValues="@array/revanced_change_shorts_repeat_state_entry_values" />SETTINGS: SHORTS_COMPONENTS -->
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user