From d0caaaeacc3641eeffca10443743b0bfff925c0d Mon Sep 17 00:00:00 2001 From: caneleex Date: Mon, 19 Apr 2021 23:26:16 +0200 Subject: [PATCH] rename YouTubeApplication --- ...ication.java => YouTubeTikTokRoot_Application.java} | 2 +- .../youtube/sponsors/player/ui/SponsorBlockView.java | 8 ++++---- app/src/main/java/pl/jakubweg/ShieldButton.java | 10 +++++----- app/src/main/java/pl/jakubweg/SkipSegmentView.java | 7 ++----- 4 files changed, 12 insertions(+), 15 deletions(-) rename app/src/main/java/com/google/android/apps/youtube/app/{YouTubeApplication.java => YouTubeTikTokRoot_Application.java} (81%) diff --git a/app/src/main/java/com/google/android/apps/youtube/app/YouTubeApplication.java b/app/src/main/java/com/google/android/apps/youtube/app/YouTubeTikTokRoot_Application.java similarity index 81% rename from app/src/main/java/com/google/android/apps/youtube/app/YouTubeApplication.java rename to app/src/main/java/com/google/android/apps/youtube/app/YouTubeTikTokRoot_Application.java index ef8400e4..2c321f2a 100644 --- a/app/src/main/java/com/google/android/apps/youtube/app/YouTubeApplication.java +++ b/app/src/main/java/com/google/android/apps/youtube/app/YouTubeTikTokRoot_Application.java @@ -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(); } diff --git a/app/src/main/java/fi/vanced/libraries/youtube/sponsors/player/ui/SponsorBlockView.java b/app/src/main/java/fi/vanced/libraries/youtube/sponsors/player/ui/SponsorBlockView.java index af1d011f..86e2c932 100644 --- a/app/src/main/java/fi/vanced/libraries/youtube/sponsors/player/ui/SponsorBlockView.java +++ b/app/src/main/java/fi/vanced/libraries/youtube/sponsors/player/ui/SponsorBlockView.java @@ -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()); } } diff --git a/app/src/main/java/pl/jakubweg/ShieldButton.java b/app/src/main/java/pl/jakubweg/ShieldButton.java index fb9e7c3f..eeadc584 100644 --- a/app/src/main/java/pl/jakubweg/ShieldButton.java +++ b/app/src/main/java/pl/jakubweg/ShieldButton.java @@ -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 } diff --git a/app/src/main/java/pl/jakubweg/SkipSegmentView.java b/app/src/main/java/pl/jakubweg/SkipSegmentView.java index cd1a891b..5e2a485e 100644 --- a/app/src/main/java/pl/jakubweg/SkipSegmentView.java +++ b/app/src/main/java/pl/jakubweg/SkipSegmentView.java @@ -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));