]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Add Night Theme dual tone blue text. https://redmine.stoutner.com/issues/878
authorSoren Stoutner <soren@stoutner.com>
Sat, 23 Jul 2022 00:06:22 +0000 (17:06 -0700)
committerSoren Stoutner <soren@stoutner.com>
Sat, 23 Jul 2022 00:06:22 +0000 (17:06 -0700)
36 files changed:
app/src/main/assets/de/about_licenses.html
app/src/main/assets/de/guide_local_storage.html
app/src/main/assets/de/guide_tracking_ids.html
app/src/main/assets/en/about_licenses.html
app/src/main/assets/es/about_licenses.html
app/src/main/assets/fr/about_licenses.html
app/src/main/assets/it/about_licenses.html
app/src/main/assets/pt-rBR/about_licenses.html
app/src/main/assets/ru/about_licenses.html
app/src/main/assets/shared_images/disabled_by_default.svg [new file with mode: 0644]
app/src/main/assets/tr/about_licenses.html
app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java
app/src/main/java/com/stoutner/privacybrowser/adapters/PinnedMismatchPagerAdapter.kt
app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.kt
app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.kt
app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt
app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java
app/src/main/java/com/stoutner/privacybrowser/helpers/DomainsDatabaseHelper.kt
app/src/main/res/color/blue_icon_selector.xml [new file with mode: 0644]
app/src/main/res/layout/about_version_scrollview.xml
app/src/main/res/layout/domain_settings_fragment.xml
app/src/main/res/layout/pinned_mismatch_tab_linearlayout.xml
app/src/main/res/layout/ssl_certificate_error.xml
app/src/main/res/layout/view_request_dialog.xml
app/src/main/res/layout/view_source_bottom_appbar.xml
app/src/main/res/layout/view_source_top_appbar.xml
app/src/main/res/layout/view_ssl_certificate_dialog.xml
app/src/main/res/values-night-v27/styles.xml
app/src/main/res/values-night/colors.xml
app/src/main/res/values-night/styles.xml
app/src/main/res/values-v27/styles.xml
app/src/main/res/values/attrs.xml
app/src/main/res/values/colors.xml
app/src/main/res/values/strings.xml
app/src/main/res/values/styles.xml
app/src/main/res/xml/preferences.xml

index db8f873cd54e34f98793a458e111ead1ba29a86c..c5944fe2b38f8b5ce46689e823c1b61d9c162d74 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index 434b5c491fdc0b47e47ebcf17dc81b5cd7458ef0..4161bfe8316cbd0193207659a3574b5bd985a186 100644 (file)
@@ -1,7 +1,7 @@
 <!--
   Copyright © 2016-2018,2020-2022 Soren Stoutner <soren@stoutner.com>.
 
-  Translation 2019,2021 Bernhard G. Keller.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
+  Translation 2019,2021-2022 Bernhard G. Keller.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
 
   Translation 2016 Aaron Gerlach <aaron@gerlach.com>.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
 
             Durch die Nutzung von Cookies stellen diese Internet-Seiten sicher, daß es sich um denselben angemeldeten Benutzer handelt, der von Seite zu Seite innerhalb einer Website navigiert.
             Dies ist vermutlich die einzige legitime Nutzung von Cookies.</p>
 
-        <p>Android's System WebView treats cookies as an app level setting, meaning that cookies are either on or off for all tabs in Privacy Browser.
-            The result is that the cookies setting for whatever tab is currently displayed controls the cookies setting for all the background tabs as well.
-            If you have a tab in that background that has cookies enabled so that you can be logged into a website, and switch to a tab that doesn't have cookies enabled, it disabled cookies for all the tabs.
-            If the background tab makes a request, for example, to see if there is updated information, that request will be sent without cookies, which will cause the website to log you out.
-            This is a limitation that will be removed with the release of <a href="https://www.stoutner.com/category/privacy-browser-android-roadmap/">Privacy WebView</a> in the 4.x series.</p>
+        <p>Die Android-System-Komponente WebView behandelt Cookies auf App-Ebene, d.h. Cookies können grundsätzlich nur für alle Privacy-Browser-Tabs ein- oder ausgeschaltet werden.
+            Daher gelten die Einstellungen des aktuell angezeigten Tabs auch für alle im Hintergrund geöffneten Tabs.
+            Wurden Cookies für einen Hintergrund-Tab aktiviert, um an einer Website angemeldet zu bleiben, und sie wechseln zu einem Tab, für den Cookies deaktivert wurden,
+            werden Cookies auch für alle anderen Tabs deaktiviert.
+            Stellt der Hintergrund-Tab in dieser Situation eine Anfrage an den Server, um z.B. Daten zu aktualisieren, wird diese Anfrage ohne Cookies gesendet,
+            wodurch sie ggf. von der Website abgemeldet werden.
+            Diese Einschränkung wird mit <a href="https://www.stoutner.com/category/privacy-browser-android-roadmap/">Privacy WebView</a> in den Versionen 4.x von Privacy Browser behoben werden.</p>
 
         <p>Wenn Cookies aktiviert sind, aber JavaScript deaktiviert ist, wird das Privatsphären-Icon <img class="inline" src="../shared_images/warning.svg"> zur Warnung in gelb dargestellt.</p>
 
             Daher erscheinen Formulardaten auf neueren Android-Geräten nicht mehr.</p>
 
 
-        <h3><svg class="header"><use href="../shared_images/delete_forever.svg#icon"/></svg> Clear and Exit</h3>
+        <h3><svg class="header"><use href="../shared_images/delete_forever.svg#icon"/></svg> Bereinigen und Schließen</h3>
 
-        <p>Clear and Exit runs every time the last tab is closed or Clear and Exit is selected from the navigation menu.
-            By default it clears the cookies, DOM storage, form data, the logcat, and the WebView cache. Then it manually deletes the entire <code>app_webview</code> and <code>cache</code> directories.
-            The behavior of Clear and Exit can be configured in the settings.</p>
+        <p>Bereinigen und Schließen wird immer durchgeführt, wenn der letzte Tab geschlossen oder der entsprechende Menüpunkt im Navigations-Menü ausgewählt wird.
+            Standardmäßig werden dabei Cookies, der DOM-Speicher, Formulardaten, logcat-Logs und der WebView-Cache bereinigt bzw. gelöscht,
+            danach werden alle <code>App-WebView-</code> und <code>Cache-</code> Verzeichnisse gelöscht.
+            Das Verhalten von "Bereinigen und Schließen" kann in den Einstellungen konfiguriert werden.</p>
     </body>
 </html>
\ No newline at end of file
index 845bea815be3800559ca2b7e747baca67699e6a8..aabfb79607d9c8eeff085e87cb5ede1ceb2990b1 100644 (file)
@@ -1,7 +1,7 @@
 <!--
   Copyright © 2016-2022 Soren Stoutner <soren@stoutner.com>.
 
-  Translation 2019,2021 Bernhard G. Keller.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
+  Translation 2019,2021-2022 Bernhard G. Keller.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
 
   Translation 2016 Aaron Gerlach <aaron@gerlach.com>.  Copyright assigned to Soren Stoutner <soren@stoutner.com>.
 
@@ -44,8 +44,9 @@
 
         <h3><svg class="header"><use href="../shared_images/link_off.svg#icon"/></svg> URL-Bereinigung</h3>
 
-        <p>Privacy Browser removes tracking IDs and AMP (<a href="https://en.wikipedia.org/wiki/Accelerated_Mobile_Pages">Accelerated Mobile Pages</a>) redirects from URL queries.
-            There is a blog post that is updated with the <a href="https://www.stoutner.com/url-modification/">current list</a> of modifications.
-            URL modification can be turned off in the settings if it is causing issues.</p>
+        <p>Um ihre Privatsphäre zu schützen entfernt Privacy Browser Tracking-IDs und AMP- (<a href="https://en.wikipedia.org/wiki/Accelerated_Mobile_Pages">Accelerated Mobile Pages</a>)
+            Redirects aus URL-Anfragen (Queries).
+            Eine Liste der aktuellen URL-Modifikationen kann einem <a href="https://www.stoutner.com/url-modification/">Blog-Post</a> entnommen werden.
+            Die URL-Modifikationen können in den Einstellungen deaktiviert werden, sollten sie Probleme bereiten.</p>
     </body>
 </html>
\ No newline at end of file
index 0cf851b4782b5df61d8e33b4105a2223b005867a..17cfd23956aff00641207cc6d1b1c0af2345d1d6 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index 94146f9133f955c8821b581df0ea34fbff8cfbe8..407a5c39b4766a7d3336a6bfb0ad51003b28ef8c 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index 6a50d3352bb26a07148db03b0d6685eb29d2acf6..94cd1c97ae48970dcd6ec65fc1e5ef2ecdcc0e05 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index e14c2883f5ee1c6bcf00a351140582870c99d3d6..3e5c15f63c8c6fbd49cb4f4319cdc1b7e1518793 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index 205ce0fbf3e5793c3f12ed6a6290203c722d02e4..191154138cc733f065a2931b816b3d65121a96e1 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index bad1061f923f7e6481ccea53bf7dc81496c9e43c..82c0f585a2dc2fc8dd7b7110b8ba25175c66b5d8 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
diff --git a/app/src/main/assets/shared_images/disabled_by_default.svg b/app/src/main/assets/shared_images/disabled_by_default.svg
new file mode 100644 (file)
index 0000000..5f80695
--- /dev/null
@@ -0,0 +1,28 @@
+<!--
+  Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+  It is a modified version of `devices_other`, which is part of the Android Material icon set and is released under the Apache License 2.0.
+
+  Privacy Browser is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  Privacy Browser is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with Privacy Browser.  If not, see <http://www.gnu.org/licenses/>. -->
+
+<svg
+  xmlns="http://www.w3.org/2000/svg"
+  viewBox="0 0 24 24"
+  id="icon" >
+
+  <path
+    d="M19,19H5V5h14V19z M3,3v18h18V3H3z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7 L17,8.41L13.41,12L17,15.59z" />
+</svg>
\ No newline at end of file
index 71c1353733aae6392476e2021b0c415d4173061a..ef44918012ed4a80a3a3e721ce007a5c9b6131da 100644 (file)
         <p><svg class="icon"><use href="../shared_images/delete.svg#icon"/></svg> delete.</p>
         <p><svg class="icon"><use href="../shared_images/delete_forever.svg#icon"/></svg> delete_forever.</p>
         <p><svg class="icon"><use href="../shared_images/devices_other.svg#icon"/></svg> devices_other.</p>
+        <p><svg class="icon"><use href="../shared_images/disabled_by_default.svg#icon"/></svg> disabled_by_default.</p>
         <p><svg class="icon"><use href="../shared_images/dns.svg#icon"/></svg> dns.</p>
         <p><svg class="icon"><use href="../shared_images/donut_small.svg#icon"/></svg> donut_small.</p>
         <p><svg class="icon"><use href="../shared_images/edit.svg#icon"/></svg> edit.</p>
index 03a39919a118115da2b52a14cdcd32289fad5a66..3718edbde3e149bcf4c78a453d4abe600c8e3e69 100644 (file)
@@ -748,6 +748,7 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
         SwitchCompat blockAllThirdPartyRequestsSwitch = view.findViewById(R.id.block_all_third_party_requests_switch);
         Spinner userAgentSpinner = view.findViewById(R.id.user_agent_spinner);
         EditText customUserAgentEditText = view.findViewById(R.id.custom_user_agent_edittext);
+        Spinner xRequestedWithHeaderSpinner = view.findViewById(R.id.x_requested_with_header_spinner);
         Spinner fontSizeSpinner = view.findViewById(R.id.font_size_spinner);
         EditText customFontSizeEditText = view.findViewById(R.id.custom_font_size_edittext);
         Spinner swipeToRefreshSpinner = view.findViewById(R.id.swipe_to_refresh_spinner);
@@ -773,6 +774,7 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
         boolean ultraPrivacy = ultraPrivacySwitch.isChecked();
         boolean blockAllThirdPartyRequests = blockAllThirdPartyRequestsSwitch.isChecked();
         int userAgentSwitchPosition = userAgentSpinner.getSelectedItemPosition();
+        int xRequestedWithHeaderSwitchInt = xRequestedWithHeaderSpinner.getSelectedItemPosition();
         int fontSizeSwitchPosition = fontSizeSpinner.getSelectedItemPosition();
         int swipeToRefreshInt = swipeToRefreshSpinner.getSelectedItemPosition();
         int webViewThemeInt = webViewThemeSpinner.getSelectedItemPosition();
@@ -815,8 +817,8 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
 
         // Save the domain settings.
         domainsDatabaseHelper.updateDomain(DomainsActivity.currentDomainDatabaseId, domainNameString, javaScript, cookies, domStorage, formData, easyList, easyPrivacy,
-                fanboysAnnoyance, fanboysSocialBlocking, ultraList, ultraPrivacy, blockAllThirdPartyRequests, userAgentName, fontSizeInt, swipeToRefreshInt, webViewThemeInt, wideViewportInt,
-                displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
+                fanboysAnnoyance, fanboysSocialBlocking, ultraList, ultraPrivacy, blockAllThirdPartyRequests, userAgentName, xRequestedWithHeaderSwitchInt, fontSizeInt, swipeToRefreshInt, webViewThemeInt,
+                wideViewportInt, displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
 
         // Update the pinned SSL certificate if a new one is checked.
         if (currentWebsiteCertificateRadioButton.isChecked()) {
index 8953d8545b53d493e5be160c49139c761530964f..6cf5485b32f86dd28ffe4cf8270f70b402330853 100644 (file)
@@ -187,7 +187,7 @@ class PinnedMismatchPagerAdapter(private val context: Context, private val layou
         }
 
         // Create the color spans.
-        val blueColorSpan = ForegroundColorSpan(context.getColor(R.color.blue_text))
+        val blueColorSpan = ForegroundColorSpan(context.getColor(R.color.alt_blue_text))
         val redColorSpan = ForegroundColorSpan(context.getColor(R.color.red_text))
 
         // Set the domain name to be blue.
index 04ff898238c530754451f356c6d06bd4c767d92d..1179c29e59502d0e8948d04998533b0337c3d511 100644 (file)
@@ -226,7 +226,7 @@ class SslCertificateErrorDialog : DialogFragment() {
         val endDateStringBuilder = SpannableStringBuilder(endDateLabel + endDate)
 
         // Define the color spans.
-        val blueColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.blue_text))
+        val blueColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.alt_blue_text))
         val redColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.red_text))
 
         // Setup the spans to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
@@ -363,7 +363,7 @@ class SslCertificateErrorDialog : DialogFragment() {
             val ipAddressesStringBuilder = SpannableStringBuilder(ipAddressesLabel + ipAddresses)
 
             // Create a blue color span according to the theme.
-            val blueColorSpan = ForegroundColorSpan(activity.getColor(R.color.blue_text))
+            val blueColorSpan = ForegroundColorSpan(activity.getColor(R.color.alt_blue_text))
 
             // Set the string builder to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
             ipAddressesStringBuilder.setSpan(blueColorSpan, ipAddressesLabel.length, ipAddressesStringBuilder.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
index 0a79f80653c254a86641121f84412762fa7f6fb2..04cdad8dd3b292555970cacd612f6986a34d6831 100644 (file)
@@ -250,7 +250,7 @@ class ViewSslCertificateDialog : DialogFragment() {
             val endDateStringBuilder = SpannableStringBuilder(endDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(endDate))
 
             // Define the color spans.
-            val blueColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.blue_text))
+            val blueColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.alt_blue_text))
             val redColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.red_text))
 
             // Format the domain string and issued to CName colors.
index 7fb52dac7c364597213315d6f8d19bc33766e401..7dfeda99553fd10c2e77d6ba3122417cbd014c2c 100644 (file)
@@ -363,7 +363,7 @@ class AboutVersionFragment : Fragment() {
         val ultraPrivacyStringBuilder = SpannableStringBuilder(ultraPrivacyLabel + blocklistVersions[5])
 
         // Set the blue color span according to the theme.  The deprecated `getColor()` must be used until the minimum API >= 23.
-        blueColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.about_version_blue_text))
+        blueColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.alt_blue_text))
 
         // Set the spans to display the device information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
         brandStringBuilder.setSpan(blueColorSpan, brandLabel.length, brandStringBuilder.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
index 474d01c23b9c9c960fd2121db9bc08d454de4019..365a4f799e17c4f41b74a444b6357444f26ed4ee 100644 (file)
@@ -20,7 +20,6 @@
 package com.stoutner.privacybrowser.fragments;
 
 import android.annotation.SuppressLint;
-import android.content.Context;
 import android.content.SharedPreferences;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -52,7 +51,7 @@ import androidx.annotation.NonNull;
 import androidx.appcompat.widget.SwitchCompat;
 import androidx.cardview.widget.CardView;
 import androidx.core.content.res.ResourcesCompat;
-import androidx.fragment.app.Fragment;  // The AndroidX fragment must be used until minimum API >= 23.  Otherwise `getContext()` does not work.
+import androidx.fragment.app.Fragment;
 
 import com.stoutner.privacybrowser.R;
 import com.stoutner.privacybrowser.activities.DomainsActivity;
@@ -94,21 +93,18 @@ public class DomainSettingsFragment extends Fragment {
         View domainSettingsView = inflater.inflate(R.layout.domain_settings_fragment, container, false);
 
         // Get handles for the context and the resources.
-        Context context = getContext();
         Resources resources = getResources();
 
-        // Remove the error below that the context might be null.
-        assert context != null;
-
         // Get the current theme status.
         int currentThemeStatus = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
 
         // Get a handle for the shared preference.
-        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
+        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext());
 
         // Store the default settings.
         String defaultUserAgentName = sharedPreferences.getString("user_agent", getString(R.string.user_agent_default_value));
         String defaultCustomUserAgentString = sharedPreferences.getString("custom_user_agent", getString(R.string.custom_user_agent_default_value));
+        boolean defaultXRequestedWithHeader = sharedPreferences.getBoolean(getString(R.string.x_requested_with_header_key), true);
         String defaultFontSizeString = sharedPreferences.getString("font_size", getString(R.string.font_size_default_value));
         boolean defaultSwipeToRefresh = sharedPreferences.getBoolean("swipe_to_refresh", true);
         String defaultWebViewTheme = sharedPreferences.getString("webview_theme", getString(R.string.webview_theme_default_value));
@@ -143,6 +139,9 @@ public class DomainSettingsFragment extends Fragment {
         Spinner userAgentSpinner = domainSettingsView.findViewById(R.id.user_agent_spinner);
         TextView userAgentTextView = domainSettingsView.findViewById(R.id.user_agent_textview);
         EditText customUserAgentEditText = domainSettingsView.findViewById(R.id.custom_user_agent_edittext);
+        ImageView xRequestedWithHeaderImageView = domainSettingsView.findViewById(R.id.x_requested_with_header_imageview);
+        Spinner xRequestedWithHeaderSpinner = domainSettingsView.findViewById(R.id.x_requested_with_header_spinner);
+        TextView xRequestedWithHeaderTextView = domainSettingsView.findViewById(R.id.x_requested_with_header_textview);
         Spinner fontSizeSpinner = domainSettingsView.findViewById(R.id.font_size_spinner);
         TextView defaultFontSizeTextView = domainSettingsView.findViewById(R.id.default_font_size_textview);
         EditText customFontSizeEditText = domainSettingsView.findViewById(R.id.custom_font_size_edittext);
@@ -222,6 +221,7 @@ public class DomainSettingsFragment extends Fragment {
         int ultraPrivacyInt = domainCursor.getInt(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.ENABLE_ULTRAPRIVACY));
         int blockAllThirdPartyRequestsInt = domainCursor.getInt(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.BLOCK_ALL_THIRD_PARTY_REQUESTS));
         String currentUserAgentName = domainCursor.getString(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.USER_AGENT));
+        int xRequestedWithHeaderInt = domainCursor.getInt(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.X_REQUESTED_WITH_HEADER));
         int fontSizeInt = domainCursor.getInt(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.FONT_SIZE));
         int swipeToRefreshInt = domainCursor.getInt(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.SWIPE_TO_REFRESH));
         int webViewThemeInt = domainCursor.getInt(domainCursor.getColumnIndexOrThrow(DomainsDatabaseHelper.WEBVIEW_THEME));
@@ -251,15 +251,17 @@ public class DomainSettingsFragment extends Fragment {
         }
 
         // Create array adapters for the spinners.
-        ArrayAdapter<CharSequence> translatedUserAgentArrayAdapter = ArrayAdapter.createFromResource(context, R.array.translated_domain_settings_user_agent_names, R.layout.spinner_item);
-        ArrayAdapter<CharSequence> fontSizeArrayAdapter = ArrayAdapter.createFromResource(context, R.array.font_size_array, R.layout.spinner_item);
-        ArrayAdapter<CharSequence> swipeToRefreshArrayAdapter = ArrayAdapter.createFromResource(context, R.array.swipe_to_refresh_array, R.layout.spinner_item);
-        ArrayAdapter<CharSequence> webViewThemeArrayAdapter = ArrayAdapter.createFromResource(context, R.array.webview_theme_array, R.layout.spinner_item);
-        ArrayAdapter<CharSequence> wideViewportArrayAdapter = ArrayAdapter.createFromResource(context, R.array.wide_viewport_array, R.layout.spinner_item);
-        ArrayAdapter<CharSequence> displayImagesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.display_webpage_images_array, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> translatedUserAgentArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.translated_domain_settings_user_agent_names, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> xRequestedWithHeaderArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.x_requested_with_header_array, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> fontSizeArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.font_size_array, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> swipeToRefreshArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.swipe_to_refresh_array, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> webViewThemeArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.webview_theme_array, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> wideViewportArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.wide_viewport_array, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> displayImagesArrayAdapter = ArrayAdapter.createFromResource(requireContext(), R.array.display_webpage_images_array, R.layout.spinner_item);
 
         // Set the drop down view resource on the spinners.
         translatedUserAgentArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
+        xRequestedWithHeaderArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
         fontSizeArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
         swipeToRefreshArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
         webViewThemeArrayAdapter.setDropDownViewResource(R.layout.domain_settings_spinner_dropdown_items);
@@ -268,6 +270,7 @@ public class DomainSettingsFragment extends Fragment {
 
         // Set the array adapters for the spinners.
         userAgentSpinner.setAdapter(translatedUserAgentArrayAdapter);
+        xRequestedWithHeaderSpinner.setAdapter(xRequestedWithHeaderArrayAdapter);
         fontSizeSpinner.setAdapter(fontSizeArrayAdapter);
         swipeToRefreshSpinner.setAdapter(swipeToRefreshArrayAdapter);
         webViewThemeSpinner.setAdapter(webViewThemeArrayAdapter);
@@ -300,8 +303,8 @@ public class DomainSettingsFragment extends Fragment {
         }
 
         // Create the color spans.
-        final ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(context.getColor(R.color.blue_text));
-        final ForegroundColorSpan redColorSpan = new ForegroundColorSpan(context.getColor(R.color.red_text));
+        final ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(requireContext().getColor(R.color.alt_blue_text));
+        final ForegroundColorSpan redColorSpan = new ForegroundColorSpan(requireContext().getColor(R.color.red_text));
 
         // Set the domain name from the the database cursor.
         domainNameEditText.setText(domainNameString);
@@ -435,132 +438,29 @@ public class DomainSettingsFragment extends Fragment {
             }
         }
 
-        // Set the EasyList status.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
-        if (easyListInt == 1) {  // EasyList is on.
-            // Turn the switch on.
-            easyListSwitch.setChecked(true);
-
-            // Set the icon.
-            easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled, null));
-        } else {  // EasyList is off.
-            // Turn the switch off.
-            easyListSwitch.setChecked(false);
-
-            // Set the icon.
-            easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled, null));
-        }
-
-        // Set the EasyPrivacy status.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
-        if (easyPrivacyInt == 1) {  // EasyPrivacy is on.
-            // Turn the switch on.
-            easyPrivacySwitch.setChecked(true);
-
-            // Set the icon.
-            easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_enabled, null));
-        } else {  // EasyPrivacy is off.
-            // Turn the switch off.
-            easyPrivacySwitch.setChecked(false);
-
-            // Set the icon.
-            easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_disabled, null));
-        }
-
-        // Set the Fanboy's Annoyance List status.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
-        if (fanboysAnnoyanceListInt == 1) {  // Fanboy's Annoyance List is on.
-            // Turn the switch on.
-            fanboysAnnoyanceListSwitch.setChecked(true);
-
-            // Set the icon.
-            fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled, null));
-        } else {  // Fanboy's Annoyance List is off.
-            // Turn the switch off.
-            fanboysAnnoyanceListSwitch.setChecked(false);
-
-            // Set the icon.
-            fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled, null));
-        }
-
-        // Only enable Fanboy's Social Blocking List if Fanboy's Annoyance List is off.
-        if (fanboysAnnoyanceListInt == 0) {  // Fanboy's Annoyance List is on.
-            // Enable Fanboy's Social Blocking List switch.
-            fanboysSocialBlockingListSwitch.setEnabled(true);
-
-            // Enable Fanboy's Social Blocking List.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-            // Doing this makes no sense until it can also be done with the preferences.
-            if (fanboysSocialBlockingListInt == 1) {  // Fanboy's Social Blocking List is on.
-                // Turn on Fanboy's Social Blocking List switch.
-                fanboysSocialBlockingListSwitch.setChecked(true);
-
-                // Set the icon.
-                fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled, null));
-            } else {  // Fanboy's Social Blocking List is off.
-                // Turn off Fanboy's Social Blocking List switch.
-                fanboysSocialBlockingListSwitch.setChecked(false);
-
-                // Set the icon.
-                fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled, null));
-            }
-        } else {  // Fanboy's Annoyance List is on.
-            // Disable Fanboy's Social Blocking List switch.
-            fanboysSocialBlockingListSwitch.setEnabled(false);
-
-            // Set the status of Fanboy's Social Blocking List.
-            fanboysSocialBlockingListSwitch.setChecked(fanboysSocialBlockingListInt == 1);
-
-            // Set the icon.
-            fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_ghosted, null));
-        }
-
-        // Set the UltraList status.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
-        if (ultraListInt == 1) {  // UltraList is on.
-            // Turn the switch on.
-            ultraListSwitch.setChecked(true);
-
-            // Set the icon.
-            ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled, null));
-        } else {  // UltraList is off.
-            // Turn the switch off.
-            ultraListSwitch.setChecked(false);
-
-            // Set the icon.
-            ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled, null));
-        }
-
-        // Set the UltraPrivacy status.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
-        if (ultraPrivacyInt == 1) {  // UltraPrivacy is on.
-            // Turn the switch on.
-            ultraPrivacySwitch.setChecked(true);
-
-            // Set the icon.
-            ultraPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_enabled, null));
-        } else {  // EasyPrivacy is off.
-            // Turn the switch off.
-            ultraPrivacySwitch.setChecked(false);
-
-            // Set the icon.
-            ultraPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_disabled, null));
-        }
-
-        // Set the third-party resource blocking status.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
-        if (blockAllThirdPartyRequestsInt == 1) {  // Blocking all third-party requests is on.
-            // Turn the switch on.
-            blockAllThirdPartyRequestsSwitch.setChecked(true);
-
-            // Set the icon.
-            blockAllThirdPartyRequestsImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_all_third_party_requests_enabled, null));
-        } else {  // Blocking all third-party requests is off.
-            // Turn the switch off.
-            blockAllThirdPartyRequestsSwitch.setChecked(false);
-
-            // Set the icon.
-            blockAllThirdPartyRequestsImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_all_third_party_requests_disabled, null));
-        }
+        // Set the switch positions.
+        easyListSwitch.setChecked(easyListInt == 1);
+        easyPrivacySwitch.setChecked(easyPrivacyInt == 1);
+        fanboysAnnoyanceListSwitch.setChecked(fanboysAnnoyanceListInt == 1);
+        fanboysSocialBlockingListSwitch.setChecked(fanboysSocialBlockingListInt == 1);
+        ultraListSwitch.setChecked(ultraListInt == 1);
+        ultraPrivacySwitch.setChecked(ultraPrivacyInt == 1);
+        blockAllThirdPartyRequestsSwitch.setChecked(blockAllThirdPartyRequestsInt == 1);
+
+        // Set the switch icon colors.
+        easyListImageView.setSelected(easyListInt == 1);
+        easyPrivacyImageView.setSelected(easyPrivacyInt == 1);
+        fanboysAnnoyanceListImageView.setSelected(fanboysAnnoyanceListInt == 1);
+        fanboysSocialBlockingListImageView.setSelected(fanboysSocialBlockingListInt == 1);
+        ultraListImageView.setSelected(ultraListInt == 1);
+        ultraPrivacyImageView.setSelected(ultraPrivacyInt == 1);
+        blockAllThirdPartyRequestsImageView.setSelected(blockAllThirdPartyRequestsInt == 1);
+
+        // Set Fanboy's Social Blocking List switch status based on the Annoyance List status.
+        fanboysSocialBlockingListSwitch.setEnabled(fanboysAnnoyanceListInt == 0);
+
+        // Set the Social Blocking List icon ghosted status based on the Annoyance List status.
+        fanboysSocialBlockingListImageView.setEnabled(fanboysAnnoyanceListInt == 0);
 
         // Inflated a WebView to get the default user agent.
         // `@SuppressLint("InflateParams")` removes the warning about using `null` as the `ViewGroup`, which in this case makes sense because the bare WebView should not be displayed on the screen.
@@ -569,7 +469,7 @@ public class DomainSettingsFragment extends Fragment {
         final String webViewDefaultUserAgentString = bareWebView.getSettings().getUserAgentString();
 
         // Get a handle for the user agent array adapter.  This array does not contain the `System default` entry.
-        ArrayAdapter<CharSequence> userAgentNamesArray = ArrayAdapter.createFromResource(context, R.array.user_agent_names, R.layout.spinner_item);
+        ArrayAdapter<CharSequence> userAgentNamesArray = ArrayAdapter.createFromResource(requireContext(), R.array.user_agent_names, R.layout.spinner_item);
 
         // Get the positions of the user agent and the default user agent.
         int userAgentArrayPosition = userAgentNamesArray.getPosition(currentUserAgentName);
@@ -638,6 +538,48 @@ public class DomainSettingsFragment extends Fragment {
             userAgentSpinner.performClick();
         });
 
+        // Select the X-Requested-With header selection in the spinner.
+        xRequestedWithHeaderSpinner.setSelection(xRequestedWithHeaderInt);
+
+        // Set the X-Requested-With header text.
+        if (defaultXRequestedWithHeader)
+            xRequestedWithHeaderTextView.setText(xRequestedWithHeaderArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
+        else
+            xRequestedWithHeaderTextView.setText(xRequestedWithHeaderArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
+
+        // Set the X-Requested-With header icon and text view settings.
+        switch (xRequestedWithHeaderInt) {
+            case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+                // Set the icon color.
+                xRequestedWithHeaderImageView.setSelected(defaultXRequestedWithHeader);
+
+                // Show the X-Requested-With header text view.
+                xRequestedWithHeaderTextView.setVisibility(View.VISIBLE);
+                break;
+
+            case DomainsDatabaseHelper.ENABLED:
+                // Set the icon color.
+                xRequestedWithHeaderImageView.setSelected(true);
+
+                // Hide the X-Requested-With header text view.
+                xRequestedWithHeaderTextView.setVisibility(View.GONE);
+                break;
+
+            case DomainsDatabaseHelper.DISABLED:
+                // Set the icon color.
+                xRequestedWithHeaderImageView.setSelected(false);
+
+                // Hide the X-Requested-With header text view.
+                xRequestedWithHeaderTextView.setVisibility(View.GONE);
+                break;
+        }
+
+        // Open the X-Requested-With header spinner when the text view is clicked.
+        xRequestedWithHeaderTextView.setOnClickListener((View v) -> {
+            // Open the X-Requested-With header spinner.
+            xRequestedWithHeaderSpinner.performClick();
+        });
+
         // Display the font size settings.
         if (fontSizeInt == 0) {  // `0` is the code for system default font size.
             // Set the font size to the system default
@@ -681,39 +623,32 @@ public class DomainSettingsFragment extends Fragment {
         swipeToRefreshSpinner.setSelection(swipeToRefreshInt);
 
         // Set the swipe to refresh text.
-        if (defaultSwipeToRefresh) {
+        if (defaultSwipeToRefresh)
             swipeToRefreshTextView.setText(swipeToRefreshArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
-        } else {
+        else
             swipeToRefreshTextView.setText(swipeToRefreshArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
-        }
 
-        // Set the swipe to refresh icon and text view settings.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
+        // Set the swipe to refresh icon and text view settings.
         switch (swipeToRefreshInt) {
             case DomainsDatabaseHelper.SYSTEM_DEFAULT:
-                if (defaultSwipeToRefresh) {  // Swipe to refresh is enabled by default.
-                    // Set the icon.
-                    swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_enabled, null));
-                } else {
-                    // Set the icon.
-                    swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_disabled, null));
-                }
+                // Set the icon color.
+                swipeToRefreshImageView.setSelected(defaultSwipeToRefresh);
 
                 // Show the swipe to refresh text view.
                 swipeToRefreshTextView.setVisibility(View.VISIBLE);
                 break;
 
             case DomainsDatabaseHelper.ENABLED:
-                // Set the icon.
-                swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_enabled, null));
+                // Set the icon color.
+                swipeToRefreshImageView.setSelected(true);
 
                 // Hide the swipe to refresh text view.
                 swipeToRefreshTextView.setVisibility(View.GONE);
                 break;
 
             case DomainsDatabaseHelper.DISABLED:
-                // Set the icon.
-                swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_disabled, null));
+                // Set the icon color.
+                swipeToRefreshImageView.setSelected(false);
 
                 // Hide the swipe to refresh text view.
                 swipeToRefreshTextView.setVisibility(View.GONE);
@@ -761,31 +696,24 @@ public class DomainSettingsFragment extends Fragment {
             webViewThemeTextView.setText(webViewThemeStringArray[appWebViewThemeEntryNumber]);
         }
 
-        // Set the WebView theme icon and text visibility.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
+        // Set the WebView theme icon and text visibility.
         switch (webViewThemeInt) {
             case DomainsDatabaseHelper.SYSTEM_DEFAULT:  // The domain WebView theme is system default.
                 // Set the icon according to the app WebView theme.
                 switch (appWebViewThemeEntryNumber) {
                     case DomainsDatabaseHelper.SYSTEM_DEFAULT:  // The default WebView theme is system default.
-                        // Set the icon according to the app theme.
-                        if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
-                            // Set the light theme icon.
-                            webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
-                        } else {
-                            // Set the dark theme icon.
-                            webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
-                        }
+                        // Set the icon color.
+                        webViewThemeImageView.setSelected(currentThemeStatus == Configuration.UI_MODE_NIGHT_NO);
                         break;
 
                     case DomainsDatabaseHelper.LIGHT_THEME:  // the default WebView theme is light.
-                        // Set the icon.
-                        webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
+                        // Set the icon color.
+                        webViewThemeImageView.setSelected(true);
                         break;
 
                     case DomainsDatabaseHelper.DARK_THEME:  // the default WebView theme is dark.
-                        // Set the icon.
-                        webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
+                        // Set the icon color.
+                        webViewThemeImageView.setSelected(false);
                         break;
                 }
 
@@ -794,16 +722,16 @@ public class DomainSettingsFragment extends Fragment {
                 break;
 
             case DomainsDatabaseHelper.LIGHT_THEME:  // The domain WebView theme is light.
-                // Set the icon.
-                webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
+                // Set the icon color.
+                webViewThemeImageView.setSelected(true);
 
                 // Hide the WebView theme text view.
                 webViewThemeTextView.setVisibility(View.GONE);
                 break;
 
             case DomainsDatabaseHelper.DARK_THEME:  // The domain WebView theme is dark.
-                // Set the icon.
-                webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
+                // Set the icon color.
+                webViewThemeImageView.setSelected(false);
 
                 // Hide the WebView theme text view.
                 webViewThemeTextView.setVisibility(View.GONE);
@@ -820,38 +748,32 @@ public class DomainSettingsFragment extends Fragment {
         wideViewportSpinner.setSelection(wideViewportInt);
 
         // Set the default wide viewport text.
-        if (defaultWideViewport) {
+        if (defaultWideViewport)
             wideViewportTextView.setText(wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED));
-        } else {
+        else
             wideViewportTextView.setText(wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
-        }
 
-        // Set the wide viewport icon and text view settings.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
+        // Set the wide viewport icon and text view settings.
         switch (wideViewportInt) {
             case DomainsDatabaseHelper.SYSTEM_DEFAULT:
-                // Set the icon.
-                if (defaultWideViewport) {  // Wide viewport enabled by default.
-                    wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_enabled, null));
-                } else {  // Wide viewport disabled by default.
-                    wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_disabled, null));
-                }
+                // Set the icon color.
+                wideViewportImageView.setSelected(defaultWideViewport);
 
                 // Show the wide viewport text view.
                 wideViewportTextView.setVisibility(View.VISIBLE);
                 break;
 
             case DomainsDatabaseHelper.ENABLED:
-                // Set the icon according to the theme.
-                wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_enabled, null));
+                // Set the icon color.
+                wideViewportImageView.setSelected(true);
 
                 // Hide the wide viewport text view.
                 wideViewportTextView.setVisibility(View.GONE);
                 break;
 
             case DomainsDatabaseHelper.DISABLED:
-                // Set the icon.
-                wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_disabled, null));
+                // Set the icon color.
+                wideViewportImageView.setSelected(false);
 
                 // Hide the wide viewport text view.
                 wideViewportTextView.setVisibility(View.GONE);
@@ -874,33 +796,27 @@ public class DomainSettingsFragment extends Fragment {
             displayImagesTextView.setText(displayImagesArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED));
         }
 
-        // Set the display website images icon and text view settings.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-        // Doing this makes no sense until it can also be done with the preferences.
+        // Set the display website images icon and text view settings.
         switch (displayImagesInt) {
             case DomainsDatabaseHelper.SYSTEM_DEFAULT:
-                if (defaultDisplayWebpageImages) {  // Display webpage images enabled by default.
-                    // Set the icon.
-                    displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_enabled, null));
-                } else {  // Display webpage images disabled by default.
-                    // Set the icon.
-                    displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_disabled, null));
-                }
+                // Set the icon color.
+                displayWebpageImagesImageView.setSelected(defaultDisplayWebpageImages);
 
                 // Show the display images text view.
                 displayImagesTextView.setVisibility(View.VISIBLE);
                 break;
 
             case DomainsDatabaseHelper.ENABLED:
-                // Set the icon.
-                displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_enabled, null));
+                // Set the icon color.
+                displayWebpageImagesImageView.setSelected(true);
 
                 // Hide the display images text view.
                 displayImagesTextView.setVisibility(View.GONE);
                 break;
 
             case DomainsDatabaseHelper.DISABLED:
-                // Set the icon.
-                displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_disabled, null));
+                // Set the icon color.
+                displayWebpageImagesImageView.setSelected(false);
 
                 // Hide the display images text view.
                 displayImagesTextView.setVisibility(View.GONE);
@@ -912,22 +828,14 @@ public class DomainSettingsFragment extends Fragment {
             // Open the user agent spinner.
             displayWebpageImagesSpinner.performClick();
         });
-        
-        // Set the pinned SSL certificate icon.
-        if (pinnedSslCertificateInt == 1) {  // Pinned SSL certificate is enabled.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-            // Doing this makes no sense until it can also be done with the preferences.
-            // Check the switch.
-            pinnedSslCertificateSwitch.setChecked(true);
 
-            // Set the icon.
-            pinnedSslCertificateImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_enabled, null));
-        } else {  // Pinned SSL certificate is disabled.
-            // Uncheck the switch.
-            pinnedSslCertificateSwitch.setChecked(false);
+        // Set the switch positions.
+        pinnedSslCertificateSwitch.setChecked(pinnedSslCertificateInt == 1);
+        pinnedIpAddressesSwitch.setChecked(pinnedIpAddressesInt == 1);
 
-            // Set the icon.
-            pinnedSslCertificateImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_disabled, null));
-        }
+        // Set the switch icon colors.
+        pinnedSslCertificateImageView.setSelected(pinnedSslCertificateInt == 1);
+        pinnedIpAddressesImageView.setSelected(pinnedIpAddressesInt == 1);
 
         // Store the current date.
         Date currentDate = Calendar.getInstance().getTime();
@@ -1093,22 +1001,6 @@ public class DomainSettingsFragment extends Fragment {
             currentWebsiteCertificateRadioButton.setChecked(false);
         }
 
-        // Set the pinned IP addresses icon.
-        if (pinnedIpAddressesInt == 1) {  // Pinned IP addresses is enabled.  Once the minimum API >= 21 a selector can be sued as the tint mode instead of specifying different icons.
-            // Doing this makes no sense until it can also be done with the preferences.
-            // Check the switch.
-            pinnedIpAddressesSwitch.setChecked(true);
-
-            // Set the icon.
-            pinnedIpAddressesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_enabled, null));
-        } else {  // Pinned IP Addresses is disabled.
-            // Uncheck the switch.
-            pinnedIpAddressesSwitch.setChecked(false);
-
-            // Set the icon.
-            pinnedIpAddressesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_disabled, null));
-        }
-
         // Populate the saved and current IP addresses.
         savedIpAddressesTextView.setText(savedIpAddresses);
         currentIpAddressesTextView.setText(DomainsActivity.currentIpAddresses);
@@ -1221,91 +1113,51 @@ public class DomainSettingsFragment extends Fragment {
 
         // Set the EasyList switch listener.
         easyListSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {
-                easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled, null));
-            } else {
-                easyListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled, null));
-            }
+            // Update the icon color.
+            easyListImageView.setSelected(isChecked);
         });
 
         // Set the EasyPrivacy switch listener.
         easyPrivacySwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {  // EasyPrivacy is on.
-                // Set the icon.
-                easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_enabled, null));
-            } else {
-                easyPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_disabled, null));
-            }
+            // Update the icon color.
+            easyPrivacyImageView.setSelected(isChecked);
         });
 
         // Set the Fanboy's Annoyance List switch listener.
         fanboysAnnoyanceListSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon and Fanboy's Social Blocking List.
-            if (isChecked) {  // Fanboy's Annoyance List is on.
-                // Set the icon.
-                fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled, null));
-
-                // Disable the Fanboy's Social Blocking List switch.
-                fanboysSocialBlockingListSwitch.setEnabled(false);
+            // Update the icon color.
+            fanboysAnnoyanceListImageView.setSelected(isChecked);
 
-                // Update the Fanboy's Social Blocking List icon.
-                fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_ghosted, null));
-            } else {  // Fanboy's Annoyance List is off.
-                // Set the icon.
-                fanboysAnnoyanceListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled, null));
 
-                // Enable the Fanboy's Social Blocking List switch.
-                fanboysSocialBlockingListSwitch.setEnabled(true);
+            // Set Fanboy's Social Blocking List switch position.
+            fanboysSocialBlockingListSwitch.setEnabled(!isChecked);
 
-                // Update the Fanboy's Social Blocking List icon.
-                if (fanboysSocialBlockingListSwitch.isChecked()) {
-                    fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled, null));
-                } else {
-                    fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled, null));
-                }
-            }
+            // Set the Social Blocking List icon ghosted status.
+            fanboysSocialBlockingListImageView.setEnabled(!isChecked);
         });
 
         // Set the Fanboy's Social Blocking List switch listener.
         fanboysSocialBlockingListSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {
-                fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_enabled, null));
-            } else {
-                fanboysSocialBlockingListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.social_media_disabled, null));
-            }
+            // Update the icon color.
+            fanboysSocialBlockingListImageView.setSelected(isChecked);
         });
 
         // Set the UltraList switch listener.
         ultraListSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {
-                ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_enabled, null));
-            } else {
-                ultraListImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_ads_disabled, null));
-            }
+            // Update the icon color.
+            ultraListImageView.setSelected(isChecked);
         });
 
         // Set the UltraPrivacy switch listener.
         ultraPrivacySwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {
-                ultraPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_enabled, null));
-            } else {
-                ultraPrivacyImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_tracking_disabled, null));
-            }
+            // Update the icon color.
+            ultraPrivacyImageView.setSelected(isChecked);
         });
 
         // Set the block all third-party requests switch listener.
         blockAllThirdPartyRequestsSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {
-                blockAllThirdPartyRequestsImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_all_third_party_requests_enabled, null));
-            } else {
-                blockAllThirdPartyRequestsImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.block_all_third_party_requests_disabled, null));
-            }
+            // Update the icon color.
+            blockAllThirdPartyRequestsImageView.setSelected(isChecked);
         });
 
         // Set the user agent spinner listener.
@@ -1378,6 +1230,44 @@ public class DomainSettingsFragment extends Fragment {
             }
         });
 
+        // Set the X-Requested-With header spinner listener.
+        xRequestedWithHeaderSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                // Update the icon and the visibility of the text view.
+                switch (position) {
+                    case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+                        // Set the icon color.
+                        xRequestedWithHeaderImageView.setSelected(defaultXRequestedWithHeader);
+
+                        // Show the X-Requested-With header text view.
+                        xRequestedWithHeaderTextView.setVisibility(View.VISIBLE);
+                        break;
+
+                    case DomainsDatabaseHelper.ENABLED:
+                        // Set the icon color.
+                        xRequestedWithHeaderImageView.setSelected(true);
+
+                        // Hide the X-Requested-With header text view.
+                        xRequestedWithHeaderTextView.setVisibility(View.GONE);
+                        break;
+
+                    case DomainsDatabaseHelper.DISABLED:
+                        // Set the icon color.
+                        xRequestedWithHeaderImageView.setSelected(false);
+
+                        // Hide the X-Requested-With header text view.
+                        xRequestedWithHeaderTextView.setVisibility(View.GONE);
+                        break;
+                }
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+                // Do nothing.
+            }
+        });
+
         // Set the font size spinner listener.
         fontSizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
             @Override
@@ -1408,33 +1298,27 @@ public class DomainSettingsFragment extends Fragment {
         swipeToRefreshSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
             @Override
             public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
-                // Update the icon and the visibility of the night mode text view.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-                // Doing this makes no sense until it can also be done with the preferences.
+                // Update the icon and the visibility of the text view.
                 switch (position) {
                     case DomainsDatabaseHelper.SYSTEM_DEFAULT:
-                        if (defaultSwipeToRefresh) {
-                            // Set the icon.
-                            swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_enabled, null));
-                        } else {
-                            // Set the icon.
-                            swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_disabled, null));
-                        }
+                        // Set the icon color.
+                        swipeToRefreshImageView.setSelected(defaultSwipeToRefresh);
 
                         // Show the swipe to refresh text view.
                         swipeToRefreshTextView.setVisibility(View.VISIBLE);
                         break;
 
                     case DomainsDatabaseHelper.ENABLED:
-                        // Set the icon.
-                        swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_enabled, null));
+                        // Set the icon color.
+                        swipeToRefreshImageView.setSelected(true);
 
                         // Hide the swipe to refresh text view.
                         swipeToRefreshTextView.setVisibility(View.GONE);
                         break;
 
                     case DomainsDatabaseHelper.DISABLED:
-                        // Set the icon.
-                        swipeToRefreshImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.refresh_disabled, null));
+                        // Set the icon color.
+                        swipeToRefreshImageView.setSelected(false);
 
                         // Hide the swipe to refresh text view.
                         swipeToRefreshTextView.setVisibility(View.GONE);
@@ -1451,31 +1335,24 @@ public class DomainSettingsFragment extends Fragment {
         webViewThemeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
             @Override
             public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
-                // Update the icon and the visibility of the WebView theme text view.  Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
-                // Doing this makes no sense until it can also be done with the preferences.
+                // Update the icon and the visibility of the WebView theme text view.
                 switch (position) {
                     case DomainsDatabaseHelper.SYSTEM_DEFAULT:  // the domain WebView theme is system default.
                         // Set the icon according to the app WebView theme.
                         switch (appWebViewThemeEntryNumber) {
                             case DomainsDatabaseHelper.SYSTEM_DEFAULT:  // The default WebView theme is system default.
-                                // Set the icon according to the app theme.
-                                if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
-                                    // Set the light theme icon.
-                                    webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
-                                } else {
-                                    // Set the dark theme icon.
-                                    webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
-                                }
+                                // Set the icon color.
+                                webViewThemeImageView.setSelected(currentThemeStatus == Configuration.UI_MODE_NIGHT_NO);
                                 break;
 
                             case DomainsDatabaseHelper.LIGHT_THEME:  // The default WebView theme is light.
-                                // Set the icon.
-                                webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
+                                // Set the icon color.
+                                webViewThemeImageView.setSelected(true);
                                 break;
 
                             case DomainsDatabaseHelper.DARK_THEME:  // The default WebView theme is dark.
                                 // Set the icon.
-                                webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
+                                webViewThemeImageView.setSelected(false);
                                 break;
                         }
 
@@ -1484,16 +1361,16 @@ public class DomainSettingsFragment extends Fragment {
                         break;
 
                     case DomainsDatabaseHelper.LIGHT_THEME:  // The domain WebView theme is light.
-                        // Set the icon.
-                        webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_light_theme, null));
+                        // Set the icon color.
+                        webViewThemeImageView.setSelected(true);
 
                         // Hide the WebView theme text view.
                         webViewThemeTextView.setVisibility(View.GONE);
                         break;
 
                     case DomainsDatabaseHelper.DARK_THEME:  // The domain WebView theme is dark.
-                        // Set the icon.
-                        webViewThemeImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.webview_dark_theme, null));
+                        // Set the icon color.
+                        webViewThemeImageView.setSelected(false);
 
                         // Hide the WebView theme text view.
                         webViewThemeTextView.setVisibility(View.GONE);
@@ -1514,28 +1391,24 @@ public class DomainSettingsFragment extends Fragment {
                 // Update the icon and the visibility of the wide viewport text view.
                 switch (position) {
                     case DomainsDatabaseHelper.SYSTEM_DEFAULT:
-                        // Set the icon.
-                        if (defaultWideViewport) {  // Wide viewport is enabled by default.
-                            wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_enabled, null));
-                        } else {  // Wide viewport is disabled by default.
-                            wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_disabled, null));
-                        }
+                        // Set the icon color.
+                        wideViewportImageView.setSelected(defaultWideViewport);
 
                         // Show the wide viewport text view.
                         wideViewportTextView.setVisibility(View.VISIBLE);
                         break;
 
                     case DomainsDatabaseHelper.ENABLED:
-                        // Set the icon according to the theme.
-                        wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_enabled, null));
+                        // Set the icon color.
+                        wideViewportImageView.setSelected(true);
 
                         // Hide the wide viewport text view.
                         wideViewportTextView.setVisibility(View.GONE);
                         break;
 
                     case DomainsDatabaseHelper.DISABLED:
-                        // Set the icon.
-                        wideViewportImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.wide_viewport_disabled, null));
+                        // Set the icon color.
+                        wideViewportImageView.setSelected(false);
 
                         // Hid ethe wide viewport text view.
                         wideViewportTextView.setVisibility(View.GONE);
@@ -1556,29 +1429,24 @@ public class DomainSettingsFragment extends Fragment {
                 // Update the icon and the visibility of the display images text view.
                 switch (position) {
                     case DomainsDatabaseHelper.SYSTEM_DEFAULT:
-                        if (defaultDisplayWebpageImages) {  // Display webpage images is enabled by default.
-                            // Set the icon.
-                            displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_enabled, null));
-                        } else {  // Display webpage images is disabled by default.
-                            // Set the icon.
-                            displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_disabled, null));
-                        }
+                        // Set the icon color.
+                        displayWebpageImagesImageView.setSelected(defaultDisplayWebpageImages);
 
                         // Show the display images text view.
                         displayImagesTextView.setVisibility(View.VISIBLE);
                         break;
 
                     case DomainsDatabaseHelper.ENABLED:
-                        // Set the icon.
-                        displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_enabled, null));
+                        // Set the icon color.
+                        displayWebpageImagesImageView.setSelected(true);
 
                         // Hide the display images text view.
                         displayImagesTextView.setVisibility(View.GONE);
                         break;
 
                     case DomainsDatabaseHelper.DISABLED:
-                        // Set the icon.
-                        displayWebpageImagesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.images_disabled, null));
+                        // Set the icon color.
+                        displayWebpageImagesImageView.setSelected(false);
 
                         // Hide the display images text view.
                         displayImagesTextView.setVisibility(View.GONE);
@@ -1594,11 +1462,11 @@ public class DomainSettingsFragment extends Fragment {
         
         // Set the pinned SSL certificate switch listener.
         pinnedSslCertificateSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {  // SSL certificate pinning is enabled.
-                // Set the icon.
-                pinnedSslCertificateImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_enabled, null));
+            // Update the icon color.
+            pinnedSslCertificateImageView.setSelected(isChecked);
 
+            // Update the views.
+            if (isChecked) {  // SSL certificate pinning is enabled.
                 // Update the visibility of the saved SSL certificate.
                 if (savedSslIssuedToCNameString == null) {
                     savedSslCardView.setVisibility(View.GONE);
@@ -1669,9 +1537,6 @@ public class DomainSettingsFragment extends Fragment {
                     noCurrentWebsiteCertificateTextView.getParent().requestChildFocus(noCurrentWebsiteCertificateTextView, noCurrentWebsiteCertificateTextView);
                 }
             } else {  // SSL certificate pinning is disabled.
-                // Set the icon.
-                pinnedSslCertificateImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_disabled, null));
-
                 // Hide the SSl certificates and instructions.
                 savedSslCardView.setVisibility(View.GONE);
                 currentSslCardView.setVisibility(View.GONE);
@@ -1757,11 +1622,11 @@ public class DomainSettingsFragment extends Fragment {
 
         // Set the pinned IP addresses switch listener.
         pinnedIpAddressesSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> {
-            // Update the icon.
-            if (isChecked) {  // IP addresses pinning is enabled.
-                // Set the icon.
-                pinnedIpAddressesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_enabled, null));
+            // Update the icon color.
+            pinnedIpAddressesImageView.setSelected(isChecked);
 
+            // Update the views.
+            if (isChecked) {  // IP addresses pinning is enabled.
                 // Update the visibility of the saved IP addresses card view.
                 if (savedIpAddresses == null) {  // There are no saved IP addresses.
                     savedIpAddressesCardView.setVisibility(View.GONE);
@@ -1810,9 +1675,6 @@ public class DomainSettingsFragment extends Fragment {
                 // Scroll to the bottom of the card views.
                 currentIpAddressesCardView.getParent().requestChildFocus(currentIpAddressesCardView, currentIpAddressesCardView);
             } else {  // IP addresses pinning is disabled.
-                // Set the icon.
-                pinnedIpAddressesImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ssl_certificate_disabled, null));
-
                 // Hide the IP addresses card views.
                 savedIpAddressesCardView.setVisibility(View.GONE);
                 currentIpAddressesCardView.setVisibility(View.GONE);
index 9d58eef07fd1fe0a46047756337f905e34c9f066..c5401d457fedd318904f0292bcd4f43f4cf5b144 100644 (file)
@@ -31,7 +31,7 @@ import androidx.preference.PreferenceManager
 import com.stoutner.privacybrowser.R
 
 // The private constants.
-private const val SCHEMA_VERSION = 13
+private const val SCHEMA_VERSION = 14
 
 class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(appContext, DOMAINS_DATABASE, null, SCHEMA_VERSION) {
     // Define the public companion object constants.  These can be moved to public class constants once the entire project has migrated to Kotlin.
@@ -62,6 +62,7 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
         const val ENABLE_ULTRAPRIVACY = "enableultraprivacy"
         const val BLOCK_ALL_THIRD_PARTY_REQUESTS = "blockallthirdpartyrequests"
         const val USER_AGENT = "useragent"
+        const val X_REQUESTED_WITH_HEADER = "x_requested_with_header"
         const val FONT_SIZE = "fontsize"
         const val SWIPE_TO_REFRESH = "swipetorefresh"
         const val WEBVIEW_THEME = "webview_theme"
@@ -95,6 +96,7 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
                 "$ENABLE_ULTRAPRIVACY BOOLEAN, " +
                 "$BLOCK_ALL_THIRD_PARTY_REQUESTS BOOLEAN, " +
                 "$USER_AGENT TEXT, " +
+                "$X_REQUESTED_WITH_HEADER INTEGER, " +
                 "$FONT_SIZE INTEGER, " +
                 "$SWIPE_TO_REFRESH INTEGER, " +
                 "$WEBVIEW_THEME INTEGER, " +
@@ -255,6 +257,12 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
             // Copy the data from the old column to the new one.
             domainsDatabase.execSQL("UPDATE $DOMAINS_TABLE SET $COOKIES = enablefirstpartycookies")
         }
+
+        // Upgrade from schema version 13, first used in Privacy Browser 3.8, to schema version 14, first used in Privacy Browser 3.11.
+        if (oldVersion < 14) {
+            // Add the X-Requested-With header column.  This defaults to `0`, which is `System default`, so a separate step isn't needed to populate the column.
+            domainsDatabase.execSQL("ALTER TABLE $DOMAINS_TABLE ADD COLUMN $X_REQUESTED_WITH_HEADER INTEGER")
+        }
     }
 
     val completeCursorOrderedByDomain: Cursor
@@ -336,6 +344,7 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
         domainContentValues.put(ENABLE_ULTRAPRIVACY, ultraPrivacy)
         domainContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, blockAllThirdPartyRequests)
         domainContentValues.put(USER_AGENT, "System default user agent")
+        domainContentValues.put(X_REQUESTED_WITH_HEADER, 0)
         domainContentValues.put(FONT_SIZE, 0)
         domainContentValues.put(SWIPE_TO_REFRESH, 0)
         domainContentValues.put(WEBVIEW_THEME, 0)
@@ -367,8 +376,9 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
     }
 
     fun updateDomain(databaseId: Int, domainName: String, javaScript: Boolean, cookies: Boolean, domStorage: Boolean, formData: Boolean, easyList: Boolean, easyPrivacy: Boolean, fanboysAnnoyance: Boolean,
-                     fanboysSocialBlocking: Boolean, ultraList: Boolean, ultraPrivacy: Boolean, blockAllThirdPartyRequests: Boolean, userAgent: String, fontSize: Int, swipeToRefresh: Int, webViewTheme: Int,
-                     wideViewport: Int, displayImages: Int, pinnedSslCertificate: Boolean, pinnedIpAddresses: Boolean) {
+                     fanboysSocialBlocking: Boolean, ultraList: Boolean, ultraPrivacy: Boolean, blockAllThirdPartyRequests: Boolean, userAgent: String, xRequestedWithHeader: Int, fontSize: Int,
+                     swipeToRefresh: Int, webViewTheme: Int, wideViewport: Int, displayImages: Int, pinnedSslCertificate: Boolean, pinnedIpAddresses: Boolean) {
+
         // Instantiate a content values.
         val domainContentValues = ContentValues()
 
@@ -386,6 +396,7 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
         domainContentValues.put(ENABLE_ULTRAPRIVACY, ultraPrivacy)
         domainContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, blockAllThirdPartyRequests)
         domainContentValues.put(USER_AGENT, userAgent)
+        domainContentValues.put(X_REQUESTED_WITH_HEADER, xRequestedWithHeader)
         domainContentValues.put(FONT_SIZE, fontSize)
         domainContentValues.put(SWIPE_TO_REFRESH, swipeToRefresh)
         domainContentValues.put(WEBVIEW_THEME, webViewTheme)
diff --git a/app/src/main/res/color/blue_icon_selector.xml b/app/src/main/res/color/blue_icon_selector.xml
new file mode 100644 (file)
index 0000000..f088f1f
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
+
+  Privacy Browser Android is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  Privacy Browser Android is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Set the icon tint color based on the state. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android" >
+    <item android:state_enabled="false" android:color="@color/ghosted_icon" />
+    <item android:state_selected="true" android:color="@color/blue_icon" />
+    <item android:state_selected="false" android:color="@color/disabled_icon" />
+</selector>
\ No newline at end of file
index 95f2be6629351b207882b8fe920ce51a7524e97f..8d5da9800093eb4ac8d3b8158a2e067a13a815d5 100644 (file)
@@ -58,7 +58,7 @@
                 android:text="@string/privacy_browser"
                 android:textStyle="bold"
                 android:textSize="22sp"
-                android:textColor="?attr/blueTitleTextColor"
+                android:textColor="@color/blue_title_text"
                 android:paddingTop="12dp"
                 android:layout_toEndOf="@id/icon" />
 
@@ -66,7 +66,7 @@
                 android:id="@+id/version"
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:textColor="?attr/blueTextColor"
+                android:textColor="@color/alt_blue_text"
                 android:textIsSelectable="true"
                 android:layout_below="@id/privacy_browser_textview"
                 android:layout_toEndOf="@id/icon" />
@@ -90,7 +90,7 @@
                 android:text="@string/hardware"
                 android:textStyle="bold"
                 android:textSize="18sp"
-                android:textColor="?attr/blueTitleTextColor" />
+                android:textColor="@color/blue_title_text" />
 
             <TextView
                 android:id="@+id/brand"
                 android:text="@string/software"
                 android:textStyle="bold"
                 android:textSize="18sp"
-                android:textColor="?attr/blueTitleTextColor"
+                android:textColor="@color/blue_title_text"
                 android:paddingTop="12dp" />
 
             <TextView
                 android:text="@string/memory_usage"
                 android:textStyle="bold"
                 android:textSize="18sp"
-                android:textColor="?attr/blueTitleTextColor"
+                android:textColor="@color/blue_title_text"
                 android:paddingTop="12dp" />
 
             <TextView
                 android:text="@string/blocklists"
                 android:textStyle="bold"
                 android:textSize="18sp"
-                android:textColor="?attr/blueTitleTextColor"
+                android:textColor="@color/blue_title_text"
                 android:paddingTop="12dp" />
 
             <TextView
                 android:text="@string/package_signature"
                 android:textStyle="bold"
                 android:textSize="18sp"
-                android:textColor="?attr/blueTitleTextColor"
+                android:textColor="@color/blue_title_text"
                 android:paddingTop="12dp" />
 
             <TextView
index 48d3590d540d2027fa379539b50d7e902c96d74e..c6be32b203ad8e9be2791dab117983c23be903e4 100644 (file)
@@ -53,7 +53,7 @@
                     android:layout_marginBottom="12dp"
                     android:layout_gravity="bottom"
                     android:src="@drawable/domains"
-                    app:tint="?attr/domainSettingsIconTintColor"
+                    app:tint="@color/blue_icon"
                     tools:ignore="contentDescription" />
 
                 <!-- `TextInputLayout` makes the `android:hint` float above the `EditText`. -->
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/block_ads_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/block_tracking_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/social_media_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/social_media_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/block_ads_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/block_tracking_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                 android:layout_marginTop="1dp"
                 android:layout_marginEnd="10dp"
                 android:layout_gravity="center_vertical"
+                android:src="@drawable/block_all_third_party_requests_enabled"
+                app:tint="@color/blue_icon_selector"
                 tools:ignore="contentDescription" />
 
             <androidx.appcompat.widget.SwitchCompat
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
                     android:src="@drawable/user_agent"
-                    app:tint="?attr/domainSettingsIconTintColor"
+                    app:tint="@color/blue_icon"
                     android:contentDescription="@string/user_agent" />
 
                 <Spinner
 
             <TextView
                 android:id="@+id/user_agent_textview"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
                 android:layout_marginEnd="36dp"
                 android:importantForAutofill="no" />
         </LinearLayout>
 
+        <!-- X-Requested-With Header. -->
+        <LinearLayout
+            android:layout_height="wrap_content"
+            android:layout_width="match_parent"
+            android:orientation="vertical"
+            android:layout_marginTop="14dp"
+            android:layout_marginBottom="14dp" >
+
+            <LinearLayout
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:orientation="horizontal" >
+
+                <ImageView
+                    android:id="@+id/x_requested_with_header_imageview"
+                    android:layout_height="wrap_content"
+                    android:layout_width="wrap_content"
+                    android:layout_marginTop="1dp"
+                    android:layout_marginEnd="10dp"
+                    android:layout_gravity="center_vertical"
+                    android:src="@drawable/x_requested_with_header_enabled"
+                    app:tint="@color/blue_icon_selector"
+                    android:contentDescription="@string/x_requested_with_header" />
+
+                <Spinner
+                    android:id="@+id/x_requested_with_header_spinner"
+                    android:layout_height="wrap_content"
+                    android:layout_width="match_parent" />
+            </LinearLayout>
+
+            <TextView
+                android:id="@+id/x_requested_with_header_textview"
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:layout_marginStart="45dp"
+                android:layout_marginEnd="36dp"
+                android:textSize="13sp" />
+        </LinearLayout>
+
         <!-- Font Size. -->
         <LinearLayout
             android:layout_height="wrap_content"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
                     android:src="@drawable/font_size"
-                    app:tint="?attr/domainSettingsIconTintColor"
+                    app:tint="@color/blue_icon"
                     android:contentDescription="@string/font_size" />
 
                 <Spinner
 
             <TextView
                 android:id="@+id/default_font_size_textview"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
                 android:layout_marginEnd="36dp"
                     android:layout_marginTop="1dp"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
+                    android:src="@drawable/refresh_enabled"
+                    app:tint="@color/blue_icon_selector"
                     android:contentDescription="@string/swipe_to_refresh" />
 
                 <Spinner
 
             <TextView
                 android:id="@+id/swipe_to_refresh_textview"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
                 android:layout_marginEnd="36dp"
                     android:layout_marginTop="1dp"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
+                    android:src="@drawable/webview_light_theme"
+                    app:tint="@color/blue_icon_selector"
                     android:contentDescription="@string/webview_theme" />
 
                 <Spinner
 
             <TextView
                 android:id="@+id/webview_theme_textview"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
                 android:layout_marginEnd="36dp"
                     android:layout_marginTop="1dp"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
+                    android:src="@drawable/wide_viewport_enabled"
+                    app:tint="@color/blue_icon_selector"
                     android:contentDescription="@string/wide_viewport" />
 
                 <Spinner
 
             <TextView
                 android:id="@+id/wide_viewport_textview"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
                 android:layout_marginEnd="36dp"
                     android:layout_marginTop="1dp"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
+                    android:src="@drawable/images_enabled"
+                    app:tint="@color/blue_icon_selector"
                     android:contentDescription="@string/display_webpage_images" />
 
                 <Spinner
 
             <TextView
                 android:id="@+id/display_webpage_images_textview"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
                 android:layout_marginEnd="36dp"
                     android:layout_marginTop="1dp"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
+                    android:src="@drawable/ssl_certificate_enabled"
+                    app:tint="@color/blue_icon_selector"
                     tools:ignore="contentDescription" />
 
                 <androidx.appcompat.widget.SwitchCompat
                             android:text="@string/issued_to"
                             android:textAllCaps="true"
                             android:textStyle="bold"
-                            android:textColor="?attr/blueTitleTextColor" />
+                            android:textColor="@color/blue_title_text" />
 
                         <TextView
                             android:id="@+id/saved_ssl_certificate_issued_to_cname"
                             android:text="@string/issued_by"
                             android:textAllCaps="true"
                             android:textStyle="bold"
-                            android:textColor="?attr/blueTitleTextColor"/>
+                            android:textColor="@color/blue_title_text"/>
 
                         <TextView
                             android:id="@+id/saved_ssl_certificate_issued_by_cname"
                             android:text="@string/valid_dates"
                             android:textAllCaps="true"
                             android:textStyle="bold"
-                            android:textColor="?attr/blueTitleTextColor"/>
+                            android:textColor="@color/blue_title_text"/>
 
                         <TextView
                             android:id="@+id/saved_ssl_certificate_start_date"
                             android:text="@string/issued_to"
                             android:textAllCaps="true"
                             android:textStyle="bold"
-                            android:textColor="?attr/blueTitleTextColor" />
+                            android:textColor="@color/blue_title_text" />
 
                         <TextView
                             android:id="@+id/current_website_certificate_issued_to_cname"
                             android:text="@string/issued_by"
                             android:textAllCaps="true"
                             android:textStyle="bold"
-                            android:textColor="?attr/blueTitleTextColor" />
+                            android:textColor="@color/blue_title_text" />
 
                         <TextView
                             android:id="@+id/current_website_certificate_issued_by_cname"
                             android:text="@string/valid_dates"
                             android:textAllCaps="true"
                             android:textStyle="bold"
-                            android:textColor="?attr/blueTitleTextColor" />
+                            android:textColor="@color/blue_title_text" />
 
                         <TextView
                             android:id="@+id/current_website_certificate_start_date"
                     android:layout_marginTop="1dp"
                     android:layout_marginEnd="10dp"
                     android:layout_gravity="center_vertical"
+                    android:src="@drawable/ssl_certificate_enabled"
+                    app:tint="@color/blue_icon_selector"
                     tools:ignore="contentDescription" />
 
                 <androidx.appcompat.widget.SwitchCompat
                         android:layout_height="wrap_content"
                         android:layout_width="match_parent"
                         android:layout_marginStart="32dp"
-                        android:textColor="?attr/blueTextColor" />
+                        android:textColor="@color/blue_text" />
                 </LinearLayout>
             </androidx.cardview.widget.CardView>
 
                         android:layout_height="wrap_content"
                         android:layout_width="match_parent"
                         android:layout_marginStart="32dp"
-                        android:textColor="?attr/blueTextColor" />
+                        android:textColor="@color/blue_text" />
                 </LinearLayout>
             </androidx.cardview.widget.CardView>
         </LinearLayout>
index 66254f9d2a980aee37fc92bcc076c531d2b36287..2802a2d339973aeba0f8087edb950384faed5f35 100644 (file)
@@ -33,7 +33,7 @@
         android:text="@string/domain"
         android:textAllCaps="true"
         android:textStyle="bold"
-        android:textColor="?attr/blueTitleTextColor" />
+        android:textColor="@color/blue_title_text" />
 
     <TextView
         android:id="@+id/domain_name"
@@ -54,7 +54,7 @@
         android:text="@string/issued_to"
         android:textAllCaps="true"
         android:textStyle="bold"
-        android:textColor="?attr/blueTitleTextColor" />
+        android:textColor="@color/blue_title_text" />
 
     <TextView
         android:id="@+id/issued_to_cname"
@@ -80,7 +80,7 @@
         android:text="@string/issued_by"
         android:textAllCaps="true"
         android:textStyle="bold"
-        android:textColor="?attr/blueTitleTextColor" />
+        android:textColor="@color/blue_title_text" />
 
     <TextView
         android:id="@+id/issued_by_cname"
         android:text="@string/valid_dates"
         android:textAllCaps="true"
         android:textStyle="bold"
-        android:textColor="?attr/blueTitleTextColor" />
+        android:textColor="@color/blue_title_text" />
 
     <TextView
         android:id="@+id/start_date"
index d4249bb1fddf1160b57d6634686d2cd844a26c85..a3250ca5f0420562d2f5f4741519c68e1b2a0bff 100644 (file)
@@ -45,7 +45,7 @@
             android:text="@string/url"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/url"
@@ -66,7 +66,7 @@
             android:text="@string/issued_to"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/issued_to_cname"
@@ -93,7 +93,7 @@
             android:text="@string/issued_by"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/issued_by_cname"
             android:text="@string/valid_dates"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/start_date"
index 224961417a5a6eb16a9cb5aebf211dd3625c03cd..7fafac749ba56c3a48069af883d2fcf9bddfedd7 100644 (file)
@@ -36,7 +36,7 @@
             android:layout_width="match_parent"
             android:text="@string/disposition"
             android:textSize="12sp"
-            android:textColor="?attr/blueTextColor"
+            android:textColor="@color/blue_text"
             android:layout_marginTop="5dp" />
 
         <TextView
@@ -53,7 +53,7 @@
             android:layout_width="match_parent"
             android:text="@string/url"
             android:textSize="12sp"
-            android:textColor="?attr/blueTextColor"
+            android:textColor="@color/blue_text"
             android:layout_marginTop="10dp" />
 
         <TextView
@@ -71,7 +71,7 @@
             android:layout_width="match_parent"
             android:text="@string/blocklist"
             android:textSize="12sp"
-            android:textColor="?attr/blueTextColor"
+            android:textColor="@color/blue_text"
             android:layout_marginTop="10dp" />
 
         <TextView
@@ -89,7 +89,7 @@
             android:layout_width="match_parent"
             android:text="@string/sublist"
             android:textSize="12sp"
-            android:textColor="?attr/blueTextColor"
+            android:textColor="@color/blue_text"
             android:layout_marginTop="10dp" />
 
         <TextView
             android:layout_width="match_parent"
             android:text="@string/blocklist_entries"
             android:textSize="12sp"
-            android:textColor="?attr/blueTextColor"
+            android:textColor="@color/blue_text"
             android:layout_marginTop="10dp" />
 
         <TextView
             android:layout_width="match_parent"
             android:text="@string/blocklist_original_entry"
             android:textSize="12sp"
-            android:textColor="?attr/blueTextColor"
+            android:textColor="@color/blue_text"
             android:layout_marginTop="10dp" />
 
         <TextView
index 065e20637f2f59fb393f017888ca590fd073678c..74aab01a97c9e296bbfe38fd18ddba60a8695028 100644 (file)
@@ -19,7 +19,8 @@
   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
 
 <!-- Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
-<androidx.coordinatorlayout.widget.CoordinatorLayout android:id="@+id/view_source_coordinatorlayout"
+<androidx.coordinatorlayout.widget.CoordinatorLayout
+    android:id="@+id/view_source_coordinatorlayout"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_height="match_parent"
@@ -61,7 +62,7 @@
                         android:text="@string/request_headers"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
@@ -79,7 +80,7 @@
                         android:text="@string/response_message"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
@@ -97,7 +98,7 @@
                         android:layout_width="match_parent"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
                         android:layout_width="match_parent"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
index fe7841e0d9bf4c2f220986bb8ebdb9d1670c74a6..bb8c597dc224706b81edadc19fda2fcd2c11163f 100644 (file)
@@ -90,7 +90,7 @@
                         android:text="@string/request_headers"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
                         android:text="@string/response_message"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
                         android:layout_width="match_parent"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
                         android:layout_width="match_parent"
                         android:textAlignment="center"
                         android:textSize="18sp"
-                        android:textColor="?attr/blueTextColor"
+                        android:textColor="@color/blue_text"
                         android:textStyle="bold" />
 
                     <TextView
index a4ea0e4e12150f2f818c9265fadab388cfc6205e..6654f29ecd396176c68dd568b5715963a5979cc1 100644 (file)
@@ -37,7 +37,7 @@
             android:text="@string/domain"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/domain"
@@ -57,7 +57,7 @@
             android:text="@string/issued_to"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/issued_to_cname"
@@ -83,7 +83,7 @@
             android:text="@string/issued_by"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/issued_by_cname"
             android:text="@string/valid_dates"
             android:textAllCaps="true"
             android:textStyle="bold"
-            android:textColor="?attr/blueTitleTextColor" />
+            android:textColor="@color/blue_title_text" />
 
         <TextView
             android:id="@+id/start_date"
index dbc07162937829251c00fadb9951d91948d872d5..bf43d8377cbc6c70e4316f4f82ea7b17be78e136 100644 (file)
         <!-- Colors.  -->
         <item name="android:actionModeBackground">?android:attr/colorBackground</item>
         <item name="android:textColorHighlight">@color/violet_700</item>
-        <item name="blueTextColor">@color/violet_700</item>
-        <item name="blueTitleTextColor">@color/violet_500</item>
         <item name="buttonBackgroundColorSelector">@color/button_background_color_selector_night</item>
         <item name="buttonTextColorSelector">@color/button_text_color_selector_night</item>
         <item name="colorAccent">@color/violet_500</item>
         <item name="redTextColor">@color/red_900</item>
 
         <!-- Tints. -->
-        <item name="domainSettingsIconTintColor">@color/violet_500</item>
         <item name="fabIconTintColor">@color/gray_875</item>
         <item name="findOnPageIconTintColor">@color/violet_500</item>
         <item name="navigationIconTintColor">@color/violet_500</item>
index d07e87fb443df6651bca9b0023ed8231a9311c20..39633670699bf5f3369c94b2a1c8074dfeb62c55 100644 (file)
 
 <resources>
     <!-- Nicknamed colors. -->
-    <color name="about_version_blue_text">@color/violet_700</color>
+    <color name="alt_blue_text">@color/violet_700</color>
     <color name="blue_icon">@color/violet_500</color>
     <color name="blue_text">@color/violet_500</color>
+    <color name="blue_title_text">@color/violet_500</color>
     <color name="disabled_icon">@color/gray_500</color>
     <color name="ghosted_icon">@color/gray_700</color>
     <color name="icon">@color/white</color>
index 77a3d1f6e6f777bf240a8098561a88e029c22ea6..3ad61ec91213f8527d7b79df7d77cb5e49a985c6 100644 (file)
         <!-- Colors.  -->
         <item name="android:actionModeBackground">?android:attr/colorBackground</item>
         <item name="android:textColorHighlight">@color/violet_700</item>
-        <item name="blueTextColor">@color/violet_700</item>
-        <item name="blueTitleTextColor">@color/violet_500</item>
         <item name="buttonBackgroundColorSelector">@color/button_background_color_selector_night</item>
         <item name="buttonTextColorSelector">@color/button_text_color_selector_night</item>
         <item name="colorAccent">@color/violet_500</item>
         <item name="redTextColor">@color/red_900</item>
 
         <!-- Tints. -->
-        <item name="domainSettingsIconTintColor">@color/violet_500</item>
         <item name="fabIconTintColor">@color/gray_875</item>
         <item name="findOnPageIconTintColor">@color/violet_500</item>
         <item name="navigationIconTintColor">@color/violet_500</item>
index e0010ebbd67595aff1acf532389f9692918943b5..1a670d419adf18056b98eeada5586893283cc27a 100644 (file)
         <!-- Colors. -->
         <item name="android:actionModeBackground">?android:attr/colorBackground</item>
         <item name="android:textColorHighlight">@color/blue_200</item>
-        <item name="blueTextColor">@color/blue_700</item>
-        <item name="blueTitleTextColor">@color/blue_900</item>
         <item name="buttonBackgroundColorSelector">@color/button_background_color_selector_day</item>
         <item name="buttonTextColorSelector">@color/button_text_color_selector_day</item>
         <item name="colorAccent">@color/blue_700</item>
         <item name="redTextColor">@color/red_a700</item>
 
         <!-- Tints. -->
-        <item name="domainSettingsIconTintColor">@color/blue_800</item>
         <item name="fabIconTintColor">@color/white</item>
         <item name="findOnPageIconTintColor">@color/blue_800</item>
         <item name="navigationIconTintColor">@color/blue_800</item>
index 5331ec07fd847c301b12665b4f0a25bf33253e6b..5babdef6f67be48b35cf134d07f4556c7feba22b 100644 (file)
     <!-- Colors. -->
     <attr name="aboutBackground" format="color" />
     <attr name="activatedListViewItemBackground" format="color" />
-    <attr name="blueTextColor" format="color" />
-    <attr name="blueTitleTextColor" format="color" />
     <attr name="buttonBackgroundColorSelector" format="color" />
     <attr name="buttonTextColorSelector" format="color" />
     <attr name="redTextColor" format="color" />
 
     <!-- Tint Colors. -->
-    <attr name="domainSettingsIconTintColor" format="color" />
     <attr name="fabIconTintColor" format="color" />
     <attr name="findOnPageIconTintColor" format="color" />
     <attr name="navigationIconTintColor" format="color" />
index 3045569c984d754cf55e75ed65496effa5cb60b4..275d8645d295054d53352be92e230ba0a0877559 100644 (file)
 
 <resources>
     <!-- Nicknamed colors. -->
-    <color name="about_version_blue_text">@color/blue_700</color>
+    <color name="alt_blue_text">@color/blue_700</color>
     <color name="blue_icon">@color/blue_800</color>
     <color name="blue_text">@color/blue_700</color>
+    <color name="blue_title_text">@color/blue_900</color>
     <color name="disabled_icon">@color/gray_600</color>
     <color name="ghosted_icon">@color/gray_425</color>
     <color name="icon">@color/gray_925</color>
index 4f9ce7f399ad337fc9bfd498b504ba8325394b69..9d9fc616a38b2bce2dcf64575294019c0b51e77c 100644 (file)
     <string name="domain_name">Domain name</string>
     <string name="domain_deleted">Domain deleted</string>
     <string name="domain_name_instructions">*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com)</string>
+    <string-array name="x_requested_with_header_array">
+        <item>System default</item>
+        <item>X-Requested-With header enabled</item>
+        <item>X-Requested-With header disabled</item>
+    </string-array>
     <string-array name="font_size_array">
         <item>System default</item>
         <item>Custom font size</item>
index 4f19586a7d9a86d9198d2304457d8928fe603d20..dcf4cab404c6f59b36942c3c240d625ed7f37d18 100644 (file)
         <!-- Colors. -->
         <item name="android:actionModeBackground">?android:attr/colorBackground</item>
         <item name="android:textColorHighlight">@color/blue_200</item>
-        <item name="blueTextColor">@color/blue_700</item>
-        <item name="blueTitleTextColor">@color/blue_900</item>
         <item name="buttonBackgroundColorSelector">@color/button_background_color_selector_day</item>
         <item name="buttonTextColorSelector">@color/button_text_color_selector_day</item>
         <item name="colorAccent">@color/blue_700</item>
         <item name="redTextColor">@color/red_a700</item>
 
         <!-- Tints. -->
-        <item name="domainSettingsIconTintColor">@color/blue_800</item>
         <item name="fabIconTintColor">@color/white</item>
         <item name="findOnPageIconTintColor">@color/blue_800</item>
         <item name="navigationIconTintColor">@color/blue_800</item>
index a27c1d83a5019d42410a4e2c4b04916e75e7d628..14396430866ee7ce33c59cb24e0b30578c4b7b20 100644 (file)
@@ -18,7 +18,9 @@
   You should have received a copy of the GNU General Public License
   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+
     <PreferenceCategory
         android:key="privacy"
         android:title="@string/privacy" >