X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fdialogs%2FSslCertificateErrorDialog.java;h=3a68a6169fc3d82394018be1f7038a38624df2e8;hp=4b075d3b81924f220833598e31acaa8ac6dcf457;hb=b82022327701273b1b56419e8d6042895c0bc7b9;hpb=0488649384ddea89d768c1fc1cc5fb71f8af6528 diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java index 4b075d3b..3a68a616 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java @@ -264,12 +264,12 @@ public class SslCertificateErrorDialog extends DialogFragment { ForegroundColorSpan redColorSpan; // Set the color spans according to the theme. The deprecated `getResources()` must be used until the minimum API >= 23. - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) { - blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.violet_500)); - redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_900)); - } else { + if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700)); redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700)); + } else { + blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.violet_500)); + redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_900)); } // Setup the spans to display the certificate information in blue. `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction. @@ -403,16 +403,14 @@ public class SslCertificateErrorDialog extends DialogFragment { // Add each IP address to the string builder. for (InetAddress inetAddress : inetAddressesArray) { - if (ipAddresses.length() == 0) { // This is the first IP address. - // Add the IP Address to the string builder. - ipAddresses.append(inetAddress.getHostAddress()); - } else { // This is not the first IP address. + // Check to see if this is not the first IP address. + if (ipAddresses.length() > 0) { // Add a line break to the string builder first. ipAddresses.append("\n"); - - // Add the IP address to the string builder. - ipAddresses.append(inetAddress.getHostAddress()); } + + // Add the IP Address to the string builder. + ipAddresses.append(inetAddress.getHostAddress()); } } catch (UnknownHostException exception) { // Do nothing.