mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
show proper error for download category
This commit is contained in:
parent
ac4bb2e027
commit
d031998123
@ -81,6 +81,10 @@ public class DirectorySelectActivity extends BaseLanguageActivity {
|
|||||||
showErrorDialog(getString(R.string.select_a_folder));
|
showErrorDialog(getString(R.string.select_a_folder));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!"com.android.externalstorage.documents".equals(data.getData().getAuthority())) {
|
||||||
|
showErrorDialog(getString(R.string.dir_select_no_download_folder));
|
||||||
|
return;
|
||||||
|
}
|
||||||
AppExecutors.INSTANCE.getMainThread().execute(() -> {
|
AppExecutors.INSTANCE.getMainThread().execute(() -> {
|
||||||
try {
|
try {
|
||||||
viewModel.setupSelectedDir(data);
|
viewModel.setupSelectedDir(data);
|
||||||
|
@ -102,7 +102,9 @@ public class DownloadsPreferencesFragment extends BasePreferencesFragment {
|
|||||||
final ConfirmDialogFragment dialogFragment = ConfirmDialogFragment.newInstance(
|
final ConfirmDialogFragment dialogFragment = ConfirmDialogFragment.newInstance(
|
||||||
123,
|
123,
|
||||||
R.string.error,
|
R.string.error,
|
||||||
"Please report this error to the developers:\n\n" + sw.toString(),
|
"com.android.externalstorage.documents".equals(data.getData().getAuthority())
|
||||||
|
? "Please report this error to the developers:\n\n" + sw.toString()
|
||||||
|
: getString(R.string.dir_select_no_download_folder),
|
||||||
R.string.ok,
|
R.string.ok,
|
||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
|
@ -68,7 +68,7 @@ public final class DownloadUtils {
|
|||||||
if (TextUtils.isEmpty(barinstaDirUri)) {
|
if (TextUtils.isEmpty(barinstaDirUri)) {
|
||||||
throw new ReselectDocumentTreeException("folder path is null or empty");
|
throw new ReselectDocumentTreeException("folder path is null or empty");
|
||||||
}
|
}
|
||||||
if (!barinstaDirUri.startsWith("content")) {
|
if (!barinstaDirUri.startsWith("content://com.android.externalstorage.documents")) {
|
||||||
// reselect the folder in selector view
|
// reselect the folder in selector view
|
||||||
throw new ReselectDocumentTreeException(Uri.parse(barinstaDirUri));
|
throw new ReselectDocumentTreeException(Uri.parse(barinstaDirUri));
|
||||||
}
|
}
|
||||||
|
@ -512,6 +512,7 @@
|
|||||||
<string name="dir_select_folder_not_exist">The previously selected folder does not exist now:</string>
|
<string name="dir_select_folder_not_exist">The previously selected folder does not exist now:</string>
|
||||||
<string name="dir_select_message2">Re-select the directory or select a new directory by clicking the button below.</string>
|
<string name="dir_select_message2">Re-select the directory or select a new directory by clicking the button below.</string>
|
||||||
<string name="select_a_folder">No folder selected!</string>
|
<string name="select_a_folder">No folder selected!</string>
|
||||||
|
<string name="dir_select_no_download_folder">Please choose a directory from your storage, not a category on the sidebar.</string>
|
||||||
<string name="dir_select_success_message">Success! Please wait. Starting app…</string>
|
<string name="dir_select_success_message">Success! Please wait. Starting app…</string>
|
||||||
<string name="barinsta_folder">Barinsta folder</string>
|
<string name="barinsta_folder">Barinsta folder</string>
|
||||||
<string name="top">Top</string>
|
<string name="top">Top</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user