1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-19 08:36:40 +01:00

Improve SAF switch descriptions in settings

This commit is contained in:
Stypox 2021-01-16 14:10:24 +01:00
parent 6a0c5a874c
commit bcb1cf6603
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
3 changed files with 14 additions and 10 deletions

View File

@ -64,15 +64,17 @@ public class DownloadSettingsFragment extends BasePreferenceFragment {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|| Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
prefUseSaf.setEnabled(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
prefUseSaf.setSummary(R.string.downloads_storage_use_saf_summary_api_29);
} else {
prefUseSaf.setSummary(R.string.downloads_storage_use_saf_summary_api_19);
}
prefStorageAsk.setSummary(R.string.downloads_storage_ask_summary_no_saf_notice);
}
updatePreferencesSummary();
updatePathPickers(!defaultPreferences.getBoolean(downloadStorageAsk, false));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
prefStorageAsk.setSummary(R.string.downloads_storage_ask_summary);
}
if (hasInvalidPath(downloadPathVideoPreference)
|| hasInvalidPath(downloadPathAudioPreference)) {
updatePreferencesSummary();

View File

@ -641,10 +641,12 @@
<string name="start_downloads">Start downloads</string>
<string name="pause_downloads">Pause downloads</string>
<string name="downloads_storage_ask_title">Ask where to download</string>
<string name="downloads_storage_ask_summary">You will be asked where to save each download</string>
<string name="downloads_storage_ask_summary_kitkat">You will be asked where to save each download.\nChoose SAF if you want to download to an external SD card</string>
<string name="downloads_storage_use_saf_title">Use SAF</string>
<string name="downloads_storage_use_saf_summary">The \'Storage Access Framework\' allows downloads to an external SD card.\nSome devices are incompatible</string>
<string name="downloads_storage_ask_summary">You will be asked where to save each download.\nEnable the system folder picker (SAF) if you want to download to an external SD card</string>
<string name="downloads_storage_ask_summary_no_saf_notice">You will be asked where to save each download</string>
<string name="downloads_storage_use_saf_title">Use system folder picker (SAF)</string>
<string name="downloads_storage_use_saf_summary">The \'Storage Access Framework\' allows downloads to an external SD card</string>
<string name="downloads_storage_use_saf_summary_api_19">The \'Storage Access Framework\' is not supported on Android KitKat and below</string>
<string name="downloads_storage_use_saf_summary_api_29">Starting from Android 10 only \'Storage Access Framework\' is supported</string>
<string name="choose_instance_prompt">Choose an instance</string>
<string name="app_language_title">App language</string>
<string name="systems_language">System default</string>

View File

@ -3,10 +3,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/settings_category_downloads_title">
<CheckBoxPreference
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="@string/downloads_storage_ask"
android:summary="@string/downloads_storage_ask_summary_kitkat"
android:summary="@string/downloads_storage_ask_summary"
android:title="@string/downloads_storage_ask_title"
app:iconSpaceReserved="false" />