]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java
Create UltraList. https://redmine.stoutner.com/issues/450
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / DomainsActivity.java
index 7ac850b48a1eec69efc34b4ad13a741f0e72b4ee..037ed592f8cf056977defb4d7963f225cf1a82f0 100644 (file)
@@ -687,14 +687,16 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
         Switch easyPrivacySwitch = view.findViewById(R.id.easyprivacy_switch);
         Switch fanboysAnnoyanceSwitch = view.findViewById(R.id.fanboys_annoyance_list_switch);
         Switch fanboysSocialBlockingSwitch = view.findViewById(R.id.fanboys_social_blocking_list_switch);
+        Switch ultraListSwitch = view.findViewById(R.id.ultralist_switch);
         Switch ultraPrivacySwitch = view.findViewById(R.id.ultraprivacy_switch);
         Switch 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 fontSizeSpinner = view.findViewById(R.id.font_size_spinner);
         Spinner swipeToRefreshSpinner = view.findViewById(R.id.swipe_to_refresh_spinner);
-        Spinner displayWebpageImagesSpinner = view.findViewById(R.id.display_webpage_images_spinner);
         Spinner nightModeSpinner = view.findViewById(R.id.night_mode_spinner);
+        Spinner wideViewportSpinner = view.findViewById(R.id.wide_viewport_spinner);
+        Spinner displayWebpageImagesSpinner = view.findViewById(R.id.display_webpage_images_spinner);
         Switch pinnedSslCertificateSwitch = view.findViewById(R.id.pinned_ssl_certificate_switch);
         RadioButton currentWebsiteCertificateRadioButton = view.findViewById(R.id.current_website_certificate_radiobutton);
         Switch pinnedIpAddressesSwitch = view.findViewById(R.id.pinned_ip_addresses_switch);
@@ -702,22 +704,24 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
 
         // Extract the data for the domain settings.
         String domainNameString = domainNameEditText.getText().toString();
-        boolean javaScriptEnabled = javaScriptSwitch.isChecked();
-        boolean firstPartyCookiesEnabled = firstPartyCookiesSwitch.isChecked();
-        boolean thirdPartyCookiesEnabled = thirdPartyCookiesSwitch.isChecked();
-        boolean domStorageEnabled  = domStorageSwitch.isChecked();
-        boolean formDataEnabled = formDataSwitch.isChecked();  // Form data can be removed once the minimum API >= 26.
-        boolean easyListEnabled = easyListSwitch.isChecked();
-        boolean easyPrivacyEnabled = easyPrivacySwitch.isChecked();
-        boolean fanboysAnnoyanceEnabled = fanboysAnnoyanceSwitch.isChecked();
-        boolean fanboysSocialBlockingEnabled = fanboysSocialBlockingSwitch.isChecked();
-        boolean ultraPrivacyEnabled = ultraPrivacySwitch.isChecked();
+        boolean javaScript = javaScriptSwitch.isChecked();
+        boolean firstPartyCookies = firstPartyCookiesSwitch.isChecked();
+        boolean thirdPartyCookies = thirdPartyCookiesSwitch.isChecked();
+        boolean domStorage  = domStorageSwitch.isChecked();
+        boolean formData = formDataSwitch.isChecked();  // Form data can be removed once the minimum API >= 26.
+        boolean easyList = easyListSwitch.isChecked();
+        boolean easyPrivacy = easyPrivacySwitch.isChecked();
+        boolean fanboysAnnoyance = fanboysAnnoyanceSwitch.isChecked();
+        boolean fanboysSocialBlocking = fanboysSocialBlockingSwitch.isChecked();
+        boolean ultraList = ultraListSwitch.isChecked();
+        boolean ultraPrivacy = ultraPrivacySwitch.isChecked();
         boolean blockAllThirdPartyRequests = blockAllThirdPartyRequestsSwitch.isChecked();
         int userAgentPosition = userAgentSpinner.getSelectedItemPosition();
         int fontSizePosition = fontSizeSpinner.getSelectedItemPosition();
         int swipeToRefreshInt = swipeToRefreshSpinner.getSelectedItemPosition();
-        int displayWebpageImagesInt = displayWebpageImagesSpinner.getSelectedItemPosition();
         int nightModeInt = nightModeSpinner.getSelectedItemPosition();
+        int wideViewportInt = wideViewportSpinner.getSelectedItemPosition();
+        int displayWebpageImagesInt = displayWebpageImagesSpinner.getSelectedItemPosition();
         boolean pinnedSslCertificate = pinnedSslCertificateSwitch.isChecked();
         boolean pinnedIpAddress = pinnedIpAddressesSwitch.isChecked();
 
@@ -748,14 +752,14 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
         int fontSizeInt = Integer.parseInt(resources.getStringArray(R.array.domain_settings_font_size_entry_values)[fontSizePosition]);
 
         // Save the domain settings.
-        domainsDatabaseHelper.updateDomain(DomainsActivity.currentDomainDatabaseId, domainNameString, javaScriptEnabled, firstPartyCookiesEnabled, thirdPartyCookiesEnabled,
-                    domStorageEnabled, formDataEnabled, easyListEnabled, easyPrivacyEnabled, fanboysAnnoyanceEnabled, fanboysSocialBlockingEnabled, ultraPrivacyEnabled, blockAllThirdPartyRequests,
-                    userAgentName, fontSizeInt, swipeToRefreshInt, nightModeInt, displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
+        domainsDatabaseHelper.updateDomain(DomainsActivity.currentDomainDatabaseId, domainNameString, javaScript, firstPartyCookies, thirdPartyCookies, domStorage, formData, easyList, easyPrivacy,
+                fanboysAnnoyance, fanboysSocialBlocking, ultraList, ultraPrivacy, blockAllThirdPartyRequests, userAgentName, fontSizeInt, swipeToRefreshInt, nightModeInt, wideViewportInt,
+                displayWebpageImagesInt, pinnedSslCertificate, pinnedIpAddress);
 
         // Update the pinned SSL certificate if a new one is checked.
         if (currentWebsiteCertificateRadioButton.isChecked()) {
             // Update the database.
-            domainsDatabaseHelper.updatePinnedSslCertificate(currentDomainDatabaseId, sslIssuedToCName, sslIssuedToOName, sslIssuedToUName, sslIssuedToCName, sslIssuedToOName, sslIssuedToUName,
+            domainsDatabaseHelper.updatePinnedSslCertificate(currentDomainDatabaseId, sslIssuedToCName, sslIssuedToOName, sslIssuedToUName, sslIssuedByCName, sslIssuedByOName, sslIssuedByUName,
                     sslStartDateLong, sslEndDateLong);
         }
 
@@ -790,7 +794,7 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
             }
         };
 
-        // Update the `ListView`.
+        // Update the list view.
         domainsListView.setAdapter(domainsCursorAdapter);
 
         // Display the domain settings in the second pane if operating in two pane mode and the database contains at least one domain.