]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt
Release 3.8.1.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / SaveDialog.kt
index 312ebd05936fa52f50124f7fc075ae58cb3017a8..78eacc1593f6690bdb2b5efcdfea4df051f9ffe6 100644 (file)
@@ -24,7 +24,6 @@ import android.app.Dialog
 import android.content.Context
 import android.content.DialogInterface
 import android.content.Intent
-import android.content.res.Configuration
 import android.os.Bundle
 import android.text.Editable
 import android.text.TextWatcher
@@ -94,9 +93,6 @@ class SaveDialog : DialogFragment() {
         // Use an alert dialog builder to create the alert dialog.
         val dialogBuilder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog)
 
-        // Get the current theme status.
-        val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
-
         // Set the title and the icon according to the save type.
         when (saveType) {
             SAVE_LOGCAT -> {
@@ -104,11 +100,7 @@ class SaveDialog : DialogFragment() {
                 dialogBuilder.setTitle(R.string.save_logcat)
 
                 // Set the icon according to the theme.
-                if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
-                    dialogBuilder.setIcon(R.drawable.save_dialog_day)
-                } else {
-                    dialogBuilder.setIcon(R.drawable.save_dialog_night)
-                }
+                dialogBuilder.setIconAttribute(R.attr.saveBlueIcon)
             }
 
             SAVE_ABOUT_VERSION_TEXT -> {
@@ -116,11 +108,7 @@ class SaveDialog : DialogFragment() {
                 dialogBuilder.setTitle(R.string.save_text)
 
                 // Set the icon according to the theme.
-                if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
-                    dialogBuilder.setIcon(R.drawable.save_text_blue_day)
-                } else {
-                    dialogBuilder.setIcon(R.drawable.save_text_blue_night)
-                }
+                dialogBuilder.setIconAttribute(R.attr.saveTextBlueIcon)
             }
 
             SAVE_ABOUT_VERSION_IMAGE -> {
@@ -128,11 +116,7 @@ class SaveDialog : DialogFragment() {
                 dialogBuilder.setTitle(R.string.save_image)
 
                 // Set the icon according to the theme.
-                if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
-                    dialogBuilder.setIcon(R.drawable.images_enabled_day)
-                } else {
-                    dialogBuilder.setIcon(R.drawable.images_enabled_night)
-                }
+                dialogBuilder.setIconAttribute(R.attr.imagesBlueIcon)
             }
         }