X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fhelpers%2FOrbotProxyHelper.java;fp=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fhelpers%2FOrbotProxyHelper.java;h=ef49afe1f9fc331da9f160050460aff800451ba7;hp=2e1b22b692f6fb79b75cdcd80917da76662f8cf2;hb=5bcf4ca90f27512b94fb7aca4fad37b4e4774655;hpb=74857298f431569df1849e8ef91387cb25274095 diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java index 2e1b22b6..ef49afe1 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/OrbotProxyHelper.java @@ -95,9 +95,20 @@ public class OrbotProxyHelper { privacyBrowserContext.sendBroadcast(orbotIntent); } } catch (PackageManager.NameNotFoundException exception){ // If an exception is thrown, Orbot is not installed. - // Build an `AlertDialog`. `R.style.LightAlertDialog` formats the color of the button text. - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.LightAlertDialog); + // Use `AlertDialog.Builder` to create the `AlertDialog`. + AlertDialog.Builder dialogBuilder; + + // Set the style according to the theme. + if (MainWebViewActivity.darkTheme) { + dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogDark); + } else { + dialogBuilder = new AlertDialog.Builder(parentActivity, R.style.PrivacyBrowserAlertDialogLight); + } + + // Set the message. dialogBuilder.setMessage(R.string.orbot_proxy_not_installed); + + // Set the positive button. dialogBuilder.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -105,8 +116,10 @@ public class OrbotProxyHelper { } }); - // Convert `dialogBuilder` to `alertDialog` and display it on the screen. + // Convert `dialogBuilder` to `alertDialog`. AlertDialog alertDialog = dialogBuilder.create(); + + // Make it so. alertDialog.show(); } }