本文整理匯總了Java中rx.android.plugins.RxAndroidPlugins類的典型用法代碼示例。如果您正苦於以下問題:Java RxAndroidPlugins類的具體用法?Java RxAndroidPlugins怎麽用?Java RxAndroidPlugins使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RxAndroidPlugins類屬於rx.android.plugins包,在下文中一共展示了RxAndroidPlugins類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUp
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
presenter = new SignInPresenter();
presenter.setViewState(signInViewState);
RxJavaPlugins.getInstance().reset();
RxJavaPlugins.getInstance().registerSchedulersHook(new RxJavaSchedulersHook() {
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
});
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
}
示例2: setUp
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
presenter = new RepositoriesPresenter();
presenter.setViewState(repositoriesViewState);
RxJavaPlugins.getInstance().reset();
RxJavaPlugins.getInstance().registerSchedulersHook(new RxJavaSchedulersHook() {
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
});
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
}
示例3: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(mRxJavaImmediateScheduler);
RxJavaHooks.setOnNewThreadScheduler(mRxJavaImmediateScheduler);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
RxJavaHooks.reset();
}
};
}
示例4: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
RxJavaPlugins.getInstance().reset();
RxJavaPlugins.getInstance().registerSchedulersHook(mRxJavaSchedulersHook);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
RxJavaPlugins.getInstance().reset();
}
};
}
示例5: starting
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
protected void starting(Description description) {
RxJavaPlugins.getInstance().reset();
RxJavaPlugins.getInstance().registerSchedulersHook(new RxJavaSchedulersHook() {
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
});
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
}
示例6: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(rxAndroidSchedulersHook);
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(rxJavaSchedulerHook);
RxJavaHooks.setOnNewThreadScheduler(rxJavaSchedulerHook);
RxJavaHooks.setOnComputationScheduler(rxJavaSchedulerHook);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
RxJavaHooks.reset();
}
};
}
示例7: setupTestSchedulers
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
public static void setupTestSchedulers() {
try {
RxJavaPlugins.getInstance().registerSchedulersHook(new RxJavaSchedulersHook() {
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
@Override
public Scheduler getNewThreadScheduler() {
return Schedulers.immediate();
}
});
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
});
} catch (IllegalStateException ignored) {
}
}
示例8: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
callResetViaReflectionIn(RxJavaPlugins.getInstance());
RxJavaPlugins.getInstance().registerSchedulersHook(mRxJavaSchedulersHook);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
callResetViaReflectionIn(RxJavaPlugins.getInstance());
}
};
}
示例9: registerImmediateHookIO
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
public static void registerImmediateHookIO() {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return rx.schedulers.Schedulers.immediate();
}
});
Schedulers.registerHook(new Schedulers.Hook() {
@Override
public Scheduler io() {
return rx.schedulers.Schedulers.immediate();
}
@Override
public Scheduler computation() {
return rx.schedulers.Schedulers.trampoline();
}
@Override
public Scheduler immediate() {
return rx.schedulers.Schedulers.immediate();
}
});
}
示例10: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaHooks.reset();
RxJavaHooks.setOnIOScheduler(mMockSchedulerFunc);
RxJavaHooks.setOnNewThreadScheduler(mMockSchedulerFunc);
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
base.evaluate();
RxJavaHooks.reset();
RxAndroidPlugins.getInstance().reset();
}
};
}
示例11: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
RxJavaPlugins.getInstance().reset();
RxJavaPlugins.getInstance().registerSchedulersHook(mRxJavaSchedulersHook);
base.evaluate();
RxAndroidPlugins.getInstance().reset();
RxJavaPlugins.getInstance().reset();
}
};
}
示例12: openRxTools
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
/**
* 把異步變成同步,方便測試
*/
public static void openRxTools() {
if (isInitRxTools) {
return;
}
isInitRxTools = true;
RxAndroidSchedulersHook rxAndroidSchedulersHook = new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
};
RxJavaSchedulersHook rxJavaSchedulersHook = new RxJavaSchedulersHook() {
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
};
RxAndroidPlugins.getInstance().registerSchedulersHook(rxAndroidSchedulersHook);
RxJavaPlugins.getInstance().registerSchedulersHook(rxJavaSchedulersHook);
}
示例13: apply
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
RxJavaHooks.reset();
RxAndroidPlugins.getInstance().reset();
RxJavaHooks.setOnIOScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnNewThreadScheduler(scheduler -> Schedulers.immediate());
RxJavaHooks.setOnComputationScheduler(scheduler -> Schedulers.immediate());
RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook);
base.evaluate();
RxJavaHooks.reset();
RxAndroidPlugins.getInstance().reset();
}
};
}
示例14: openRxTools
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
/**
* 把異步變成同步,方便測試
*/
public static void openRxTools() {
if (isInitRxTools) {
return;
}
isInitRxTools = true;
RxAndroidSchedulersHook rxAndroidSchedulersHook = new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
};
RxJavaSchedulersHook rxJavaSchedulersHook = new RxJavaSchedulersHook() {
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
};
RxAndroidPlugins.getInstance().registerSchedulersHook(rxAndroidSchedulersHook);
RxJavaPlugins.getInstance().registerSchedulersHook(rxJavaSchedulersHook);
}
示例15: schedule
import rx.android.plugins.RxAndroidPlugins; //導入依賴的package包/類
@Override
public Subscription schedule(Action0 action, long delayTime, TimeUnit unit) {
if (compositeSubscription.isUnsubscribed()) {
return Subscriptions.unsubscribed();
}
action = RxAndroidPlugins.getInstance().getSchedulersHook().onSchedule(action);
final ScheduledAction scheduledAction = new ScheduledAction(action);
scheduledAction.addParent(compositeSubscription);
compositeSubscription.add(scheduledAction);
handler.postDelayed(scheduledAction, unit.toMillis(delayTime));
scheduledAction.add(Subscriptions.create(new Action0() {
@Override
public void call() {
handler.removeCallbacks(scheduledAction);
}
}));
return scheduledAction;
}