]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java
Finish creating the bookmark drawer. https://redmine.stoutner.com/issues/132
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / SslCertificateErrorDialog.java
index f0d5a69f860846f963b4162eb72e06107713740f..00a3b1f915ecb3464d8970c48923e6f5627ada77 100644 (file)
@@ -28,7 +28,7 @@ import android.net.http.SslCertificate;
 import android.net.http.SslError;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
-// We have to use `AppCompatDialogFragment` instead of `DialogFragment` or an error is produced on API <= 22.
+// `AppCompatDialogFragment` is used instead of `DialogFragment` to avoid an error on API <=22.
 import android.support.v7.app.AppCompatDialogFragment;
 import android.text.SpannableStringBuilder;
 import android.text.Spanned;
@@ -44,6 +44,7 @@ import java.util.Date;
 
 public class SslCertificateErrorDialog extends AppCompatDialogFragment {
 
+    // The private variables are used in `onCreate()` and `onCreateDialog()`.
     private int primaryErrorInt;
     private String urlWithError;
     private String issuedToCName;
@@ -138,11 +139,19 @@ public class SslCertificateErrorDialog extends AppCompatDialogFragment {
         // Use `AlertDialog.Builder` to create the `AlertDialog`.
         AlertDialog.Builder dialogBuilder;
 
-        // Set the style according to the theme.
+        // Set the style and icon according to the theme.
         if (MainWebViewActivity.darkTheme) {
+            // Set the style.
             dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogDark);
+
+            // Set the icon.
+            dialogBuilder.setIcon(R.drawable.ssl_certificate_enabled_dark);
         } else {
+            // Set the style.
             dialogBuilder = new AlertDialog.Builder(getActivity(), R.style.PrivacyBrowserAlertDialogLight);
+
+            // Set the icon.
+            dialogBuilder.setIcon(R.drawable.ssl_certificate_enabled_light);
         }
 
         // Set the title.