Skip to content

Commit

Permalink
feat(YouTube/Overlay buttons): replace time-ordered playlist button…
Browse files Browse the repository at this point in the history
… with `play all` button (inotia00#96)

* feat(YouTube): Add `Play All` Overlay buttons

* Fix

* Reorder

* fix compile error

* chore: clarify description

* chore: add dependency

* chore: use lowercase letters, same as other buttons

---------

Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
  • Loading branch information
YT-Advanced and inotia00 authored Dec 4, 2024
1 parent 198c95e commit 9982245
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ object VisualPreferencesIconsPatch : BaseResourcePatch(
"revanced_overlay_button_copy_video_url_timestamp",
"revanced_overlay_button_mute_volume",
"revanced_overlay_button_external_downloader",
"revanced_overlay_button_play_all",
"revanced_overlay_button_speed_dialog",
"revanced_overlay_button_time_ordered_playlist",
"revanced_overlay_button_whitelist",
"revanced_preference_screen_account_menu",
"revanced_preference_screen_action_buttons",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ object OverlayButtonsPatch : BaseResourcePatch(
"CopyVideoUrlTimestamp;",
"MuteVolume;",
"ExternalDownload;",
"PlayAll;",
"SpeedDialog;",
"TimeOrderedPlaylist;",
"Whitelists;"
).forEach { className ->
PlayerControlsPatch.hookBottomControlButton("$OVERLAY_BUTTONS_PATH/$className")
Expand Down Expand Up @@ -145,13 +145,13 @@ object OverlayButtonsPatch : BaseResourcePatch(
"quantum_ic_fullscreen_exit_white_24.png",
"quantum_ic_fullscreen_grey600_24.png",
"quantum_ic_fullscreen_white_24.png",
"revanced_time_ordered_playlist_button.png",
"revanced_copy_button.png",
"revanced_copy_timestamp_button.png",
"revanced_download_button.png",
"revanced_play_all_button.png",
"revanced_speed_button.png",
"revanced_volume_muted_button.png",
"revanced_volume_unmuted_button.png",
"revanced_speed_button.png",
"revanced_whitelist_button.png",
"yt_fill_arrow_repeat_white_24.png",
"yt_outline_arrow_repeat_1_white_24.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/copy_video_url_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_copy_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/copy_video_url_timestamp_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/copy_video_url_timestamp_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_copy_timestamp_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/mute_volume_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/mute_volume_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_mute_volume_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/whitelist_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/whitelist_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_whitelist_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/time_ordered_playlist_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/time_ordered_playlist_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_time_ordered_playlist_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/always_repeat_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/whitelist_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_whitelist_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/play_all_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/play_all_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_play_all_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/always_repeat_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/always_repeat_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_repeat_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/external_download_button" style="@style/YouTubePlayerButton"/>
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/external_download_button" android:paddingLeft="0.0dip" android:paddingTop="22.0dip" android:paddingRight="0.0dip" android:paddingBottom="22.0dip" android:longClickable="false" android:layout_width="48.0dip" android:layout_height="48.0dip" android:src="@drawable/revanced_download_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button" style="@style/YouTubePlayerButton"/>
</android.support.constraint.ConstraintLayout>
28 changes: 28 additions & 0 deletions src/main/resources/youtube/settings/host/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,34 @@
<string-array name="revanced_external_downloader_playlist_website">
<item>https://github.com/deniscerri/ytdlnis/releases/latest</item>
</string-array>
<string-array name="revanced_overlay_button_play_all_type_entries">
<item>@string/revanced_overlay_button_play_all_type_entry_1</item>
<item>@string/revanced_overlay_button_play_all_type_entry_2</item>
<item>@string/revanced_overlay_button_play_all_type_entry_3</item>
<item>@string/revanced_overlay_button_play_all_type_entry_4</item>
<item>@string/revanced_overlay_button_play_all_type_entry_5</item>
<item>@string/revanced_overlay_button_play_all_type_entry_6</item>
<item>@string/revanced_overlay_button_play_all_type_entry_7</item>
<item>@string/revanced_overlay_button_play_all_type_entry_8</item>
<item>@string/revanced_overlay_button_play_all_type_entry_9</item>
<item>@string/revanced_overlay_button_play_all_type_entry_10</item>
<item>@string/revanced_overlay_button_play_all_type_entry_11</item>
<item>@string/revanced_overlay_button_play_all_type_entry_12</item>
</string-array>
<string-array name="revanced_overlay_button_play_all_type_entry_values">
<item>ALL_CONTENTS_WITH_TIME_DESCENDING</item>
<item>ALL_CONTENTS_WITH_POPULAR_DESCENDING</item>
<item>VIDEOS_ONLY_WITH_TIME_DESCENDING</item>
<item>VIDEOS_ONLY_WITH_POPULAR_DESCENDING</item>
<item>SHORTS_ONLY_WITH_TIME_DESCENDING</item>
<item>SHORTS_ONLY_WITH_POPULAR_DESCENDING</item>
<item>LIVESTREAMS_ONLY_WITH_TIME_DESCENDING</item>
<item>LIVESTREAMS_ONLY_WITH_POPULAR_DESCENDING</item>
<item>ALL_MEMBERSHIPS_CONTENTS</item>
<item>MEMBERSHIPS_VIDEOS_ONLY</item>
<item>MEMBERSHIPS_SHORTS_ONLY</item>
<item>MEMBERSHIPS_LIVESTREAMS_ONLY</item>
</string-array>
<string-array name="revanced_miniplayer_type_19_15_entries">
<item>@string/revanced_miniplayer_type_entry_1</item>
<item>@string/revanced_miniplayer_type_entry_2</item>
Expand Down
23 changes: 20 additions & 3 deletions src/main/resources/youtube/settings/host/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,26 @@ Tap and hold to reset playback speed to 1.0x. Tap and hold again to reset back t
<string name="revanced_overlay_button_whitelist_summary">"Tap to open whitelist dialog.
Tap and hold to open whitelist setting dialog.</string>

<string name="revanced_overlay_button_time_ordered_playlist_title">Show time-ordered playlist button</string>
<string name="revanced_overlay_button_time_ordered_playlist_summary">"Tap to generate a playlist of all videos from channel from oldest to newest.
Tap and hold to undo."</string>
<string name="revanced_overlay_button_play_all_title">Show play all button</string>
<string name="revanced_overlay_button_play_all_summary">"Tap to generate a playlist of all videos from channel.
Tap and hold to undo.

Info:
• May not work on livestreams."</string>
<string name="revanced_overlay_button_play_all_type_title">Generate playlist mode</string>
<string name="revanced_overlay_button_play_all_type_entry_1">All contents (Sort by time)</string>
<string name="revanced_overlay_button_play_all_type_entry_2">All contents (Sort by popular)</string>
<string name="revanced_overlay_button_play_all_type_entry_3">Videos only (Sort by time)</string>
<string name="revanced_overlay_button_play_all_type_entry_4">Videos only (Sort by popular)</string>
<string name="revanced_overlay_button_play_all_type_entry_5">Shorts only (Sort by time)</string>
<string name="revanced_overlay_button_play_all_type_entry_6">Shorts only (Sort by popular)</string>
<string name="revanced_overlay_button_play_all_type_entry_7">Streamed videos only (Sort by time)</string>
<string name="revanced_overlay_button_play_all_type_entry_8">Streamed videos only (Sort by popular)</string>
<string name="revanced_overlay_button_play_all_type_entry_9">All Members only contents</string>
<string name="revanced_overlay_button_play_all_type_entry_10">Members only videos</string>
<string name="revanced_overlay_button_play_all_type_entry_11">Members only shorts</string>
<string name="revanced_overlay_button_play_all_type_entry_12">Members only livestreams</string>
<string name="revanced_overlay_button_play_all_not_available_toast">Unable to generate playlist due to channel id mismatch.</string>

<string name="revanced_whitelist_settings_title">Channel whitelist</string>
<string name="revanced_whitelist_settings_summary">Check or remove the list of channels added to the whitelist.</string>
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/youtube/settings/xml/revanced_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,12 @@
<SwitchPreference android:title="@string/revanced_overlay_button_copy_video_url_title" android:key="revanced_overlay_button_copy_video_url" android:summary="@string/revanced_overlay_button_copy_video_url_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_copy_video_url_timestamp_title" android:key="revanced_overlay_button_copy_video_url_timestamp" android:summary="@string/revanced_overlay_button_copy_video_url_timestamp_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_mute_volume_title" android:key="revanced_overlay_button_mute_volume" android:summary="@string/revanced_overlay_button_mute_volume_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_external_downloader_title" android:key="revanced_overlay_button_external_downloader" android:summary="@string/revanced_overlay_button_external_downloader_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_speed_dialog_title" android:key="revanced_overlay_button_speed_dialog" android:summary="@string/revanced_overlay_button_speed_dialog_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_time_ordered_playlist_title" android:key="revanced_overlay_button_time_ordered_playlist" android:summary="@string/revanced_overlay_button_time_ordered_playlist_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_whitelist_title" android:key="revanced_overlay_button_whitelist" android:summary="@string/revanced_overlay_button_whitelist_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_external_downloader_title" android:key="revanced_overlay_button_external_downloader" android:summary="@string/revanced_overlay_button_external_downloader_summary" />
<app.revanced.integrations.youtube.settings.preference.ExternalDownloaderVideoPreference android:title="@string/revanced_external_downloader_package_name_video_title" android:key="revanced_external_downloader_package_name_video" android:summary="@string/revanced_external_downloader_package_name_video_summary" />
<SwitchPreference android:title="@string/revanced_overlay_button_play_all_title" android:key="revanced_overlay_button_play_all" android:summary="@string/revanced_overlay_button_play_all_summary" />
<ListPreference android:entries="@array/revanced_overlay_button_play_all_type_entries" android:title="@string/revanced_overlay_button_play_all_type_title" android:key="revanced_overlay_button_play_all_type" android:entryValues="@array/revanced_overlay_button_play_all_type_entry_values" android:dependency="revanced_overlay_button_play_all" />
<SwitchPreference android:title="@string/revanced_overlay_button_whitelist_title" android:key="revanced_overlay_button_whitelist" android:summary="@string/revanced_overlay_button_whitelist_summary" />
<app.revanced.integrations.youtube.settings.preference.WhitelistedChannelsPreference android:title="@string/revanced_whitelist_settings_title" android:key="revanced_whitelist_settings" android:summary="@string/revanced_whitelist_settings_summary" />SETTINGS: OVERLAY_BUTTONS -->

<!-- PREFERENCE_SCREENS: PLAYER_BUTTONS
Expand Down

0 comments on commit 9982245

Please sign in to comment.