use of com.bluelinelabs.conductor.support.util.FakePager in project Conductor by bluelinelabs.
the class StateSaveTests method createActivityController.
public void createActivityController(Bundle savedInstanceState) {
ActivityController<Activity> activityController = Robolectric.buildActivity(Activity.class).create().start().resume();
Router router = Conductor.attachRouter(activityController.get(), new FrameLayout(activityController.get()), savedInstanceState);
TestController controller = new TestController();
router.setRoot(RouterTransaction.with(controller));
pager = new FakePager(new FrameLayout(activityController.get()));
pager.setOffscreenPageLimit(1);
pagerAdapter = new RouterPagerAdapter(controller) {
@Override
public void configureRouter(@NonNull Router router, int position) {
if (!router.hasRootController()) {
router.setRoot(RouterTransaction.with(new TestController()));
}
}
@Override
public int getCount() {
return 20;
}
};
pager.setAdapter(pagerAdapter);
}
Aggregations