]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt
Combine the light and dark Guide and About pages. https://redmine.stoutner.com/issue...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / FontSizeDialog.kt
index 75ef4e4517a88caa2bd9840e8097ae0db82d428d..c8f3de8984a5c7b82ad4b5cd7988b2e694d65555 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with Privacy Browser.  If not, see <http://www.gnu.org/licenses/>.
  */
+
 package com.stoutner.privacybrowser.dialogs
 
 import android.annotation.SuppressLint
 import android.app.Dialog
 import android.content.Context
 import android.content.DialogInterface
-import android.content.res.Configuration
+
 import android.os.Bundle
 import android.view.KeyEvent
 import android.view.View
@@ -85,15 +86,8 @@ class FontSizeDialog: DialogFragment() {
         // Use a 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 icon according to the theme.
-        if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
-            dialogBuilder.setIcon(R.drawable.font_size_day)
-        } else {
-            dialogBuilder.setIcon(R.drawable.font_size_night)
-        }
+        dialogBuilder.setIconAttribute(R.attr.fontSizeBlueIcon)
 
         // Set the title.
         dialogBuilder.setTitle(R.string.font_size)