當前位置: 首頁>>代碼示例>>Java>>正文


Java RxAndroidPlugins類代碼示例

本文整理匯總了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();
		}
	});
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:SignInPresenterTest.java

示例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();
		}
	});
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:RepositoriesPresenterTest.java

示例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();
        }
    };
}
 
開發者ID:OHoussein,項目名稱:Android-Show-Reader,代碼行數:20,代碼來源:RxSchedulersOverrideRule.java

示例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();
        }
    };
}
 
開發者ID:hacktoberfest17,項目名稱:programming,代碼行數:19,代碼來源:RxSchedulersOverrideRule.java

示例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();
        }
    });
}
 
開發者ID:asadmshah,項目名稱:moviegur,代碼行數:19,代碼來源:RxRunOnImmediateThreadRule.java

示例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();
        }
    };
}
 
開發者ID:Plastix,項目名稱:RxSchedulerRule,代碼行數:21,代碼來源:RxSchedulerRule.java

示例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) {
    }
}
 
開發者ID:ArturVasilov,項目名稱:AndroidArchitecture,代碼行數:24,代碼來源:RxUtils.java

示例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());
        }
    };
}
 
開發者ID:w4mxl,項目名稱:read-expand,代碼行數:18,代碼來源:RxSchedulersOverrideRule.java

示例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();
        }
    });
}
 
開發者ID:st1hy,項目名稱:Red-Calorie,代碼行數:26,代碼來源:TestRxPlugins.java

示例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();
        }
    };
}
 
開發者ID:ArturVasilov,項目名稱:RxLoader,代碼行數:20,代碼來源:RxSchedulersTestRule.java

示例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();
        }
    };
}
 
開發者ID:hitherejoe,項目名稱:Mondroid,代碼行數:18,代碼來源:RxSchedulersOverrideRule.java

示例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);
}
 
開發者ID:konglinghai123,項目名稱:zhai,代碼行數:27,代碼來源:RxUnitTestTools.java

示例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();
        }
    };
}
 
開發者ID:AnironGlass,項目名稱:MVP-Boilerplate,代碼行數:21,代碼來源:RxSchedulersRule.java

示例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);
}
 
開發者ID:klisly,項目名稱:fingerpoetry-android,代碼行數:27,代碼來源:RxUnitTestTools.java

示例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;
}
 
開發者ID:cowthan,項目名稱:AyoSunny,代碼行數:24,代碼來源:HandlerScheduler.java


注:本文中的rx.android.plugins.RxAndroidPlugins類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。