forked from ReVanced/revanced-integrations
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YouTube): Update
Overlay buttons
, add `Hide live chat messages…
…` and more `Start page` options (#39) * feat(YouTube): Add `Hide live chat messages` * feat(YouTube/Overlay buttons): Add ability to reset speed back to default on second tap and hold * feat(YouTube/Overlay buttons): Add `Time-ordered playlist` from channel videos * feat(YouTube): Add `Hide live chat replay` * fix(YouTube/Swipe controls): Add paddings and corner radius for better design * fix(YouTube/Seekbar components): Use middle dot separator for append timestamp information * feat(YouTube/Swipe controls): Add adjustable `Swipe overlay screen size` * fix(YouTube/Swipe controls): Normalize default text size --------- Co-authored-by: inotia00 <[email protected]>
- Loading branch information
Showing
9 changed files
with
158 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ain/java/app/revanced/integrations/youtube/patches/overlaybutton/TimeOrderedPlaylist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package app.revanced.integrations.youtube.patches.overlaybutton; | ||
|
||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
import app.revanced.integrations.shared.utils.Logger; | ||
import app.revanced.integrations.youtube.settings.Settings; | ||
import app.revanced.integrations.youtube.utils.VideoUtils; | ||
|
||
@SuppressWarnings("unused") | ||
public class TimeOrderedPlaylist extends BottomControlButton { | ||
@Nullable | ||
private static TimeOrderedPlaylist instance; | ||
|
||
public TimeOrderedPlaylist(ViewGroup bottomControlsViewGroup) { | ||
super( | ||
bottomControlsViewGroup, | ||
"time_ordered_playlist_button", | ||
Settings.OVERLAY_BUTTON_TIME_ORDERED_PLAYLIST, | ||
view -> VideoUtils.playlistFromChannelVideosListener(true), | ||
view -> { | ||
VideoUtils.playlistFromChannelVideosListener(false); | ||
return true; | ||
} | ||
); | ||
} | ||
|
||
/** | ||
* Injection point. | ||
*/ | ||
public static void initialize(View bottomControlsViewGroup) { | ||
try { | ||
if (bottomControlsViewGroup instanceof ViewGroup viewGroup) { | ||
instance = new TimeOrderedPlaylist(viewGroup); | ||
} | ||
} catch (Exception ex) { | ||
Logger.printException(() -> "initialize failure", ex); | ||
} | ||
} | ||
|
||
/** | ||
* Injection point. | ||
*/ | ||
public static void changeVisibility(boolean showing, boolean animation) { | ||
if (instance != null) instance.setVisibility(showing, animation); | ||
} | ||
|
||
public static void changeVisibilityNegatedImmediate() { | ||
if (instance != null) instance.setVisibilityNegatedImmediate(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters