mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-11-30 15:52:55 +01:00
fix(youtube/settings): fix dialog not shown if dismissed with back button
This commit is contained in:
parent
a0ad968aaa
commit
584de16236
@ -32,7 +32,7 @@ public class ReVancedSettingsFragment extends PreferenceFragment {
|
||||
/**
|
||||
* If a dialog is currently being shown. Used to prevent showing additional dialogs if user cancels a dialog.
|
||||
*/
|
||||
private static boolean currentlyShowingDialog;
|
||||
private boolean currentlyShowingDialog;
|
||||
|
||||
SharedPreferences.OnSharedPreferenceChangeListener listener = (sharedPreferences, str) -> {
|
||||
try {
|
||||
@ -136,6 +136,9 @@ public class ReVancedSettingsFragment extends PreferenceFragment {
|
||||
})
|
||||
.setNegativeButton(negativeButton, (dialog, id) -> {
|
||||
currentlyShowingDialog = false;
|
||||
})
|
||||
.setOnDismissListener((dialog) -> {
|
||||
currentlyShowingDialog = false;
|
||||
}).show();
|
||||
}
|
||||
|
||||
@ -156,7 +159,9 @@ public class ReVancedSettingsFragment extends PreferenceFragment {
|
||||
SettingsEnum.setValue(setting, defaultBooleanValue);
|
||||
switchPref.setChecked(defaultBooleanValue);
|
||||
currentlyShowingDialog = false;
|
||||
})
|
||||
.setOnDismissListener((dialog) -> {
|
||||
currentlyShowingDialog = false;
|
||||
}).show();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user