mirror of
https://github.com/revanced/revanced-integrations.git
synced 2025-01-21 01:07:32 +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.
|
* 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) -> {
|
SharedPreferences.OnSharedPreferenceChangeListener listener = (sharedPreferences, str) -> {
|
||||||
try {
|
try {
|
||||||
@ -136,6 +136,9 @@ public class ReVancedSettingsFragment extends PreferenceFragment {
|
|||||||
})
|
})
|
||||||
.setNegativeButton(negativeButton, (dialog, id) -> {
|
.setNegativeButton(negativeButton, (dialog, id) -> {
|
||||||
currentlyShowingDialog = false;
|
currentlyShowingDialog = false;
|
||||||
|
})
|
||||||
|
.setOnDismissListener((dialog) -> {
|
||||||
|
currentlyShowingDialog = false;
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +159,9 @@ public class ReVancedSettingsFragment extends PreferenceFragment {
|
|||||||
SettingsEnum.setValue(setting, defaultBooleanValue);
|
SettingsEnum.setValue(setting, defaultBooleanValue);
|
||||||
switchPref.setChecked(defaultBooleanValue);
|
switchPref.setChecked(defaultBooleanValue);
|
||||||
currentlyShowingDialog = false;
|
currentlyShowingDialog = false;
|
||||||
|
})
|
||||||
|
.setOnDismissListener((dialog) -> {
|
||||||
|
currentlyShowingDialog = false;
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user