]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Highlight the background of non-default domain settings. https://redmine.stoutner...
authorSoren Stoutner <soren@stoutner.com>
Wed, 19 Apr 2023 22:43:59 +0000 (15:43 -0700)
committerSoren Stoutner <soren@stoutner.com>
Wed, 19 Apr 2023 22:43:59 +0000 (15:43 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.kt
app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt
app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.kt
app/src/main/java/com/stoutner/privacybrowser/helpers/DomainsDatabaseHelper.kt
app/src/main/res/layout/domain_settings_fragment.xml

index 1895c6eb3e044fd698d8c617c82c743d31215c2d..1866a66dee1ec420be37acc4c6cb74adbc2367ca 100644 (file)
@@ -647,7 +647,7 @@ class DomainsActivity : AppCompatActivity(), AddDomainListener, DismissSnackbarI
         }
     }
 
-    override fun onAddDomain(dialogFragment: DialogFragment) {
+    override fun addDomain(dialogFragment: DialogFragment) {
         // Dismiss the undo delete snackbar if it is currently displayed.
         if (undoDeleteSnackbar != null && undoDeleteSnackbar!!.isShown)
             undoDeleteSnackbar!!.dismiss()
@@ -710,7 +710,7 @@ class DomainsActivity : AppCompatActivity(), AddDomainListener, DismissSnackbarI
         val swipeToRefreshSpinner = view.findViewById<Spinner>(R.id.swipe_to_refresh_spinner)
         val webViewThemeSpinner = view.findViewById<Spinner>(R.id.webview_theme_spinner)
         val wideViewportSpinner = view.findViewById<Spinner>(R.id.wide_viewport_spinner)
-        val displayWebpageImagesSpinner = view.findViewById<Spinner>(R.id.display_webpage_images_spinner)
+        val displayWebpageImagesSpinner = view.findViewById<Spinner>(R.id.display_images_spinner)
         val pinnedSslCertificateSwitch = view.findViewById<SwitchCompat>(R.id.pinned_ssl_certificate_switch)
         val currentWebsiteCertificateRadioButton = view.findViewById<RadioButton>(R.id.current_website_certificate_radiobutton)
         val pinnedIpAddressesSwitch = view.findViewById<SwitchCompat>(R.id.pinned_ip_addresses_switch)
index f1cc8cb339b3ff90938136d78665c4ca0f3a88ad..00d281afcfcfc24465be27107aa69726753d0956 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2017-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2017-2023 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
  *
@@ -48,7 +48,7 @@ class AddDomainDialog : DialogFragment() {
 
     // The public interface is used to send information back to the parent activity.
     interface AddDomainListener {
-        fun onAddDomain(dialogFragment: DialogFragment)
+        fun addDomain(dialogFragment: DialogFragment)
     }
 
     override fun onAttach(context: Context) {
@@ -103,7 +103,7 @@ class AddDomainDialog : DialogFragment() {
         // Set the add button listener.
         dialogBuilder.setPositiveButton(R.string.add) { _: DialogInterface, _: Int ->
             // Return the dialog fragment to the parent activity on add.
-            addDomainListener.onAddDomain(this)
+            addDomainListener.addDomain(this)
         }
 
         // Create an alert dialog from the builder.
@@ -169,7 +169,7 @@ class AddDomainDialog : DialogFragment() {
             // Check the key code and event.
             if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_DOWN) {  // The event is a key-down on the enter key.
                 // Trigger the add domain listener and return the dialog fragment to the parent activity.
-                addDomainListener.onAddDomain(this)
+                addDomainListener.addDomain(this)
 
                 // Manually dismiss the alert dialog.
                 alertDialog.dismiss()
index 23fce5d8b358c717cd8571f0ae5bb15334fef8c1..1576c185537ab7b6c8527b19f6609d48543e2c61 100644 (file)
@@ -131,13 +131,15 @@ class DomainSettingsFragment : Fragment() {
         val ultraPrivacySwitch = domainSettingsView.findViewById<SwitchCompat>(R.id.ultraprivacy_switch)
         val blockAllThirdPartyRequestsImageView = domainSettingsView.findViewById<ImageView>(R.id.block_all_third_party_requests_imageview)
         val blockAllThirdPartyRequestsSwitch = domainSettingsView.findViewById<SwitchCompat>(R.id.block_all_third_party_requests_switch)
-        val userAgentLinearLayout = domainSettingsView.findViewById<LinearLayout>(R.id.user_agent_linear_layout)
+        val userAgentLinearLayout = domainSettingsView.findViewById<LinearLayout>(R.id.user_agent_linearlayout)
         val userAgentSpinner = domainSettingsView.findViewById<Spinner>(R.id.user_agent_spinner)
         val userAgentTextView = domainSettingsView.findViewById<TextView>(R.id.user_agent_textview)
         val customUserAgentEditText = domainSettingsView.findViewById<EditText>(R.id.custom_user_agent_edittext)
+        val fontSizeLinearLayout = domainSettingsView.findViewById<LinearLayout>(R.id.font_size_linearlayout)
         val fontSizeSpinner = domainSettingsView.findViewById<Spinner>(R.id.font_size_spinner)
         val defaultFontSizeTextView = domainSettingsView.findViewById<TextView>(R.id.default_font_size_textview)
         val customFontSizeEditText = domainSettingsView.findViewById<EditText>(R.id.custom_font_size_edittext)
+        val swipeToRefreshLinearLayout = domainSettingsView.findViewById<LinearLayout>(R.id.swipe_to_refresh_linearlayout)
         val swipeToRefreshImageView = domainSettingsView.findViewById<ImageView>(R.id.swipe_to_refresh_imageview)
         val swipeToRefreshSpinner = domainSettingsView.findViewById<Spinner>(R.id.swipe_to_refresh_spinner)
         val swipeToRefreshTextView = domainSettingsView.findViewById<TextView>(R.id.swipe_to_refresh_textview)
@@ -145,12 +147,14 @@ class DomainSettingsFragment : Fragment() {
         val webViewThemeImageView = domainSettingsView.findViewById<ImageView>(R.id.webview_theme_imageview)
         val webViewThemeSpinner = domainSettingsView.findViewById<Spinner>(R.id.webview_theme_spinner)
         val webViewThemeTextView = domainSettingsView.findViewById<TextView>(R.id.webview_theme_textview)
+        val wideViewportLinearLayout = domainSettingsView.findViewById<LinearLayout>(R.id.wide_viewport_linearlayout)
         val wideViewportImageView = domainSettingsView.findViewById<ImageView>(R.id.wide_viewport_imageview)
         val wideViewportSpinner = domainSettingsView.findViewById<Spinner>(R.id.wide_viewport_spinner)
         val wideViewportTextView = domainSettingsView.findViewById<TextView>(R.id.wide_viewport_textview)
-        val displayWebpageImagesImageView = domainSettingsView.findViewById<ImageView>(R.id.display_webpage_images_imageview)
-        val displayWebpageImagesSpinner = domainSettingsView.findViewById<Spinner>(R.id.display_webpage_images_spinner)
-        val displayImagesTextView = domainSettingsView.findViewById<TextView>(R.id.display_webpage_images_textview)
+        val displayImagesLinearLayout = domainSettingsView.findViewById<LinearLayout>(R.id.display_images_linearlayout)
+        val displayImagesImageView = domainSettingsView.findViewById<ImageView>(R.id.display_images_imageview)
+        val displayImagesSpinner = domainSettingsView.findViewById<Spinner>(R.id.display_images_spinner)
+        val displayImagesTextView = domainSettingsView.findViewById<TextView>(R.id.display_images_textview)
         val pinnedSslCertificateImageView = domainSettingsView.findViewById<ImageView>(R.id.pinned_ssl_certificate_imageview)
         val pinnedSslCertificateSwitch = domainSettingsView.findViewById<SwitchCompat>(R.id.pinned_ssl_certificate_switch)
         val savedSslCardView = domainSettingsView.findViewById<CardView>(R.id.saved_ssl_certificate_cardview)
@@ -272,7 +276,7 @@ class DomainSettingsFragment : Fragment() {
         swipeToRefreshSpinner.adapter = swipeToRefreshArrayAdapter
         webViewThemeSpinner.adapter = webViewThemeArrayAdapter
         wideViewportSpinner.adapter = wideViewportArrayAdapter
-        displayWebpageImagesSpinner.adapter = displayImagesArrayAdapter
+        displayImagesSpinner.adapter = displayImagesArrayAdapter
 
         // Create a spannable string builder for each TextView that needs multiple colors of text.
         val savedSslIssuedToCNameStringBuilder = SpannableStringBuilder(cNameLabel + savedSslIssuedToCNameString)
@@ -411,7 +415,7 @@ class DomainSettingsFragment : Fragment() {
         swipeToRefreshTextView.setOnClickListener { swipeToRefreshSpinner.performClick() }
         webViewThemeTextView.setOnClickListener { webViewThemeSpinner.performClick() }
         wideViewportTextView.setOnClickListener { wideViewportSpinner.performClick() }
-        displayImagesTextView.setOnClickListener { displayWebpageImagesSpinner.performClick() }
+        displayImagesTextView.setOnClickListener { displayImagesSpinner.performClick() }
 
         // 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.
@@ -499,6 +503,9 @@ class DomainSettingsFragment : Fragment() {
 
             // Set the default font size as the text of the custom font size edit text.  This way, if the user switches to custom it will already be populated.
             customFontSizeEditText.setText(defaultFontSizeString)
+
+            // Set the background color to be transparent.
+            fontSizeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
         } else {  // A custom font size is selected.
             // Set the spinner to the custom font size.
             fontSizeSpinner.setSelection(1)
@@ -511,6 +518,9 @@ class DomainSettingsFragment : Fragment() {
 
             // Set the custom font size.
             customFontSizeEditText.setText(fontSizeInt.toString())
+
+            // Set the background color to be blue.
+            fontSizeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
         }
 
         // Initialize the default font size percentage string.
@@ -536,6 +546,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Show the swipe-to-refresh text view.
                 swipeToRefreshTextView.visibility = View.VISIBLE
+
+                // Set the background color to be transparent.
+                swipeToRefreshLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
             }
 
             DomainsDatabaseHelper.ENABLED -> {
@@ -544,6 +557,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Hide the swipe-to-refresh text view.
                 swipeToRefreshTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                swipeToRefreshLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
 
             DomainsDatabaseHelper.DISABLED -> {
@@ -552,6 +568,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Hide the swipe-to-refresh text view.
                 swipeToRefreshTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                swipeToRefreshLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
         }
 
@@ -593,6 +612,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Show the WebView theme text view.
                 webViewThemeTextView.visibility = View.VISIBLE
+
+                // Set the background color to be transparent.
+                webViewThemeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
             }
 
             DomainsDatabaseHelper.LIGHT_THEME -> {
@@ -601,6 +623,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Hide the WebView theme text view.
                 webViewThemeTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                webViewThemeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
 
             DomainsDatabaseHelper.DARK_THEME -> {
@@ -609,6 +634,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Hide the WebView theme text view.
                 webViewThemeTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                webViewThemeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
         }
 
@@ -618,7 +646,8 @@ class DomainSettingsFragment : Fragment() {
         // Set the default wide viewport text.
         if (defaultWideViewport)
             wideViewportTextView.text = wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.ENABLED)
-        else wideViewportTextView.text = wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED)
+        else
+            wideViewportTextView.text = wideViewportArrayAdapter.getItem(DomainsDatabaseHelper.DISABLED)
 
         // Set the wide viewport icon and text view settings.
         when (wideViewportInt) {
@@ -628,6 +657,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Show the wide viewport text view.
                 wideViewportTextView.visibility = View.VISIBLE
+
+                // Set the background color to be transparent.
+                wideViewportLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
             }
 
             DomainsDatabaseHelper.ENABLED -> {
@@ -636,6 +668,9 @@ class DomainSettingsFragment : Fragment() {
 
                 // Hide the wide viewport text view.
                 wideViewportTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                wideViewportLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
 
             DomainsDatabaseHelper.DISABLED -> {
@@ -644,11 +679,14 @@ class DomainSettingsFragment : Fragment() {
 
                 // Hide the wide viewport text view.
                 wideViewportTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                wideViewportLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
         }
 
         // Display the website images mode in the spinner.
-        displayWebpageImagesSpinner.setSelection(displayImagesInt)
+        displayImagesSpinner.setSelection(displayImagesInt)
 
         // Set the default display images text.
         if (defaultDisplayWebpageImages)
@@ -660,26 +698,35 @@ class DomainSettingsFragment : Fragment() {
         when (displayImagesInt) {
             DomainsDatabaseHelper.SYSTEM_DEFAULT -> {
                 // Set the icon color.
-                displayWebpageImagesImageView.isSelected = defaultDisplayWebpageImages
+                displayImagesImageView.isSelected = defaultDisplayWebpageImages
 
                 // Show the display images text view.
                 displayImagesTextView.visibility = View.VISIBLE
+
+                // Set the background color to be transparent.
+                displayImagesLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
             }
 
             DomainsDatabaseHelper.ENABLED -> {
                 // Set the icon color.
-                displayWebpageImagesImageView.isSelected = true
+                displayImagesImageView.isSelected = true
 
                 // Hide the display images text view.
                 displayImagesTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+                displayImagesLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
 
             DomainsDatabaseHelper.DISABLED -> {
                 // Set the icon color.
-                displayWebpageImagesImageView.isSelected = false
+                displayImagesImageView.isSelected = false
 
                 // Hide the display images text view.
                 displayImagesTextView.visibility = View.GONE
+
+                // Set the background color to be blue.
+               displayImagesLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
             }
         }
 
@@ -1050,12 +1097,18 @@ class DomainSettingsFragment : Fragment() {
 
                     // Hide the custom font size edit text.
                     customFontSizeEditText.visibility = View.GONE
+
+                    // Set the background color to be transparent.
+                    fontSizeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
                 } else {  // A custom font size has been selected.
                     // Hide the default font size text view.
                     defaultFontSizeTextView.visibility = View.GONE
 
                     // Show the custom font size edit text.
                     customFontSizeEditText.visibility = View.VISIBLE
+
+                    // Set the background color to be blue.
+                    fontSizeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                 }
             }
 
@@ -1075,6 +1128,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Show the swipe-to-refresh text view.
                         swipeToRefreshTextView.visibility = View.VISIBLE
+
+                        // Set the background color to be transparent.
+                        swipeToRefreshLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
                     }
 
                     DomainsDatabaseHelper.ENABLED -> {
@@ -1083,6 +1139,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Hide the swipe-to-refresh text view.
                         swipeToRefreshTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        swipeToRefreshLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
 
                     DomainsDatabaseHelper.DISABLED -> {
@@ -1091,6 +1150,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Hide the swipe-to-refresh text view.
                         swipeToRefreshTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        swipeToRefreshLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
                 }
             }
@@ -1115,6 +1177,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Show the WebView theme text view.
                         webViewThemeTextView.visibility = View.VISIBLE
+
+                        // Set the background color to be transparent.
+                        webViewThemeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
                     }
 
                     DomainsDatabaseHelper.LIGHT_THEME -> {
@@ -1123,6 +1188,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Hide the WebView theme text view.
                         webViewThemeTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        webViewThemeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
 
                     DomainsDatabaseHelper.DARK_THEME -> {
@@ -1131,6 +1199,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Hide the WebView theme text view.
                         webViewThemeTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        webViewThemeLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
                 }
             }
@@ -1151,6 +1222,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Show the wide viewport text view.
                         wideViewportTextView.visibility = View.VISIBLE
+
+                        // Set the background color to be transparent.
+                        wideViewportLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
                     }
 
                     DomainsDatabaseHelper.ENABLED -> {
@@ -1159,6 +1233,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Hide the wide viewport text view.
                         wideViewportTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        wideViewportLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
 
                     DomainsDatabaseHelper.DISABLED -> {
@@ -1167,6 +1244,9 @@ class DomainSettingsFragment : Fragment() {
 
                         // Hid ethe wide viewport text view.
                         wideViewportTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        wideViewportLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
                 }
             }
@@ -1177,32 +1257,41 @@ class DomainSettingsFragment : Fragment() {
         }
 
         // Set the display webpage images spinner listener.
-        displayWebpageImagesSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
+        displayImagesSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
             override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
                 // Update the icon and the visibility of the display images text view.
                 when (position) {
                     DomainsDatabaseHelper.SYSTEM_DEFAULT -> {
                         // Set the icon color.
-                        displayWebpageImagesImageView.isSelected = defaultDisplayWebpageImages
+                        displayImagesImageView.isSelected = defaultDisplayWebpageImages
 
                         // Show the display images text view.
                         displayImagesTextView.visibility = View.VISIBLE
+
+                        // Set the background color to be transparent.
+                        displayImagesLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.transparent))
                     }
 
                     DomainsDatabaseHelper.ENABLED -> {
                         // Set the icon color.
-                        displayWebpageImagesImageView.isSelected = true
+                        displayImagesImageView.isSelected = true
 
                         // Hide the display images text view.
                         displayImagesTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        displayImagesLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
 
                     DomainsDatabaseHelper.DISABLED -> {
                         // Set the icon color.
-                        displayWebpageImagesImageView.isSelected = false
+                        displayImagesImageView.isSelected = false
 
                         // Hide the display images text view.
                         displayImagesTextView.visibility = View.GONE
+
+                        // Set the background color to be blue.
+                        displayImagesLinearLayout.setBackgroundColor(getColor(requireContext(), R.color.blue_background))
                     }
                 }
             }
index 00ffcb4aa50179d51a40d6c86e82771f32c91687..194310b7ee5a81ee50e77bc1d743bfb5fae75bb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2017-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2017-2023 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
  *
@@ -345,7 +345,7 @@ class DomainsDatabaseHelper(private val appContext: Context) : SQLiteOpenHelper(
         domainContentValues.put(ULTRALIST, ultraList)
         domainContentValues.put(ENABLE_ULTRAPRIVACY, ultraPrivacy)
         domainContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, blockAllThirdPartyRequests)
-        domainContentValues.put(USER_AGENT, appContext.getString(R.string.user_agent_default_value))
+        domainContentValues.put(USER_AGENT, appContext.getString(R.string.system_default_user_agent))
         domainContentValues.put(FONT_SIZE, 0)
         domainContentValues.put(SWIPE_TO_REFRESH, 0)
         domainContentValues.put(WEBVIEW_THEME, 0)
index 1e19683d484ba389c6f6412d1daa343cfbf47f02..aaa5ecfdebbbf7baab02151307445a1891b515ec 100644 (file)
 
 <ScrollView android:id="@+id/domain_settings_scrollview"
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"
     android:focusable="true"
     android:focusableInTouchMode="true"
-    android:descendantFocusability="beforeDescendants"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    android:descendantFocusability="beforeDescendants" >
 
     <LinearLayout
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
-        android:layout_margin="12dp"
         android:orientation="vertical"
         android:divider="?android:attr/dividerVertical" >
 
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="vertical" >
+            android:orientation="vertical"
+            android:layout_marginTop="12dp"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <LinearLayout
                 android:layout_height="wrap_content"
@@ -85,7 +87,9 @@
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/javascript_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/cookies_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/dom_storage_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/form_data_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/easylist_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/easyprivacy_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/fanboys_annoyance_list_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/fanboys_social_blocking_list_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/ultralist_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/ultraprivacy_imageview"
         <LinearLayout
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:orientation="horizontal" >
+            android:orientation="horizontal"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <ImageView
                 android:id="@+id/block_all_third_party_requests_imageview"
 
         <!-- User Agent. -->
         <LinearLayout
-            android:id="@+id/user_agent_linear_layout"
+            android:id="@+id/user_agent_linearlayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
-            android:layout_marginTop="14dp"
-            android:layout_marginBottom="14dp" >
+            android:padding="12dp" >
+
+            <TextView
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:text="@string/user_agent" />
 
             <LinearLayout
                 android:layout_height="wrap_content"
 
         <!-- Font Size. -->
         <LinearLayout
+            android:id="@+id/font_size_linearlayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
-            android:layout_marginTop="14dp"
-            android:layout_marginBottom="14dp" >
+            android:padding="12dp" >
+
+            <TextView
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:text="@string/font_size" />
 
             <LinearLayout
                 android:layout_height="wrap_content"
 
         <!-- Swipe to Refresh. -->
         <LinearLayout
+            android:id="@+id/swipe_to_refresh_linearlayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
-            android:layout_marginTop="14dp"
-            android:layout_marginBottom="14dp" >
+            android:padding="12dp" >
+
+            <TextView
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:text="@string/swipe_to_refresh" />
 
             <LinearLayout
                 android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
-            android:layout_marginTop="14dp"
-            android:layout_marginBottom="14dp" >
+            android:padding="12dp" >
+
+            <TextView
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:text="@string/webview_theme" />
 
             <LinearLayout
                 android:layout_height="wrap_content"
 
         <!-- Wide Viewport. -->
         <LinearLayout
+            android:id="@+id/wide_viewport_linearlayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
-            android:layout_marginTop="14dp"
-            android:layout_marginBottom="14dp" >
+            android:padding="12dp" >
+
+            <TextView
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:text="@string/wide_viewport" />
 
             <LinearLayout
                 android:layout_height="wrap_content"
 
         <!-- Display Images. -->
         <LinearLayout
+            android:id="@+id/display_images_linearlayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
-            android:layout_marginTop="14dp"
-            android:layout_marginBottom="14dp" >
+            android:padding="12dp" >
+
+            <TextView
+                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:text="@string/display_images" />
 
             <LinearLayout
                 android:layout_height="wrap_content"
                 android:orientation="horizontal" >
 
                 <ImageView
-                    android:id="@+id/display_webpage_images_imageview"
+                    android:id="@+id/display_images_imageview"
                     android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:layout_marginTop="1dp"
                     android:contentDescription="@string/display_webpage_images" />
 
                 <Spinner
-                    android:id="@+id/display_webpage_images_spinner"
+                    android:id="@+id/display_images_spinner"
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent" />
             </LinearLayout>
 
             <TextView
-                android:id="@+id/display_webpage_images_textview"
+                android:id="@+id/display_images_textview"
                 android:layout_height="wrap_content"
                 android:layout_width="match_parent"
                 android:layout_marginStart="45dp"
             android:layout_width="match_parent"
             android:orientation="vertical"
             android:layout_marginTop="18dp"
-            android:layout_marginBottom="18dp" >
+            android:layout_marginBottom="18dp"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp"
+            tools:ignore="TooManyViews" >
 
             <!-- Switch -->
             <LinearLayout
                     android:layout_marginStart="8dp"
                     android:text="@string/pinned_ssl_certificate"
                     android:textColor="?android:textColorPrimary"
-                    android:textSize="18sp"
-                    tools:ignore="TooManyViews" />
+                    android:textSize="18sp" />
             </LinearLayout>
 
             <!-- Saved Certificate -->
                         android:textSize="17sp"
                         android:textAllCaps="true"
                         android:textStyle="bold"
-                        android:textColor="?android:textColorPrimary" />
+                        android:textColor="?android:textColorPrimary"
+                        tools:ignore="TooManyViews" />
 
                     <LinearLayout
                         android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:orientation="vertical"
             android:layout_marginTop="18dp"
-            android:layout_marginBottom="18dp" >
+            android:layout_marginBottom="18dp"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="12dp" >
 
             <!-- Switch -->
             <LinearLayout