From d83e7c4c70e624d037ba84576c9174a7f49cf88a Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Fri, 6 Sep 2019 21:40:11 +0200 Subject: [PATCH] only show Progress Dialog if necessary when sending toot (#1470) --- .../main/java/com/keylesspalace/tusky/ComposeActivity.java | 4 ++++ .../java/com/keylesspalace/tusky/util/CountUpDownLatch.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index a626018e..6abdf2cb 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -1101,6 +1101,10 @@ public final class ComposeActivity } private void readyStatus(final Status.Visibility visibility, final boolean sensitive) { + if (waitForMediaLatch.isEmpty()) { + onReadySuccess(visibility, sensitive); + return; + } finishingUploadDialog = ProgressDialog.show( this, getString(R.string.dialog_title_finishing_media_upload), getString(R.string.dialog_message_uploading_media), true, true); diff --git a/app/src/main/java/com/keylesspalace/tusky/util/CountUpDownLatch.java b/app/src/main/java/com/keylesspalace/tusky/util/CountUpDownLatch.java index 6874337b..70a08486 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/CountUpDownLatch.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/CountUpDownLatch.java @@ -44,4 +44,8 @@ public class CountUpDownLatch { wait(); } } + + public synchronized boolean isEmpty() { + return count == 0; + } }