mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Upgrade to EventBus 3.X
// FREEBIE
This commit is contained in:
@@ -20,6 +20,9 @@ import com.nineoldandroids.animation.ValueAnimator;
|
||||
import com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener;
|
||||
import com.pnikosis.materialishprogress.ProgressWheel;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.database.AttachmentDatabase;
|
||||
import org.thoughtcrime.securesms.events.PartProgressEvent;
|
||||
@@ -27,8 +30,6 @@ import org.thoughtcrime.securesms.mms.Slide;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
|
||||
public class TransferControlView extends FrameLayout {
|
||||
private static final int TRANSITION_MS = 300;
|
||||
|
||||
@@ -81,7 +82,7 @@ public class TransferControlView extends FrameLayout {
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
if (!EventBus.getDefault().isRegistered(this)) EventBus.getDefault().registerSticky(this);
|
||||
if (!EventBus.getDefault().isRegistered(this)) EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,7 +163,7 @@ public class TransferControlView extends FrameLayout {
|
||||
return anim;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Subscribe(sticky = true, threadMode = ThreadMode.ASYNC)
|
||||
public void onEventAsync(final PartProgressEvent event) {
|
||||
if (this.slide != null && event.attachment.equals(this.slide.asAttachment())) {
|
||||
Util.runOnMain(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user