diff options
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java | 29 | ||||
-rw-r--r-- | ui/i18n/src/main/res/values/strings.xml | 2 |
2 files changed, 12 insertions, 19 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java index 3b4368464..686be884c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/ImportExportPreferencesFragment.java @@ -147,7 +147,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { .subscribe(output -> { Uri fileUri = FileProvider.getUriForFile(context.getApplicationContext(), context.getString(R.string.provider_authority), output); - showExportSuccessDialog(output.toString(), fileUri, exportType); + showExportSuccessSnackbar(fileUri, exportType.contentType); }, this::showExportErrorDialog, progressDialog::dismiss); } else { DocumentFileExportWorker worker = new DocumentFileExportWorker(exportWriter, context, uri); @@ -155,7 +155,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(output -> - showExportSuccessDialog(output.getUri().toString(), output.getUri(), exportType), + showExportSuccessSnackbar(output.getUri(), exportType.contentType), this::showExportErrorDialog, progressDialog::dismiss); } } @@ -191,20 +191,15 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { builder.show(); } - private void showExportSuccessDialog(String path, Uri streamUri, Export exportType) { - final MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(getContext()); - alert.setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss()); - alert.setTitle(R.string.export_success_title); - alert.setMessage(getContext().getString(R.string.export_success_sum, path)); - alert.setPositiveButton(R.string.send_label, (dialog, which) -> { - new ShareCompat.IntentBuilder(getContext()) - .setType(exportType.contentType) - .setSubject(getString(exportType.labelResId)) - .addStream(streamUri) - .setChooserTitle(R.string.send_label) - .startChooser(); - }); - alert.create().show(); + void showExportSuccessSnackbar(Uri uri, String mimeType) { + Snackbar.make(getView(), R.string.export_success_title, Snackbar.LENGTH_LONG) + .setAction(R.string.share_label, v -> + new ShareCompat.IntentBuilder(getContext()) + .setType(mimeType) + .addStream(uri) + .setChooserTitle(R.string.share_label) + .startChooser()) + .show(); } private void showExportErrorDialog(final Throwable error) { @@ -264,7 +259,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(() -> { - Snackbar.make(getView(), R.string.export_success_title, Snackbar.LENGTH_LONG).show(); + showExportSuccessSnackbar(uri, "application/x-sqlite3"); progressDialog.dismiss(); }, this::showExportErrorDialog); } diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml index a35f5ab90..493e8672c 100644 --- a/ui/i18n/src/main/res/values/strings.xml +++ b/ui/i18n/src/main/res/values/strings.xml @@ -138,7 +138,6 @@ <string name="feed_auto_download_never">Never</string> <string name="feed_new_episodes_action_add_to_inbox">Add to inbox</string> <string name="feed_new_episodes_action_nothing">Nothing</string> - <string name="send_label">Send…</string> <string name="episode_cleanup_never">Never</string> <string name="episode_cleanup_except_favorite_removal">When not favorited</string> <string name="episode_cleanup_queue_removal">When not in queue</string> @@ -590,7 +589,6 @@ <string name="please_wait">Please wait…</string> <string name="export_error_label">Export error</string> <string name="export_success_title">Export successful</string> - <string name="export_success_sum">The exported file was written to:\n\n%1$s</string> <string name="opml_import_ask_read_permission">Access to external storage is required to read the OPML file</string> <string name="successful_import_label">Import successful</string> <string name="import_ok">Please press OK to restart AntennaPod</string> |