diff --git a/app/src/main/java/app/revanced/integrations/returnyoutubedislike/dialog/Dialogs.java b/app/src/main/java/app/revanced/integrations/returnyoutubedislike/dialog/Dialogs.java deleted file mode 100644 index ae5ec16a..00000000 --- a/app/src/main/java/app/revanced/integrations/returnyoutubedislike/dialog/Dialogs.java +++ /dev/null @@ -1,74 +0,0 @@ -package app.revanced.integrations.returnyoutubedislike.dialog; - -import static app.revanced.integrations.sponsorblock.StringRef.str; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.content.Intent; -import android.graphics.LightingColorFilter; -import android.net.Uri; -import android.os.Build; - -import app.revanced.integrations.settings.SettingsEnum; -import app.revanced.integrations.utils.ReVancedUtils; - -public class Dialogs { - // Inject call from YT to this - public static void showDialogsAtStartup(Activity activity) { - rydFirstRun(activity); - } - - private static void rydFirstRun(Activity activity) { - boolean enabled = SettingsEnum.RYD_ENABLED.getBoolean(); - boolean hintShown = SettingsEnum.RYD_HINT_SHOWN.getBoolean(); - - // If RYD is enabled or hint has been shown, exit - if (enabled || hintShown) { - // If RYD is enabled but hint hasn't been shown, mark it as shown - if (enabled && !hintShown) { - SettingsEnum.RYD_HINT_SHOWN.saveValue(true); - } - return; - } - - AlertDialog.Builder builder; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert); - } else { - builder = new AlertDialog.Builder(activity); - } - builder.setTitle(str("revanced_ryd")); - builder.setIcon(ReVancedUtils.getIdentifier("reel_dislike_icon", "drawable")); - builder.setCancelable(false); - builder.setMessage(str("revanced_ryd_firstrun")); - builder.setPositiveButton(str("revanced_enable"), - (dialog, id) -> { - SettingsEnum.RYD_HINT_SHOWN.saveValue(true); - SettingsEnum.RYD_ENABLED.saveValue(true); - dialog.dismiss(); - }); - - builder.setNegativeButton(str("revanced_disable"), - (dialog, id) -> { - SettingsEnum.RYD_HINT_SHOWN.saveValue(true); - SettingsEnum.RYD_ENABLED.saveValue(false); - dialog.dismiss(); - }); - - builder.setNeutralButton(str("revanced_learnmore"), null); - - AlertDialog dialog = builder.create(); - dialog.show(); - - // Set black background - dialog.getWindow().getDecorView().getBackground().setColorFilter(new LightingColorFilter(0xFF000000, ReVancedUtils.getIdentifier("ytBrandBackgroundSolid", "color"))); - - // Set learn more action (set here so clicking it doesn't dismiss the dialog) - dialog.getButton(DialogInterface.BUTTON_NEUTRAL).setOnClickListener(v -> { - Uri uri = Uri.parse("https://www.returnyoutubedislike.com/"); - Intent intent = new Intent(Intent.ACTION_VIEW, uri); - activity.startActivity(intent); - }); - } -} diff --git a/app/src/main/java/app/revanced/integrations/settingsmenu/ReturnYouTubeDislikeSettingsFragment.java b/app/src/main/java/app/revanced/integrations/settingsmenu/ReturnYouTubeDislikeSettingsFragment.java index 097e2e1f..611a686d 100644 --- a/app/src/main/java/app/revanced/integrations/settingsmenu/ReturnYouTubeDislikeSettingsFragment.java +++ b/app/src/main/java/app/revanced/integrations/settingsmenu/ReturnYouTubeDislikeSettingsFragment.java @@ -44,18 +44,6 @@ public class ReturnYouTubeDislikeSettingsFragment extends PreferenceFragment { }); } - // Clear hint - if (SettingsEnum.DEBUG.getBoolean()) { - SwitchPreference preference = new SwitchPreference(context); - preferenceScreen.addPreference(preference); - preference.setKey(SettingsEnum.RYD_HINT_SHOWN.getPath()); - preference.setDefaultValue(false); - preference.setChecked(SettingsEnum.RYD_HINT_SHOWN.getBoolean()); - preference.setTitle("Hint debug"); - preference.setSummary("Debug toggle for clearing the hint shown preference"); - preference.setOnPreferenceChangeListener((pref, newValue) -> true); - } - // About category addAboutCategory(context, preferenceScreen); } diff --git a/app/src/main/java/app/revanced/integrations/settingsmenu/SponsorBlockSettingsFragment.java b/app/src/main/java/app/revanced/integrations/settingsmenu/SponsorBlockSettingsFragment.java index c63dfaf3..75fcb6e0 100644 --- a/app/src/main/java/app/revanced/integrations/settingsmenu/SponsorBlockSettingsFragment.java +++ b/app/src/main/java/app/revanced/integrations/settingsmenu/SponsorBlockSettingsFragment.java @@ -70,18 +70,6 @@ public class SponsorBlockSettingsFragment extends PreferenceFragment implements }); } - // Clear hint - if (SettingsEnum.DEBUG.getBoolean()) { - SwitchPreference preference = new SwitchPreference(context); - preferenceScreen.addPreference(preference); - preference.setKey(SettingsEnum.SB_SPONSOR_BLOCK_HINT_SHOWN.getPath()); - preference.setDefaultValue(false); - preference.setChecked(SettingsEnum.SB_SPONSOR_BLOCK_HINT_SHOWN.getBoolean()); - preference.setTitle("Hint debug"); - preference.setSummary("Debug toggle for clearing the hint shown preference"); - preference.setOnPreferenceChangeListener((pref, newValue) -> true); - } - { SwitchPreference preference = new SwitchPreference(context); preferenceScreen.addPreference(preference); diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/dialog/Dialogs.java b/app/src/main/java/app/revanced/integrations/sponsorblock/dialog/Dialogs.java deleted file mode 100644 index b9ad4202..00000000 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/dialog/Dialogs.java +++ /dev/null @@ -1,76 +0,0 @@ -package app.revanced.integrations.sponsorblock.dialog; - -import static app.revanced.integrations.sponsorblock.StringRef.str; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.graphics.LightingColorFilter; -import android.net.Uri; -import android.os.Build; - -import app.revanced.integrations.settings.SettingsEnum; -import app.revanced.integrations.utils.ReVancedUtils; - -public class Dialogs { - // Inject call from YT to this - public static void showDialogsAtStartup(Activity activity) { - sbFirstRun(activity); - } - - private static void sbFirstRun(Activity activity) { - Context context = ReVancedUtils.getContext(); - boolean enabled = SettingsEnum.SB_ENABLED.getBoolean(); - boolean hintShown = SettingsEnum.SB_SPONSOR_BLOCK_HINT_SHOWN.getBoolean(); - - // If SB is enabled or hint has been shown, exit - if (enabled || hintShown) { - // If SB is enabled but hint hasn't been shown, mark it as shown - if (enabled && !hintShown) { - SettingsEnum.SB_SPONSOR_BLOCK_HINT_SHOWN.saveValue(true); - } - return; - } - - AlertDialog.Builder builder; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert); - } else { - builder = new AlertDialog.Builder(activity); - } - builder.setTitle(str("vanced_sb")); - builder.setIcon(ReVancedUtils.getIdentifier("ic_sb_logo", "drawable")); - builder.setCancelable(false); - builder.setMessage(str("vanced_sb_firstrun")); - builder.setPositiveButton(str("vanced_enable"), - (dialog, id) -> { - SettingsEnum.SB_SPONSOR_BLOCK_HINT_SHOWN.saveValue(true); - SettingsEnum.SB_ENABLED.saveValue(true); - dialog.dismiss(); - }); - - builder.setNegativeButton(str("vanced_disable"), - (dialog, id) -> { - SettingsEnum.SB_SPONSOR_BLOCK_HINT_SHOWN.saveValue(true); - SettingsEnum.SB_ENABLED.saveValue(false); - dialog.dismiss(); - }); - - builder.setNeutralButton(str("vanced_learnmore"), null); - - AlertDialog dialog = builder.create(); - dialog.show(); - - // Set black background - dialog.getWindow().getDecorView().getBackground().setColorFilter(new LightingColorFilter(0xFF000000, ReVancedUtils.getIdentifier("ytBrandBackgroundSolid", "color"))); - - // Set learn more action (set here so clicking it doesn't dismiss the dialog) - dialog.getButton(DialogInterface.BUTTON_NEUTRAL).setOnClickListener(v -> { - Uri uri = Uri.parse("https://sponsor.ajay.app/"); - Intent intent = new Intent(Intent.ACTION_VIEW, uri); - activity.startActivity(intent); - }); - } -}