mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-05 17:45:49 +01:00
feat(YouTube): Add Remove viewer discretion dialog
patch
This commit is contained in:
parent
6ca7946e8f
commit
6f3f88264e
@ -0,0 +1,18 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class RemoveViewerDiscretionDialogPatch {
|
||||
public static void confirmDialog(AlertDialog dialog) {
|
||||
if (!SettingsEnum.REMOVE_VIEWER_DISCRETION_DIALOG.getBoolean()) {
|
||||
// Since the patch replaces the AlertDialog#show() method, we need to call the original method here.
|
||||
dialog.show();
|
||||
return;
|
||||
}
|
||||
|
||||
final var button = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
button.setSoundEffectsEnabled(false);
|
||||
button.performClick();
|
||||
}
|
||||
}
|
@ -209,6 +209,8 @@ public enum SettingsEnum {
|
||||
ANNOUNCEMENT_CONSUMER("revanced_announcement_consumer", STRING, ""),
|
||||
ANNOUNCEMENT_LAST_HASH("revanced_announcement_last_hash", STRING, ""),
|
||||
REMOVE_TRACKING_QUERY_PARAMETER("revanced_remove_tracking_query_parameter", BOOLEAN, TRUE),
|
||||
REMOVE_VIEWER_DISCRETION_DIALOG("revanced_remove_viewer_discretion_dialog", BOOLEAN, FALSE,
|
||||
"revanced_remove_viewer_discretion_dialog_user_dialog_message"),
|
||||
|
||||
// Swipe controls
|
||||
SWIPE_BRIGHTNESS("revanced_swipe_brightness", BOOLEAN, TRUE),
|
||||
|
Loading…
Reference in New Issue
Block a user