mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-02-02 15:17:32 +01:00
parent
3460237c0f
commit
e08567892d
@ -0,0 +1,8 @@
|
||||
package fi.razerman.youtube.Helpers;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
public class XSwipeHelper {
|
||||
// Implementation in another repo
|
||||
public static ViewGroup nextGenWatchLayout;
|
||||
}
|
@ -11,6 +11,8 @@ import com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import fi.razerman.youtube.Helpers.XSwipeHelper;
|
||||
|
||||
import static fi.razerman.youtube.XGlobals.debug;
|
||||
|
||||
public class SponsorBlockView {
|
||||
@ -145,11 +147,29 @@ public class SponsorBlockView {
|
||||
}
|
||||
|
||||
private static void bringLayoutToFront() {
|
||||
checkLayout();
|
||||
inlineSponsorOverlay.bringToFront();
|
||||
inlineSponsorOverlay.requestLayout();
|
||||
inlineSponsorOverlay.invalidate();
|
||||
}
|
||||
|
||||
private static void checkLayout() {
|
||||
if (inlineSponsorOverlay.getHeight() == 0) {
|
||||
View layout = XSwipeHelper.nextGenWatchLayout.findViewById(getIdentifier("player_overlays", "id"));
|
||||
if (layout != null) {
|
||||
|
||||
initialize(layout);
|
||||
|
||||
if (debug){
|
||||
Log.d("XGlobals", "player_overlays refreshed for SB");
|
||||
}
|
||||
}
|
||||
else if (debug){
|
||||
Log.d("XGlobals", "player_overlays was not found for SB");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int getIdentifier(String name, String defType) {
|
||||
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||
return context.getResources().getIdentifier(name, defType, context.getPackageName());
|
||||
|
Loading…
x
Reference in New Issue
Block a user