import android.app.Activity
import android.app.Dialog
import android.content.DialogInterface
import android.app.Activity
import android.app.Dialog
import android.content.DialogInterface
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
// Get the variables from the bundle.
val primaryErrorInt = requireArguments().getInt(PRIMARY_ERROR_INT)
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
// Get the variables from the bundle.
val primaryErrorInt = requireArguments().getInt(PRIMARY_ERROR_INT)
val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
// Set the icon according to the theme.
val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
// Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- dialogBuilder.setIcon(R.drawable.ssl_certificate_enabled_day)
- } else {
- dialogBuilder.setIcon(R.drawable.ssl_certificate_enabled_night)
- }
+ dialogBuilder.setIconAttribute(R.attr.sslCertificateBlueIcon)
dialogBuilder.setNegativeButton(R.string.cancel) { _: DialogInterface?, _: Int ->
// Check to make sure the SSL error handler is not null. This might happen if multiple dialogs are displayed at once.
if (sslErrorHandler != null) {
dialogBuilder.setNegativeButton(R.string.cancel) { _: DialogInterface?, _: Int ->
// Check to make sure the SSL error handler is not null. This might happen if multiple dialogs are displayed at once.
if (sslErrorHandler != null) {
dialogBuilder.setPositiveButton(R.string.proceed) { _: DialogInterface?, _: Int ->
// Check to make sure the SSL error handler is not null. This might happen if multiple dialogs are displayed at once.
if (sslErrorHandler != null) {
dialogBuilder.setPositiveButton(R.string.proceed) { _: DialogInterface?, _: Int ->
// Check to make sure the SSL error handler is not null. This might happen if multiple dialogs are displayed at once.
if (sslErrorHandler != null) {