Search in sources :

Example 56 with CompositeDisposable

use of io.reactivex.disposables.CompositeDisposable in project DevRing by LJYcoder.

the class RxBus method register.

/**
 * 注册事件监听
 *
 * @param object
 */
public void register(Object object) {
    if (object == null) {
        throw new NullPointerException("Object to register must not be null.");
    }
    CompositeDisposable compositeDisposable = new CompositeDisposable();
    EventComposite subscriberMethods = EventFind.findAnnotatedSubscriberMethods(object, compositeDisposable);
    mEventCompositeMap.put(object, subscriberMethods);
    if (!STICKY_EVENT_MAP.isEmpty()) {
        // 如果有粘性事件,则发送粘性事件
        subscriberMethods.subscriberSticky(STICKY_EVENT_MAP);
    }
}
Also used : CompositeDisposable(io.reactivex.disposables.CompositeDisposable)

Example 57 with CompositeDisposable

use of io.reactivex.disposables.CompositeDisposable in project Awesome-WanAndroid by JsonChao.

the class AbstractSimpleDialogFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    mRootView = inflater.inflate(getLayout(), container, false);
    unBinder = ButterKnife.bind(this, mRootView);
    mCompositeDisposable = new CompositeDisposable();
    initEventAndData();
    return mRootView;
}
Also used : CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Nullable(android.support.annotation.Nullable)

Example 58 with CompositeDisposable

use of io.reactivex.disposables.CompositeDisposable in project Awesome-WanAndroid by JsonChao.

the class AbstractSimpleFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(getLayout(), container, false);
    unBinder = ButterKnife.bind(this, view);
    mCompositeDisposable = new CompositeDisposable();
    return view;
}
Also used : View(android.view.View) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Nullable(android.support.annotation.Nullable)

Example 59 with CompositeDisposable

use of io.reactivex.disposables.CompositeDisposable in project MyApp by MatthewDevelop.

the class HomeFragment method init.

@Override
protected void init() {
    super.init();
    mCompositeDisposable = new CompositeDisposable();
}
Also used : CompositeDisposable(io.reactivex.disposables.CompositeDisposable)

Example 60 with CompositeDisposable

use of io.reactivex.disposables.CompositeDisposable in project android-mvp-architecture by MindorksOpenSource.

the class LoginPresenterTest method setUp.

@Before
public void setUp() throws Exception {
    CompositeDisposable compositeDisposable = new CompositeDisposable();
    mTestScheduler = new TestScheduler();
    TestSchedulerProvider testSchedulerProvider = new TestSchedulerProvider(mTestScheduler);
    mLoginPresenter = new LoginPresenter<>(mMockDataManager, testSchedulerProvider, compositeDisposable);
    mLoginPresenter.onAttach(mMockLoginMvpView);
}
Also used : TestSchedulerProvider(com.mindorks.framework.mvp.utils.rx.TestSchedulerProvider) TestScheduler(io.reactivex.schedulers.TestScheduler) CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Before(org.junit.Before)

Aggregations

CompositeDisposable (io.reactivex.disposables.CompositeDisposable)78 Nullable (android.support.annotation.Nullable)15 Test (org.junit.Test)11 Bundle (android.os.Bundle)10 View (android.view.View)10 Consumer (io.reactivex.functions.Consumer)10 TimeUnit (java.util.concurrent.TimeUnit)10 Flowable (io.reactivex.Flowable)9 NonNull (android.support.annotation.NonNull)8 TextUtils (android.text.TextUtils)7 ViewGroup (android.view.ViewGroup)7 AndroidSchedulers (io.reactivex.android.schedulers.AndroidSchedulers)7 TextView (android.widget.TextView)6 BindView (butterknife.BindView)6 ArrayList (java.util.ArrayList)6 List (java.util.List)6 Intent (android.content.Intent)5 LayoutInflater (android.view.LayoutInflater)5 Task (bolts.Task)5 TaskCompletionSource (bolts.TaskCompletionSource)5