mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-20 16:57:32 +01:00
rename YouTubeApplication
This commit is contained in:
parent
a47bdb3a2b
commit
d0caaaeacc
@ -4,7 +4,7 @@ import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class YouTubeApplication extends Application {
|
||||
public class YouTubeTikTokRoot_Application extends Application {
|
||||
protected void onCreate(final Bundle bundle) {
|
||||
super.onCreate();
|
||||
}
|
@ -7,7 +7,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.google.android.apps.youtube.app.YouTubeApplication;
|
||||
import com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
@ -69,9 +69,9 @@ public class SponsorBlockView {
|
||||
}
|
||||
|
||||
private static void addView() {
|
||||
inlineSponsorOverlay = new RelativeLayout(YouTubeApplication.getAppContext());
|
||||
inlineSponsorOverlay = new RelativeLayout(YouTubeTikTokRoot_Application.getAppContext());
|
||||
setLayoutParams(inlineSponsorOverlay);
|
||||
LayoutInflater.from(YouTubeApplication.getAppContext()).inflate(getIdentifier("inline_sponsor_overlay", "layout"), inlineSponsorOverlay);
|
||||
LayoutInflater.from(YouTubeTikTokRoot_Application.getAppContext()).inflate(getIdentifier("inline_sponsor_overlay", "layout"), inlineSponsorOverlay);
|
||||
|
||||
_youtubeOverlaysLayout.addView(inlineSponsorOverlay, _youtubeOverlaysLayout.getChildCount() - 2);
|
||||
|
||||
@ -151,7 +151,7 @@ public class SponsorBlockView {
|
||||
}
|
||||
|
||||
private static int getIdentifier(String name, String defType) {
|
||||
Context context = YouTubeApplication.getAppContext();
|
||||
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||
return context.getResources().getIdentifier(name, defType, context.getPackageName());
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.google.android.apps.youtube.app.YouTubeApplication;
|
||||
import com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
@ -103,7 +103,7 @@ public class ShieldButton {
|
||||
}
|
||||
|
||||
private static void initButtonVisibilitySettings() {
|
||||
Context context = YouTubeApplication.getAppContext();
|
||||
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||
if(context == null){
|
||||
Log.e(TAG, "context is null");
|
||||
SponsorBlockSettings.isSponsorBlockEnabled = false;
|
||||
@ -118,16 +118,16 @@ public class ShieldButton {
|
||||
|
||||
//region Helpers
|
||||
private static int getIdentifier(String name, String defType) {
|
||||
Context context = YouTubeApplication.getAppContext();
|
||||
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||
return context.getResources().getIdentifier(name, defType, context.getPackageName());
|
||||
}
|
||||
|
||||
private static int getInteger(String name) {
|
||||
return YouTubeApplication.getAppContext().getResources().getInteger(getIdentifier(name, "integer"));
|
||||
return YouTubeTikTokRoot_Application.getAppContext().getResources().getInteger(getIdentifier(name, "integer"));
|
||||
}
|
||||
|
||||
private static Animation getAnimation(String name) {
|
||||
return AnimationUtils.loadAnimation(YouTubeApplication.getAppContext(), getIdentifier(name, "anim"));
|
||||
return AnimationUtils.loadAnimation(YouTubeTikTokRoot_Application.getAppContext(), getIdentifier(name, "anim"));
|
||||
}
|
||||
//endregion
|
||||
}
|
||||
|
@ -6,14 +6,11 @@ import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.apps.youtube.app.YouTubeApplication;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import com.google.android.apps.youtube.app.YouTubeTikTokRoot_Application;
|
||||
|
||||
import static fi.vanced.libraries.youtube.sponsors.player.ui.SponsorBlockView.hideSkipButton;
|
||||
import static fi.vanced.libraries.youtube.sponsors.player.ui.SponsorBlockView.showSkipButton;
|
||||
import static pl.jakubweg.PlayerController.VERBOSE;
|
||||
import static pl.jakubweg.StringRef.str;
|
||||
|
||||
@SuppressLint({"RtlHardcoded", "SetTextI18n", "LongLogTag", "AppCompatCustomView"})
|
||||
public class SkipSegmentView {
|
||||
@ -36,7 +33,7 @@ public class SkipSegmentView {
|
||||
}
|
||||
lastNotifiedSegment = segment;
|
||||
String skipMessage = segment.category.skipMessage.toString();
|
||||
Context context = YouTubeApplication.getAppContext();
|
||||
Context context = YouTubeTikTokRoot_Application.getAppContext();
|
||||
if (VERBOSE)
|
||||
Log.d(TAG, String.format("notifySkipped; message=%s", skipMessage));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user