]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/ProxyNotInstalledDialog.kt
First wrong button text in View Headers in night theme. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / ProxyNotInstalledDialog.kt
index a7738e17c610092abde700a80ce139de20db2a02..b799e3d3b3315f333b7a14ca3800afd216a37da5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2019-2023 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
  *
@@ -30,13 +30,11 @@ import androidx.preference.PreferenceManager
 import com.stoutner.privacybrowser.R
 import com.stoutner.privacybrowser.helpers.ProxyHelper
 
-// Define the class constants.
+// Define the private class constants.
 private const val PROXY_MODE = "proxy_mode"
 
 class ProxyNotInstalledDialog : DialogFragment() {
     companion object {
-        // `@JvmStatic` will no longer be required once all the code has transitioned to Kotlin.
-        @JvmStatic
         fun displayDialog(proxyMode: String): ProxyNotInstalledDialog {
             // Create an arguments bundle.
             val argumentsBundle = Bundle()
@@ -62,8 +60,8 @@ class ProxyNotInstalledDialog : DialogFragment() {
         // Use a builder to create the alert dialog.
         val dialogBuilder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog)
 
-        // Set the icon according to the theme.
-        dialogBuilder.setIconAttribute(R.attr.proxyBlueIcon)
+        // Set the icon.
+        dialogBuilder.setIcon(R.drawable.proxy_enabled)
 
         // Set the title and the message according to the proxy mode.
         when (proxyMode) {
@@ -91,7 +89,7 @@ class ProxyNotInstalledDialog : DialogFragment() {
         val alertDialog = dialogBuilder.create()
 
         // Get a handle for the shared preferences.
-        val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
+        val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
 
         // Get the screenshot preference.
         val allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false)