- // Convert `unformattedUrlString` to a `URL`, then to a `URI`, and then back to a `String`, which sanitizes the input and adds in any missing components.
+ // Convert the unformatted URL string to a URL, then to a URI, and then back to a string, which sanitizes the input and adds in any missing components.
try {
unformattedUrl = new URL(unformattedUrlString);
} catch (MalformedURLException e) {
try {
unformattedUrl = new URL(unformattedUrlString);
} catch (MalformedURLException e) {
@@ -3026,7+3018,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
// 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.
}
// 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.
- // Set the swipe to refresh icon and TextView settings. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ // 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.
switch (swipeToRefreshInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultSwipeToRefresh) { // Swipe to refresh is enabled by default.
switch (swipeToRefreshInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultSwipeToRefresh) { // Swipe to refresh is enabled by default.
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
@@ -851,6+761,7 @@ public class DomainSettingsFragment extends Fragment {
}
// 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.
}
// 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.
switch (webViewThemeInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT: // The domain WebView theme is system default.
// Set the icon according to the app WebView theme.
switch (webViewThemeInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT: // The domain WebView theme is system default.
// Set the icon according to the app WebView theme.
@@ -858,29+769,22 @@ public class DomainSettingsFragment extends Fragment {
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) {
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) {
@@ -930,21+826,14 @@ public class DomainSettingsFragment extends Fragment {
}
// 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.
}
// 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.
switch (wideViewportInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
switch (wideViewportInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
+ // Set the icon.
if (defaultWideViewport) { // Wide viewport enabled by default.
if (defaultWideViewport) { // Wide viewport enabled by default.
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
@@ -993,22+874,15 @@ public class DomainSettingsFragment extends Fragment {
}
// 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.
}
// 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.
switch (displayImagesInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultDisplayWebpageImages) { // Display webpage images enabled by default.
switch (displayImagesInt) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
if (defaultDisplayWebpageImages) { // Display webpage images enabled by default.
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
@@ -1048,25+914,18 @@ public class DomainSettingsFragment extends Fragment {
// 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.
// 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);
// Check the switch.
pinnedSslCertificateSwitch.setChecked(true);
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
@@ -1235,25+1094,18 @@ public class DomainSettingsFragment extends Fragment {
// 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.
// 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);
// Check the switch.
pinnedIpAddressesSwitch.setChecked(true);
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
- // Update the icon and the visibility of `nightModeTextView`. Once the minimum API >= 21 a selector can be used as the tint mode instead of specifying different icons.
+ // 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.
switch (position) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
switch (position) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT:
- if (defaultSwipeToRefresh) { // Swipe to refresh enabled by default.
- // Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
@@ -1717,6+1451,7 @@ public class DomainSettingsFragment extends Fragment {
@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.
@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.
switch (position) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT: // the domain WebView theme is system default.
// Set the icon according to the app WebView theme.
switch (position) {
case DomainsDatabaseHelper.SYSTEM_DEFAULT: // the domain WebView theme is system default.
// Set the icon according to the app WebView theme.
@@ -1724,30+1459,22 @@ public class DomainSettingsFragment extends Fragment {
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) {
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) {