From f5ffbd4eb4eb9db1ff65aa02c3a40cf3234f2660 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 14 Jan 2020 18:51:16 -0800 Subject: [PATCH] More bug fixes #64 and #63 --- .../ui/setting/SettingsBackupController.kt | 24 ++++++++++-------- app/src/main/res/drawable/filter_mock.webp | Bin 77343 -> 77344 bytes 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt index 1cbaebae17..3b68bf8b19 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBackupController.kt @@ -233,17 +233,19 @@ class SettingsBackupController : SettingsController() { override fun onCreateDialog(savedViewState: Bundle?): Dialog { val activity = activity!! - val unifile = UniFile.fromUri(activity, args.getParcelable(KEY_URI)) - return MaterialDialog(activity) - .title(R.string.backup_created) - .message(R.string.file_saved, unifile.filePath) - .positiveButton(R.string.action_close) - .negativeButton(R.string.action_export) { - val sendIntent = Intent(Intent.ACTION_SEND) - sendIntent.type = "application/json" - sendIntent.putExtra(Intent.EXTRA_STREAM, unifile.uri) - startActivity(Intent.createChooser(sendIntent, "")) - } + val uniFile = UniFile.fromUri(activity, args.getParcelable(KEY_URI)) + return MaterialDialog(activity).apply { + title(R.string.backup_created) + if (uniFile.filePath != null) + message(text = resources?.getString(R.string.file_saved, uniFile.filePath)) + positiveButton(R.string.action_close) + negativeButton(R.string.action_share) { + val sendIntent = Intent(Intent.ACTION_SEND) + sendIntent.type = "application/json" + sendIntent.putExtra(Intent.EXTRA_STREAM, uniFile.uri) + startActivity(Intent.createChooser(sendIntent, "")) + } + } } private companion object { diff --git a/app/src/main/res/drawable/filter_mock.webp b/app/src/main/res/drawable/filter_mock.webp index ab043daab51376be8b33eb6f3e51e922d3e9d1b8..c65b390cb6d82fafe8cede665a0f4e096554f450 100644 GIT binary patch delta 16 YcmbP#hh@PXmJKRD8F@FW{QPYK07D%I+5i9m delta 14 WcmZ2*hh_d9mJKRDH>>{qZ2|x}H3!WA