- AlertDialog.Builder dialogBuilder;
-
- // Get a handle for the shared preferences.
- SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
-
- // Get the screenshot and theme preferences.
- boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
- boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
-
- // Set the style according to the theme.
- if (darkTheme) {
- // Set the dialog theme.
- dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
- } else {
- // Set the dialog theme.
- dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
- }