X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FDomainSettingsFragment.java;fp=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Ffragments%2FDomainSettingsFragment.java;h=3a216eb164d588105f9560bbe94036c00c54da23;hp=89f8513ed42072a13cd08a76906820af4894a9d9;hb=e2d4437956f57b50bda1f27c9b4eea9367de7758;hpb=8a775f43cc1ce3a277e8875da66a57eac353088d diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java index 89f8513e..3a216eb1 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java @@ -63,14 +63,14 @@ import java.util.Calendar; import java.util.Date; public class DomainSettingsFragment extends Fragment { - // Initialize the public class constants. These are used by activities calling this fragment. + // Initialize the public class constants. public static final String DATABASE_ID = "database_id"; public static final String SCROLL_Y = "scroll_y"; - // Define the public variables. `databaseId` is public static so it can be accessed from `DomainsActivity`. It is also used in `onCreate()` and `onCreateView()`. + // Declare the public variables. `databaseId` is public static so it can be accessed from `DomainsActivity`. public static int databaseId; - // Define the class variables. + // Declare the class variables. private int scrollY; @Override @@ -86,7 +86,6 @@ public class DomainSettingsFragment extends Fragment { scrollY = getArguments().getInt(SCROLL_Y); } - // The deprecated `getDrawable()` must be used until the minimum API >= 21. @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate `domain_settings_fragment`. `false` does not attach it to the root `container`. @@ -142,6 +141,7 @@ public class DomainSettingsFragment extends Fragment { ImageView xRequestedWithHeaderImageView = domainSettingsView.findViewById(R.id.x_requested_with_header_imageview); Spinner xRequestedWithHeaderSpinner = domainSettingsView.findViewById(R.id.x_requested_with_header_spinner); TextView xRequestedWithHeaderTextView = domainSettingsView.findViewById(R.id.x_requested_with_header_textview); + TextView xRequestedWithHeaderExplanationTextView = domainSettingsView.findViewById(R.id.x_requested_with_header_explanation_textview); Spinner fontSizeSpinner = domainSettingsView.findViewById(R.id.font_size_spinner); TextView defaultFontSizeTextView = domainSettingsView.findViewById(R.id.default_font_size_textview); EditText customFontSizeEditText = domainSettingsView.findViewById(R.id.custom_font_size_edittext); @@ -535,6 +535,12 @@ public class DomainSettingsFragment extends Fragment { xRequestedWithHeaderSpinner.performClick(); }); + // Open the X-Requested-With header spinner when the explanation text view is clicked. + xRequestedWithHeaderExplanationTextView.setOnClickListener((View v) -> { + // Open the X-Requested header spinner. + xRequestedWithHeaderSpinner.performClick(); + }); + // Display the font size settings. if (fontSizeInt == 0) { // `0` is the code for system default font size. // Set the font size to the system default