From 13a74a36fe8d5fb4e9c6c01fd2cc7c326f06c965 Mon Sep 17 00:00:00 2001 From: stefan-niedermann Date: Fri, 13 Mar 2020 23:10:10 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20#749=20=F0=9F=97=A8=EF=B8=8F=20Remove=20t?= =?UTF-8?q?oasts=20(and=20only=20display=20snackbars)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: stefan-niedermann --- .../owncloud/notes/persistence/NoteServerSyncHelper.java | 9 ++++----- fastlane/metadata/android/en-US/changelogs/2011000.txt | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java index 26088d77..2c16df9c 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NoteServerSyncHelper.java @@ -493,27 +493,26 @@ public class NoteServerSyncHelper { .setPositiveButton(android.R.string.copy, (a, b) -> { final ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText(context.getString(R.string.simple_exception), "```\n" + debugInfos + "\n```"); - clipboardManager.setPrimaryClip(clipData); + Objects.requireNonNull(clipboardManager).setPrimaryClip(clipData); Toast.makeText(context, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show(); a.dismiss(); }) .setNegativeButton(R.string.simple_close, null) .create(); dialog.show(); - ((TextView) dialog.findViewById(android.R.id.message)).setTypeface(Typeface.MONOSPACE); + ((TextView) Objects.requireNonNull(dialog.findViewById(android.R.id.message))).setTypeface(Typeface.MONOSPACE); }) .show(); } else { - Toast.makeText(context.getApplicationContext(), statusMessage, Toast.LENGTH_LONG).show(); for (Throwable e : exceptions) { - Toast.makeText(context.getApplicationContext(), e.getClass().getName() + ": " + e.getMessage(), Toast.LENGTH_LONG).show(); + Log.e(TAG, statusMessage, e); } } } syncActive.put(ssoAccount.name, false); // notify callbacks if (callbacks.containsKey(ssoAccount.name) && callbacks.get(ssoAccount.name) != null) { - for (ISyncCallback callback : callbacks.get(ssoAccount.name)) { + for (ISyncCallback callback : Objects.requireNonNull(callbacks.get(ssoAccount.name))) { callback.onFinish(); } } diff --git a/fastlane/metadata/android/en-US/changelogs/2011000.txt b/fastlane/metadata/android/en-US/changelogs/2011000.txt index e4ae4069..3c6a387a 100644 --- a/fastlane/metadata/android/en-US/changelogs/2011000.txt +++ b/fastlane/metadata/android/en-US/changelogs/2011000.txt @@ -1 +1,2 @@ - 🔒 Password protection (#354) - special thanks to @beatbrot +- 🗨️ Remove toasts (#749) \ No newline at end of file