diff --git a/app/src/debug/java/org/schabi/newpipe/settings/DebugSettingsFragment.java b/app/src/debug/java/org/schabi/newpipe/settings/DebugSettingsFragment.java
index 55b2c7708..f48be553f 100644
--- a/app/src/debug/java/org/schabi/newpipe/settings/DebugSettingsFragment.java
+++ b/app/src/debug/java/org/schabi/newpipe/settings/DebugSettingsFragment.java
@@ -5,6 +5,9 @@ import android.os.Bundle;
import androidx.preference.Preference;
import org.schabi.newpipe.R;
+import org.schabi.newpipe.error.ErrorInfo;
+import org.schabi.newpipe.error.ErrorUtil;
+import org.schabi.newpipe.error.UserAction;
import org.schabi.newpipe.util.PicassoHelper;
import leakcanary.LeakCanary;
@@ -20,10 +23,16 @@ public class DebugSettingsFragment extends BasePreferenceFragment {
= findPreference(getString(R.string.show_image_indicators_key));
final Preference crashTheAppPreference
= findPreference(getString(R.string.crash_the_app_key));
+ final Preference showErrorSnackbarPreference
+ = findPreference(getString(R.string.show_error_snackbar_key));
+ final Preference createErrorNotificationPreference
+ = findPreference(getString(R.string.create_error_notification_key));
assert showMemoryLeaksPreference != null;
assert showImageIndicatorsPreference != null;
assert crashTheAppPreference != null;
+ assert showErrorSnackbarPreference != null;
+ assert createErrorNotificationPreference != null;
showMemoryLeaksPreference.setOnPreferenceClickListener(preference -> {
startActivity(LeakCanary.INSTANCE.newLeakDisplayActivityIntent());
@@ -38,5 +47,17 @@ public class DebugSettingsFragment extends BasePreferenceFragment {
crashTheAppPreference.setOnPreferenceClickListener(preference -> {
throw new RuntimeException();
});
+
+ showErrorSnackbarPreference.setOnPreferenceClickListener(preference -> {
+ ErrorUtil.showUiErrorSnackbar(DebugSettingsFragment.this,
+ "Dummy", new RuntimeException("Dummy"));
+ return true;
+ });
+
+ createErrorNotificationPreference.setOnPreferenceClickListener(preference -> {
+ ErrorUtil.createNotification(requireContext(),
+ new ErrorInfo(new RuntimeException("Dummy"), UserAction.UI_ERROR, "Dummy"));
+ return true;
+ });
}
}
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index b88b2d064..b6f76fce2 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -186,9 +186,11 @@
allow_disposed_exceptions_key
show_original_time_ago_key
disable_media_tunneling_key
- crash_the_app_key
show_image_indicators_key
show_crash_the_player_key
+ crash_the_app_key
+ show_error_snackbar_key
+ create_error_notification_key
theme
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3319d5fb9..4acd04d27 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -477,9 +477,11 @@
Disable media tunneling if you experience a black screen or stuttering on video playback
Show image indicators
Show Picasso colored ribbons on top of images indicating their source: red for network, blue for disk and green for memory
- Crash the app
Show \"crash the player\"
Shows a crash option when using the player
+ Crash the app
+ Show an error snackbar
+ Create an error notification
Import
Import from
diff --git a/app/src/main/res/xml/debug_settings.xml b/app/src/main/res/xml/debug_settings.xml
index df1559c37..0052125a2 100644
--- a/app/src/main/res/xml/debug_settings.xml
+++ b/app/src/main/res/xml/debug_settings.xml
@@ -49,18 +49,28 @@
android:title="@string/show_image_indicators_title"
app:iconSpaceReserved="false" />
+
+
-
+
+