]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java
Make first-party cookies tab aware.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / helpers / OrbotProxyHelper.java
index 371735455971b5c0c6400191fd22ffcb8490abf8..b41d0999bc568e6d78be883121efdbd70d44b1e0 100644 (file)
@@ -24,8 +24,10 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.net.Proxy;
 import android.content.pm.PackageManager;
 import android.net.Proxy;
+import android.preference.PreferenceManager;
 import android.util.ArrayMap;
 import android.util.Log;
 
 import android.util.ArrayMap;
 import android.util.Log;
 
@@ -116,8 +118,14 @@ public class OrbotProxyHelper {
                 // Use `AlertDialog.Builder` to create the `AlertDialog`.
                 AlertDialog.Builder dialogBuilder;
 
                 // Use `AlertDialog.Builder` to create the `AlertDialog`.
                 AlertDialog.Builder dialogBuilder;
 
+                // Get a handle for the shared preferences.
+                SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(privacyBrowserContext);
+
+                // Get the theme preference.
+                boolean darkTheme = sharedPreferences.getBoolean("dark_theme", false);
+
                 // Set the style according to the theme.
                 // Set the style according to the theme.
-                if (MainWebViewActivity.darkTheme) {
+                if (darkTheme) {
                     dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogDark);
                 } else {
                     dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogLight);
                     dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogDark);
                 } else {
                     dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogLight);