- case "download_location":
- // Get the new download location.
- String newDownloadLocationString = sharedPreferences.getString("download_location", getString(R.string.download_location_default_value));
-
- // Check to see if a download custom location is selected.
- if (newDownloadLocationString.equals(downloadLocationEntryValuesStringArray[3])) { // A download custom location is selected.
- // Set the download location summary text to be `Custom`.
- downloadLocationPreference.setSummary(downloadLocationEntriesStringArray[3]);
-
- // Enable the download custom location preference.
- downloadCustomLocationPreference.setEnabled(true);
- } else { // A download custom location is not selected.
- // Set the download location summary text to be the download location.
- downloadLocationPreference.setSummary(downloadLocationHelper.getDownloadLocation(context));
-
- // Disable the download custom location.
- downloadCustomLocationPreference.setEnabled(newDownloadLocationString.equals(downloadLocationEntryValuesStringArray[3]));
- }
-
- // Update the download custom location icon.
- if (downloadCustomLocationPreference.isEnabled()) {
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- downloadCustomLocationPreference.setIcon(R.drawable.downloads_enabled_night);
- } else {
- downloadCustomLocationPreference.setIcon(R.drawable.downloads_enabled_day);
- }
- } else {
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- downloadCustomLocationPreference.setIcon(R.drawable.downloads_ghosted_night);
- } else {
- downloadCustomLocationPreference.setIcon(R.drawable.downloads_ghosted_day);
- }
- }
- break;
-
- case "download_custom_location":
- // Set the new download custom location as the summary text for the preference.
- downloadCustomLocationPreference.setSummary(sharedPreferences.getString("download_custom_location", getString(R.string.download_custom_location_default_value)));
- break;
-