]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt
Change the night access color to light violet. https://redmine.stoutner.com/issues/572
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / AddDomainDialog.kt
index 527e0d7d031996f66b9e3a5a7de439158f462368..e26b64443b79517b3b3923041c35eae94a7330d4 100644 (file)
@@ -23,7 +23,6 @@ import android.annotation.SuppressLint
 import android.app.Dialog
 import android.content.Context
 import android.content.DialogInterface
-import android.content.res.Configuration
 import android.net.Uri
 import android.os.Bundle
 import android.text.Editable
@@ -91,17 +90,8 @@ class AddDomainDialog: DialogFragment() {
         // Use an alert dialog builder to create the alert dialog.
         val dialogBuilder: AlertDialog.Builder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog)
 
-        // Get the current theme status.
-        val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
-
         // Set the icon according to the theme.
-        if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
-            // Set the dark icon.
-            dialogBuilder.setIcon(R.drawable.domains_night)
-        } else {
-            // Set the light icon.
-            dialogBuilder.setIcon(R.drawable.domains_light)
-        }
+        dialogBuilder.setIconAttribute(R.attr.domainsIcon)
 
         // Set the title.
         dialogBuilder.setTitle(R.string.add_domain)