From: Soren Stoutner <soren@stoutner.com>
Date: Thu, 17 Nov 2022 17:31:49 +0000 (-0700)
Subject: Fix a crash on new installs. https://redmine.stoutner.com/issues/925
X-Git-Tag: v3.12.1~1
X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=44a7a1d29d8e4722e2ea522075878a13b89bcb52;p=PrivacyBrowserAndroid.git

Fix a crash on new installs. https://redmine.stoutner.com/issues/925
---

diff --git a/app/src/main/assets/de/about_changelog.html b/app/src/main/assets/de/about_changelog.html
index 9518b993..e9a8fb9f 100644
--- a/app/src/main/assets/de/about_changelog.html
+++ b/app/src/main/assets/de/about_changelog.html
@@ -33,8 +33,8 @@
     </head>
 
     <body>
-        <h3>3.12 (Version Code 61)</h3>
-        <p>16. November 2022 - Mindest-API 23, Ziel-API 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (Version Code 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16. November 2022</a> - Mindest-API 23, Ziel-API 33</p>
         <ul>
             <li>Add <a href="https://redmine.stoutner.com/issues/893">WebView DevTools</a> to the navigation menu.</li>
             <li>Make long-pressing a bookmark open it in a new <a href="https://redmine.stoutner.com/issues/912">foreground tab</a>.</li>
diff --git a/app/src/main/assets/en/about_changelog.html b/app/src/main/assets/en/about_changelog.html
index 9bb24785..3669314b 100644
--- a/app/src/main/assets/en/about_changelog.html
+++ b/app/src/main/assets/en/about_changelog.html
@@ -27,8 +27,8 @@
     </head>
 
     <body>
-        <h3>3.12 (version code 61)</h3>
-        <p>16 November 2022 - minimum API 23, target API 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (version code 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 November 2022</a> - minimum API 23, target API 33</p>
         <ul>
             <li>Add <a href="https://redmine.stoutner.com/issues/893">WebView DevTools</a> to the navigation menu.</li>
             <li>Make long-pressing a bookmark open it in a new <a href="https://redmine.stoutner.com/issues/912">foreground tab</a>.</li>
diff --git a/app/src/main/assets/en/guide_interface.html b/app/src/main/assets/en/guide_interface.html
index 0dfa4390..0f3bf03c 100644
--- a/app/src/main/assets/en/guide_interface.html
+++ b/app/src/main/assets/en/guide_interface.html
@@ -30,7 +30,7 @@
         <h3><svg class="header"><use href="../shared_images/bookmarks.svg#icon"/></svg> Bookmarks</h3>
 
         <p>The bookmark drawer may be opened by swiping from the right edge of the screen.
-            If Android's gesture navigation is enabled,
+            If Android’s gesture navigation is enabled,
             the drawer may be opened by long-pressing on the edge of the screen <a href="https://redmine.stoutner.com/boards/1/topics/243">until the drawer peaks out</a> and then swiping it open.
             Sometimes it can be difficult to get the bookmarks drawer to reliably peak on devices with curved edges, so it is also possible to open the bookmarks drawer from the options menu.</p>
 
diff --git a/app/src/main/assets/es/about_changelog.html b/app/src/main/assets/es/about_changelog.html
index c32134a5..0ec1b117 100644
--- a/app/src/main/assets/es/about_changelog.html
+++ b/app/src/main/assets/es/about_changelog.html
@@ -29,8 +29,8 @@
     </head>
 
     <body>
-        <h3>3.12 (código de versión 61)</h3>
-        <p>16 de noviembre de 2022 - API mínimo 23, API objetivo 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (código de versión 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 de noviembre de 2022</a> - API mínimo 23, API objetivo 33</p>
         <ul>
             <li>Añadir <a href="https://redmine.stoutner.com/issues/893">DevTools de WebView</a> al menú de navegación.</li>
             <li>Hacer que al pulsar prolongadamente un marcador se abra en una nueva <a href="https://redmine.stoutner.com/issues/912">pestaña de primer plano</a>.</li>
diff --git a/app/src/main/assets/fr/about_changelog.html b/app/src/main/assets/fr/about_changelog.html
index 73be3315..45818397 100644
--- a/app/src/main/assets/fr/about_changelog.html
+++ b/app/src/main/assets/fr/about_changelog.html
@@ -29,8 +29,8 @@
     </head>
 
     <body>
-        <h3>3.12 (version du code 61)</h3>
-        <p>16 Novembre 2022 - API minimale : 23, API optimale : 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (version du code 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 Novembre 2022</a> - API minimale : 23, API optimale : 33</p>
         <ul>
             <li>Ajout de l'accès <a href="https://redmine.stoutner.com/issues/893">aux outils de développement Webview</a> dans le menu de navigation.</li>
             <li>Une pression longue sur un favori permet de l'ouvrir dans <a href="https://redmine.stoutner.com/issues/912">un nouvel onglet au premier plan</a>.</li>
diff --git a/app/src/main/assets/it/about_changelog.html b/app/src/main/assets/it/about_changelog.html
index 7016b672..8e0a727e 100644
--- a/app/src/main/assets/it/about_changelog.html
+++ b/app/src/main/assets/it/about_changelog.html
@@ -29,8 +29,8 @@
     </head>
 
     <body>
-        <h3>3.12 (versione codice 61)</h3>
-        <p>16 Novembre 2022 - minima API 23, target API 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (versione codice 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 Novembre 2022</a> - minima API 23, target API 33</p>
         <ul>
             <li>Add <a href="https://redmine.stoutner.com/issues/893">WebView DevTools</a> to the navigation menu.</li>
             <li>Make long-pressing a bookmark open it in a new <a href="https://redmine.stoutner.com/issues/912">foreground tab</a>.</li>
diff --git a/app/src/main/assets/pt-rBR/about_changelog.html b/app/src/main/assets/pt-rBR/about_changelog.html
index 61e79a90..ec186c91 100644
--- a/app/src/main/assets/pt-rBR/about_changelog.html
+++ b/app/src/main/assets/pt-rBR/about_changelog.html
@@ -29,8 +29,8 @@
     </head>
 
     <body>
-        <h3>3.12 (version code 61)</h3>
-        <p>16 November 2022 - API mínimo 23, API alvo 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (version code 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 November 2022</a> - API mínimo 23, API alvo 33</p>
         <ul>
             <li>Add <a href="https://redmine.stoutner.com/issues/893">WebView DevTools</a> to the navigation menu.</li>
             <li>Make long-pressing a bookmark open it in a new <a href="https://redmine.stoutner.com/issues/912">foreground tab</a>.</li>
diff --git a/app/src/main/assets/pt-rBR/guide_interface.html b/app/src/main/assets/pt-rBR/guide_interface.html
index 8b64b906..3afad7b1 100644
--- a/app/src/main/assets/pt-rBR/guide_interface.html
+++ b/app/src/main/assets/pt-rBR/guide_interface.html
@@ -32,7 +32,7 @@
         <h3><svg class="header"><use href="../shared_images/bookmarks.svg#icon"/></svg> Bookmarks</h3>
 
         <p>The bookmark drawer may be opened by swiping from the right edge of the screen.
-            If Android's gesture navigation is enabled,
+            If Android’s gesture navigation is enabled,
             the drawer may be opened by long-pressing on the edge of the screen <a href="https://redmine.stoutner.com/boards/1/topics/243">until the drawer peaks out</a> and then swiping it open.
             Sometimes it can be difficult to get the bookmarks drawer to reliably peak on devices with curved edges, so it is also possible to open the bookmarks drawer from the options menu.</p>
 
diff --git a/app/src/main/assets/ru/about_changelog.html b/app/src/main/assets/ru/about_changelog.html
index cb4dfee3..c4d0e797 100644
--- a/app/src/main/assets/ru/about_changelog.html
+++ b/app/src/main/assets/ru/about_changelog.html
@@ -27,8 +27,8 @@
     </head>
 
     <body>
-        <h3>3.12 (код версии 61)</h3>
-        <p>16 Ноябрь 2022 года - минимальный API 23, целевой API 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (код версии 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 Ноябрь 2022 года</a> - минимальный API 23, целевой API 33</p>
         <ul>
             <li>В меню навигации добавлены инструменты <a href="https://redmine.stoutner.com/issues/893">WebView DevTools</a>.</li>
             <li>Длительное нажатие на закладку откроет ее в новой вкладке <a href="https://redmine.stoutner.com/issues/912">на переднем плане</a>.</li>
diff --git a/app/src/main/assets/tr/about_changelog.html b/app/src/main/assets/tr/about_changelog.html
index f82c9c3d..2b7fc7ed 100644
--- a/app/src/main/assets/tr/about_changelog.html
+++ b/app/src/main/assets/tr/about_changelog.html
@@ -27,8 +27,8 @@
     </head>
 
     <body>
-        <h3>3.12 (version code 61)</h3>
-        <p>16 November 2022 - minimum API 23, target API 33</p>
+        <h3><a href="https://www.stoutner.com/privacy-browser-3-12/">3.12</a> (version code 61)</h3>
+        <p><a href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff;h=60846bcbf234ed7452af94f080f3da3133ce674c">16 November 2022</a> - minimum API 23, target API 33</p>
         <ul>
             <li>Add <a href="https://redmine.stoutner.com/issues/893">WebView DevTools</a> to the navigation menu.</li>
             <li>Make long-pressing a bookmark open it in a new <a href="https://redmine.stoutner.com/issues/912">foreground tab</a>.</li>
diff --git a/app/src/main/assets/tr/guide_interface.html b/app/src/main/assets/tr/guide_interface.html
index 0dfa4390..0f3bf03c 100644
--- a/app/src/main/assets/tr/guide_interface.html
+++ b/app/src/main/assets/tr/guide_interface.html
@@ -30,7 +30,7 @@
         <h3><svg class="header"><use href="../shared_images/bookmarks.svg#icon"/></svg> Bookmarks</h3>
 
         <p>The bookmark drawer may be opened by swiping from the right edge of the screen.
-            If Android's gesture navigation is enabled,
+            If Android’s gesture navigation is enabled,
             the drawer may be opened by long-pressing on the edge of the screen <a href="https://redmine.stoutner.com/boards/1/topics/243">until the drawer peaks out</a> and then swiping it open.
             Sometimes it can be difficult to get the bookmarks drawer to reliably peak on devices with curved edges, so it is also possible to open the bookmarks drawer from the options menu.</p>
 
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
index d7137e20..05bb2f58 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
@@ -31,7 +31,6 @@ import android.graphics.Typeface;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
 import android.util.SparseBooleanArray;
 import android.view.ActionMode;
 import android.view.Menu;
@@ -54,16 +53,17 @@ import androidx.appcompat.app.ActionBar;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 import androidx.fragment.app.DialogFragment;
+import androidx.preference.PreferenceManager;
 
 import com.google.android.material.floatingactionbutton.FloatingActionButton;
 import com.google.android.material.snackbar.Snackbar;
 
+import com.stoutner.privacybrowser.R;
 import com.stoutner.privacybrowser.dialogs.CreateBookmarkDialog;
 import com.stoutner.privacybrowser.dialogs.CreateBookmarkFolderDialog;
 import com.stoutner.privacybrowser.dialogs.EditBookmarkDialog;
 import com.stoutner.privacybrowser.dialogs.EditBookmarkFolderDialog;
 import com.stoutner.privacybrowser.dialogs.MoveToFolderDialog;
-import com.stoutner.privacybrowser.R;
 import com.stoutner.privacybrowser.helpers.BookmarksDatabaseHelper;
 
 import java.io.ByteArrayOutputStream;
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java
index da2ceda3..0560c017 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java
@@ -34,7 +34,6 @@ import android.graphics.Typeface;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
 import android.util.SparseBooleanArray;
 import android.view.ActionMode;
 import android.view.Menu;
@@ -61,6 +60,7 @@ import androidx.appcompat.widget.Toolbar;  // The AndroidX toolbar must be used
 import androidx.core.content.ContextCompat;
 import androidx.cursoradapter.widget.CursorAdapter;
 import androidx.fragment.app.DialogFragment;  // The AndroidX dialog fragment must be used or an error is produced on API <=22.
+import androidx.preference.PreferenceManager;
 
 import com.google.android.material.snackbar.Snackbar;
 
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java
index 4c48b426..5ff99d6f 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/ImportExportActivity.java
@@ -26,7 +26,6 @@ import android.content.pm.PackageManager;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
-import android.preference.PreferenceManager;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.view.View;
@@ -46,6 +45,7 @@ import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 import androidx.cardview.widget.CardView;
 import androidx.core.content.FileProvider;
+import androidx.preference.PreferenceManager;
 
 import com.google.android.material.snackbar.Snackbar;
 import com.google.android.material.textfield.TextInputLayout;
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
index 1ee31db4..f21b3c23 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
@@ -52,7 +52,6 @@ import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
 import android.os.Message;
-import android.preference.PreferenceManager;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
 import android.provider.DocumentsContract;
@@ -115,6 +114,7 @@ import androidx.core.view.GravityCompat;
 import androidx.drawerlayout.widget.DrawerLayout;
 import androidx.fragment.app.DialogFragment;
 import androidx.fragment.app.Fragment;
+import androidx.preference.PreferenceManager;
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 import androidx.viewpager.widget.ViewPager;
 import androidx.webkit.WebSettingsCompat;
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/RequestsActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/RequestsActivity.java
index 356d8b80..a35d482b 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/RequestsActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/RequestsActivity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2018-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2018-2022 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
  *
@@ -25,7 +25,6 @@ import android.content.SharedPreferences;
 import android.database.Cursor;
 import android.database.MatrixCursor;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
 import android.view.View;
 import android.view.WindowManager;
 import android.widget.AdapterView;
@@ -40,6 +39,7 @@ import androidx.appcompat.app.ActionBar;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 import androidx.fragment.app.DialogFragment;
+import androidx.preference.PreferenceManager;
 
 import com.stoutner.privacybrowser.R;
 import com.stoutner.privacybrowser.adapters.RequestsArrayAdapter;
@@ -290,4 +290,4 @@ public class RequestsActivity extends AppCompatActivity implements ViewRequestDi
         DialogFragment viewRequestDialogFragment = ViewRequestDialog.request(id, isLastRequest, selectedRequestStringArray);
         viewRequestDialogFragment.show(getSupportFragmentManager(), getString(R.string.request_details));
     }
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt
index f4b673ea..6e5c0668 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt
+++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutVersionFragment.kt
@@ -51,8 +51,8 @@ import androidx.webkit.WebViewCompat
 
 import com.google.android.material.snackbar.Snackbar
 
-import com.stoutner.privacybrowser.R
 import com.stoutner.privacybrowser.BuildConfig
+import com.stoutner.privacybrowser.R
 import com.stoutner.privacybrowser.asynctasks.SaveAboutVersionImage
 
 import kotlinx.coroutines.CoroutineScope
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 573f7f9c..6f437d57 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -619,7 +619,7 @@
         <string name="swipe_to_refresh">Swipe to refresh</string>
         <string name="swipe_to_refresh_summary">Some websites don’t work well if swipe to refresh is enabled.</string>
         <string name="download_with_external_app">Download with external app</string>
-        <string name="download_with_external_app_summary">External apps will not honor Privacy Browser’s proxy settings and will not have access to cookies
+        <string name="download_with_external_app_summary">External apps do not honor Privacy Browser’s proxy settings and do not have access to cookies
             (meaning that it is unlikely that files downloaded from sites that require a login will work).</string>
         <string name="scroll_app_bar">Scroll the app bar</string>
         <string name="scroll_app_bar_summary">Scroll the app bar off the top of the screen when the WebView scrolls down.</string>
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 47fa1d64..9bbe6b3c 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -19,305 +19,306 @@
   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
 
 <PreferenceScreen
-    xmlns:android="http://schemas.android.com/apk/res/android" >
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:android="http://schemas.android.com/apk/res/android">
 
     <PreferenceCategory
-        android:key="@string/privacy_category_key"
-        android:title="@string/privacy" >
+        app:key="@string/privacy_category_key"
+        app:title="@string/privacy" >
 
         <SwitchPreferenceCompat
-            android:key="@string/javascript_key"
-            android:title="@string/javascript"
-            android:summary="@string/javascript_preference_summary"
-            android:defaultValue="false" />
+            app:key="@string/javascript_key"
+            app:title="@string/javascript"
+            app:summary="@string/javascript_preference_summary"
+            app:defaultValue="false" />
 
         <SwitchPreferenceCompat
-            android:key="@string/cookies_key"
-            android:title="@string/cookies"
-            android:summary="@string/cookies_preference_summary"
-            android:defaultValue="false" />
+            app:key="@string/cookies_key"
+            app:title="@string/cookies"
+            app:summary="@string/cookies_preference_summary"
+            app:defaultValue="false" />
 
         <SwitchPreferenceCompat
-            android:key="@string/dom_storage_key"
-            android:title="@string/dom_storage_preference"
-            android:summary="@string/dom_storage_preference_summary"
-            android:defaultValue="false" />
+            app:key="@string/dom_storage_key"
+            app:title="@string/dom_storage_preference"
+            app:summary="@string/dom_storage_preference_summary"
+            app:defaultValue="false" />
 
         <!-- Save form data can be removed once the minimum API >= 26. -->
         <SwitchPreferenceCompat
-            android:key="@string/save_form_data_key"
-            android:title="@string/save_form_data_preference"
-            android:summary="@string/save_form_data_preference_summary"
-            android:defaultValue="false" />
+            app:key="@string/save_form_data_key"
+            app:title="@string/save_form_data_preference"
+            app:summary="@string/save_form_data_preference_summary"
+            app:defaultValue="false" />
 
         <ListPreference
-            android:key="@string/user_agent_key"
-            android:title="@string/user_agent"
-            android:entries="@array/translated_user_agent_names"
-            android:entryValues="@array/user_agent_names"
-            android:defaultValue="@string/user_agent_default_value"
-            android:icon="@drawable/user_agent" />
+            app:key="@string/user_agent_key"
+            app:title="@string/user_agent"
+            app:entries="@array/translated_user_agent_names"
+            app:entryValues="@array/user_agent_names"
+            app:defaultValue="@string/user_agent_default_value"
+            app:icon="@drawable/user_agent" />
 
         <!-- android:inputType="textVisiblePassword" sets the keyboard to have a dedicated number row.-->
         <EditTextPreference
-            android:key="@string/custom_user_agent_key"
-            android:title="@string/custom_user_agent"
-            android:defaultValue="@string/custom_user_agent_default_value"
+            app:key="@string/custom_user_agent_key"
+            app:title="@string/custom_user_agent"
+            app:defaultValue="@string/custom_user_agent_default_value"
             android:inputType="textVisiblePassword|textMultiLine" />
 
         <SwitchPreferenceCompat
-            android:key="@string/incognito_mode_key"
-            android:title="@string/incognito_mode"
-            android:summary="@string/incognito_mode_summary"
-            android:defaultValue="false" />
+            app:key="@string/incognito_mode_key"
+            app:title="@string/incognito_mode"
+            app:summary="@string/incognito_mode_summary"
+            app:defaultValue="false" />
 
         <SwitchPreferenceCompat
-            android:key="@string/allow_screenshots_key"
-            android:title="@string/allow_screenshots"
-            android:summary="@string/allow_screenshots_summary"
-            android:defaultValue="false" />
+            app:key="@string/allow_screenshots_key"
+            app:title="@string/allow_screenshots"
+            app:summary="@string/allow_screenshots_summary"
+            app:defaultValue="false" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="blocklists"
-        android:title="@string/blocklists" >
+        app:key="blocklists"
+        app:title="@string/blocklists" >
 
         <SwitchPreferenceCompat
-            android:key="@string/easylist_key"
-            android:title="@string/easylist"
-            android:summary="@string/easylist_summary"
-            android:defaultValue="true" />
+            app:key="@string/easylist_key"
+            app:title="@string/easylist"
+            app:summary="@string/easylist_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/easyprivacy_key"
-            android:title="@string/easyprivacy"
-            android:summary="@string/easyprivacy_summary"
-            android:defaultValue="true" />
+            app:key="@string/easyprivacy_key"
+            app:title="@string/easyprivacy"
+            app:summary="@string/easyprivacy_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/fanboys_annoyance_list_key"
-            android:title="@string/fanboys_annoyance_list"
-            android:summary="@string/fanboys_annoyance_list_summary"
-            android:defaultValue="true" />
+            app:key="@string/fanboys_annoyance_list_key"
+            app:title="@string/fanboys_annoyance_list"
+            app:summary="@string/fanboys_annoyance_list_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/fanboys_social_blocking_list_key"
-            android:title="@string/fanboys_social_blocking_list"
-            android:summary="@string/fanboys_social_blocking_list_summary"
-            android:defaultValue="true" />
+            app:key="@string/fanboys_social_blocking_list_key"
+            app:title="@string/fanboys_social_blocking_list"
+            app:summary="@string/fanboys_social_blocking_list_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/ultralist_key"
-            android:title="@string/ultralist"
-            android:summary="@string/ultralist_summary"
-            android:defaultValue="true" />
+            app:key="@string/ultralist_key"
+            app:title="@string/ultralist"
+            app:summary="@string/ultralist_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/ultraprivacy_key"
-            android:title="@string/ultraprivacy"
-            android:summary="@string/ultraprivacy_summary"
-            android:defaultValue="true" />
+            app:key="@string/ultraprivacy_key"
+            app:title="@string/ultraprivacy"
+            app:summary="@string/ultraprivacy_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/block_all_third_party_requests_key"
-            android:title="@string/block_all_third_party_requests"
-            android:summary="@string/block_all_third_party_requests_summary"
-            android:defaultValue="false" />
+            app:key="@string/block_all_third_party_requests_key"
+            app:title="@string/block_all_third_party_requests"
+            app:summary="@string/block_all_third_party_requests_summary"
+            app:defaultValue="false" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="url_modification"
-        android:title="@string/url_modification" >
+        app:key="url_modification"
+        app:title="@string/url_modification" >
 
         <SwitchPreferenceCompat
-            android:key="@string/tracking_queries_key"
-            android:title="@string/tracking_queries"
-            android:summary="@string/tracking_queries_summary"
-            android:defaultValue="true" />
+            app:key="@string/tracking_queries_key"
+            app:title="@string/tracking_queries"
+            app:summary="@string/tracking_queries_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/amp_redirects_key"
-            android:title="@string/amp_redirects"
-            android:summary="@string/amp_redirects_summary"
-            android:defaultValue="true" />
+            app:key="@string/amp_redirects_key"
+            app:title="@string/amp_redirects"
+            app:summary="@string/amp_redirects_summary"
+            app:defaultValue="true" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="search_category"
-        android:title="@string/search" >
+        app:key="search_category"
+        app:title="@string/search" >
 
         <ListPreference
-            android:key="@string/search_key"
-            android:title="@string/search"
-            android:entries="@array/search_entries"
-            android:entryValues="@array/search_entry_values"
-            android:defaultValue="@string/search_default_value"
-            android:icon="@drawable/search" />
+            app:key="@string/search_key"
+            app:title="@string/search"
+            app:entries="@array/search_entries"
+            app:entryValues="@array/search_entry_values"
+            app:defaultValue="@string/search_default_value"
+            app:icon="@drawable/search" />
 
         <EditTextPreference
-            android:key="@string/search_custom_url_key"
-            android:title="@string/search_custom_url"
-            android:defaultValue="@string/search_custom_url_default_value"
+            app:key="@string/search_custom_url_key"
+            app:title="@string/search_custom_url"
+            app:defaultValue="@string/search_custom_url_default_value"
             android:inputType="textUri" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="proxy_category"
-        android:title="@string/proxy" >
+        app:key="proxy_category"
+        app:title="@string/proxy" >
 
         <ListPreference
-            android:key="@string/proxy_key"
-            android:title="@string/proxy"
-            android:entries="@array/proxy_entries"
-            android:entryValues="@array/proxy_entry_values"
-            android:defaultValue="@string/proxy_default_value" />
+            app:key="@string/proxy_key"
+            app:title="@string/proxy"
+            app:entries="@array/proxy_entries"
+            app:entryValues="@array/proxy_entry_values"
+            app:defaultValue="@string/proxy_default_value" />
 
         <EditTextPreference
-            android:key="@string/proxy_custom_url_key"
-            android:title="@string/proxy_custom_url"
-            android:defaultValue="@string/proxy_custom_url_default_value"
+            app:key="@string/proxy_custom_url_key"
+            app:title="@string/proxy_custom_url"
+            app:defaultValue="@string/proxy_custom_url_default_value"
             android:inputType="textUri" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="full_screen"
-        android:title="@string/full_screen" >
+        app:key="full_screen"
+        app:title="@string/full_screen" >
 
         <SwitchPreferenceCompat
-            android:key="@string/full_screen_browsing_mode_key"
-            android:title="@string/full_screen_browsing_mode"
-            android:summary="@string/full_screen_browsing_mode_summary"
-            android:defaultValue="false" />
+            app:key="@string/full_screen_browsing_mode_key"
+            app:title="@string/full_screen_browsing_mode"
+            app:summary="@string/full_screen_browsing_mode_summary"
+            app:defaultValue="false" />
 
         <SwitchPreferenceCompat
-            android:key="@string/hide_app_bar_key"
-            android:title="@string/hide_app_bar"
-            android:summary="@string/hide_app_bar_summary"
-            android:defaultValue="true" />
+            app:key="@string/hide_app_bar_key"
+            app:title="@string/hide_app_bar"
+            app:summary="@string/hide_app_bar_summary"
+            app:defaultValue="true" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="@string/clear_and_exit_category_key"
-        android:title="@string/clear_and_exit" >
+        app:key="@string/clear_and_exit_category_key"
+        app:title="@string/clear_and_exit" >
 
         <SwitchPreferenceCompat
-            android:key="@string/clear_everything_key"
-            android:title="@string/clear_everything"
-            android:summary="@string/clear_everything_summary"
-            android:defaultValue="true" />
+            app:key="@string/clear_everything_key"
+            app:title="@string/clear_everything"
+            app:summary="@string/clear_everything_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/clear_cookies_key"
-            android:title="@string/clear_cookies_preference"
-            android:summary="@string/clear_cookies_summary"
-            android:defaultValue="true" />
+            app:key="@string/clear_cookies_key"
+            app:title="@string/clear_cookies_preference"
+            app:summary="@string/clear_cookies_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/clear_dom_storage_key"
-            android:title="@string/clear_dom_storage_preference"
-            android:summary="@string/clear_dom_storage_summary"
-            android:defaultValue="true" />
+            app:key="@string/clear_dom_storage_key"
+            app:title="@string/clear_dom_storage_preference"
+            app:summary="@string/clear_dom_storage_summary"
+            app:defaultValue="true" />
 
         <!-- Clear form data can be removed once the minimum API >= 26. -->
         <SwitchPreferenceCompat
-            android:key="@string/clear_form_data_key"
-            android:title="@string/clear_form_data_preference"
-            android:summary="@string/clear_form_data_summary"
-            android:defaultValue="true" />
+            app:key="@string/clear_form_data_key"
+            app:title="@string/clear_form_data_preference"
+            app:summary="@string/clear_form_data_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/clear_logcat_key"
-            android:title="@string/clear_logcat"
-            android:summary="@string/clear_logcat_summary"
-            android:defaultValue="true" />
+            app:key="@string/clear_logcat_key"
+            app:title="@string/clear_logcat"
+            app:summary="@string/clear_logcat_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/clear_cache_key"
-            android:title="@string/clear_cache"
-            android:summary="@string/clear_cache_summary"
-            android:defaultValue="true" />
+            app:key="@string/clear_cache_key"
+            app:title="@string/clear_cache"
+            app:summary="@string/clear_cache_summary"
+            app:defaultValue="true" />
     </PreferenceCategory>
 
     <PreferenceCategory
-        android:key="general"
-        android:title="@string/general" >
+        app:key="general"
+        app:title="@string/general" >
 
         <EditTextPreference
-            android:key="@string/homepage_key"
-            android:title="@string/homepage"
-            android:defaultValue="@string/homepage_default_value"
+            app:key="@string/homepage_key"
+            app:title="@string/homepage"
+            app:defaultValue="@string/homepage_default_value"
             android:inputType="textUri"
-            android:icon="@drawable/home" />
+            app:icon="@drawable/home" />
 
         <!-- `android:inputType="number"` currently doesn't work with AndroidX. -->
         <EditTextPreference
-            android:key="@string/font_size_key"
-            android:title="@string/font_size_preference"
-            android:defaultValue="@string/font_size_default_value"
+            app:key="@string/font_size_key"
+            app:title="@string/font_size_preference"
+            app:defaultValue="@string/font_size_default_value"
             android:inputType="number"
-            android:icon="@drawable/font_size" />
+            app:icon="@drawable/font_size" />
 
         <SwitchPreferenceCompat
-            android:key="@string/open_intents_in_new_tab_key"
-            android:title="@string/open_intents_in_new_tab"
-            android:summary="@string/open_intents_in_new_tab_summary"
-            android:defaultValue="true" />
+            app:key="@string/open_intents_in_new_tab_key"
+            app:title="@string/open_intents_in_new_tab"
+            app:summary="@string/open_intents_in_new_tab_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/swipe_to_refresh_key"
-            android:title="@string/swipe_to_refresh"
-            android:summary="@string/swipe_to_refresh_summary"
-            android:defaultValue="true" />
+            app:key="@string/swipe_to_refresh_key"
+            app:title="@string/swipe_to_refresh"
+            app:summary="@string/swipe_to_refresh_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/download_with_external_app_key"
-            android:title="@string/download_with_external_app"
-            android:summary="@string/download_with_external_app_summary"
-            android:defaultValue="false" />
+            app:key="@string/download_with_external_app_key"
+            app:title="@string/download_with_external_app"
+            app:summary="@string/download_with_external_app_summary"
+            app:defaultValue="false" />
 
         <SwitchPreferenceCompat
-            android:key="@string/scroll_app_bar_key"
-            android:title="@string/scroll_app_bar"
-            android:summary="@string/scroll_app_bar_summary"
-            android:defaultValue="true" />
+            app:key="@string/scroll_app_bar_key"
+            app:title="@string/scroll_app_bar"
+            app:summary="@string/scroll_app_bar_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/bottom_app_bar_key"
-            android:title="@string/bottom_app_bar"
-            android:summary="@string/bottom_app_bar_summary"
-            android:defaultValue="false" />
+            app:key="@string/bottom_app_bar_key"
+            app:title="@string/bottom_app_bar"
+            app:summary="@string/bottom_app_bar_summary"
+            app:defaultValue="false" />
 
         <SwitchPreferenceCompat
-            android:key="@string/display_additional_app_bar_icons_key"
-            android:title="@string/display_additional_app_bar_icons"
-            android:summary="@string/display_additional_app_bar_icons_summary"
-            android:defaultValue="false" />
+            app:key="@string/display_additional_app_bar_icons_key"
+            app:title="@string/display_additional_app_bar_icons"
+            app:summary="@string/display_additional_app_bar_icons_summary"
+            app:defaultValue="false" />
 
         <ListPreference
-            android:key="@string/app_theme_key"
-            android:title="@string/app_theme"
-            android:entries="@array/app_theme_entries"
-            android:entryValues="@array/app_theme_entry_values"
-            android:defaultValue="@string/app_theme_default_value"
-            android:icon="@drawable/app_theme" />
+            app:key="@string/app_theme_key"
+            app:title="@string/app_theme"
+            app:entries="@array/app_theme_entries"
+            app:entryValues="@array/app_theme_entry_values"
+            app:defaultValue="@string/app_theme_default_value"
+            app:icon="@drawable/app_theme" />
 
         <ListPreference
-            android:key="@string/webview_theme_key"
-            android:title="@string/webview_theme"
-            android:entries="@array/webview_theme_entries"
-            android:entryValues="@array/webview_theme_entry_values"
-            android:defaultValue="@string/webview_theme_default_value" />
+            app:key="@string/webview_theme_key"
+            app:title="@string/webview_theme"
+            app:entries="@array/webview_theme_entries"
+            app:entryValues="@array/webview_theme_entry_values"
+            app:defaultValue="@string/webview_theme_default_value" />
 
         <SwitchPreferenceCompat
-            android:key="@string/wide_viewport_key"
-            android:title="@string/wide_viewport_preference"
-            android:summary="@string/wide_viewport_summary"
-            android:defaultValue="true" />
+            app:key="@string/wide_viewport_key"
+            app:title="@string/wide_viewport_preference"
+            app:summary="@string/wide_viewport_summary"
+            app:defaultValue="true" />
 
         <SwitchPreferenceCompat
-            android:key="@string/display_webpage_images_key"
-            android:title="@string/display_webpage_images"
-            android:summary="@string/display_webpage_images_summary"
-            android:defaultValue="true" />
+            app:key="@string/display_webpage_images_key"
+            app:title="@string/display_webpage_images"
+            app:summary="@string/display_webpage_images_summary"
+            app:defaultValue="true" />
     </PreferenceCategory>
 </PreferenceScreen>