diff --git a/src/org/thoughtcrime/securesms/components/AudioView.java b/src/org/thoughtcrime/securesms/components/AudioView.java index 23546b71bc..a90b1bb814 100644 --- a/src/org/thoughtcrime/securesms/components/AudioView.java +++ b/src/org/thoughtcrime/securesms/components/AudioView.java @@ -31,7 +31,6 @@ import org.thoughtcrime.securesms.events.PartProgressEvent; import org.thoughtcrime.securesms.logging.Log; import org.thoughtcrime.securesms.mms.AudioSlide; import org.thoughtcrime.securesms.mms.SlideClickListener; -import org.thoughtcrime.securesms.util.Util; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -320,15 +319,10 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener } } - @Subscribe(sticky = true, threadMode = ThreadMode.ASYNC) + @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) public void onEventAsync(final PartProgressEvent event) { - if (audioSlidePlayer != null && event.attachment.equals(this.audioSlidePlayer.getAudioSlide().asAttachment())) { - Util.runOnMain(new Runnable() { - @Override - public void run() { - downloadProgress.setInstantProgress(((float) event.progress) / event.total); - } - }); + if (audioSlidePlayer != null && event.attachment.equals(audioSlidePlayer.getAudioSlide().asAttachment())) { + downloadProgress.setInstantProgress(((float) event.progress) / event.total); } } diff --git a/src/org/thoughtcrime/securesms/components/DocumentView.java b/src/org/thoughtcrime/securesms/components/DocumentView.java index 50f11cd141..44a8daa9e7 100644 --- a/src/org/thoughtcrime/securesms/components/DocumentView.java +++ b/src/org/thoughtcrime/securesms/components/DocumentView.java @@ -8,7 +8,6 @@ import android.graphics.PorterDuff; import android.support.annotation.AttrRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v4.graphics.drawable.DrawableCompat; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -147,15 +146,10 @@ public class DocumentView extends FrameLayout { return ""; } - @Subscribe(sticky = true, threadMode = ThreadMode.ASYNC) + @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) public void onEventAsync(final PartProgressEvent event) { - if (documentSlide != null && event.attachment.equals(this.documentSlide.asAttachment())) { - Util.runOnMain(new Runnable() { - @Override - public void run() { - downloadProgress.setInstantProgress(((float) event.progress) / event.total); - } - }); + if (documentSlide != null && event.attachment.equals(documentSlide.asAttachment())) { + downloadProgress.setInstantProgress(((float) event.progress) / event.total); } } diff --git a/src/org/thoughtcrime/securesms/components/TransferControlView.java b/src/org/thoughtcrime/securesms/components/TransferControlView.java index 3f8cb4f9ef..323208d903 100644 --- a/src/org/thoughtcrime/securesms/components/TransferControlView.java +++ b/src/org/thoughtcrime/securesms/components/TransferControlView.java @@ -28,7 +28,6 @@ import org.thoughtcrime.securesms.attachments.Attachment; import org.thoughtcrime.securesms.database.AttachmentDatabase; import org.thoughtcrime.securesms.events.PartProgressEvent; import org.thoughtcrime.securesms.mms.Slide; -import org.thoughtcrime.securesms.util.Util; import org.thoughtcrime.securesms.util.ViewUtil; import java.util.Collections; @@ -253,13 +252,11 @@ public class TransferControlView extends FrameLayout { return totalProgress; } - @Subscribe(sticky = true, threadMode = ThreadMode.ASYNC) + @Subscribe(sticky = true, threadMode = ThreadMode.MAIN) public void onEventAsync(final PartProgressEvent event) { if (downloadProgress.containsKey(event.attachment)) { - Util.runOnMain(() -> { - downloadProgress.put(event.attachment, ((float)event.progress) / event.total); - progressWheel.setInstantProgress(calculateProgress(downloadProgress)); - }); + downloadProgress.put(event.attachment, ((float) event.progress) / event.total); + progressWheel.setInstantProgress(calculateProgress(downloadProgress)); } } }