use of com.bluelinelabs.conductor.RouterTransaction in project Conductor by bluelinelabs.
the class RouterPagerAdapter method isViewFromObject.
@Override
public boolean isViewFromObject(View view, Object object) {
Router router = (Router) object;
final List<RouterTransaction> backstack = router.getBackstack();
for (RouterTransaction transaction : backstack) {
if (transaction.controller().getView() == view) {
return true;
}
}
return false;
}
use of com.bluelinelabs.conductor.RouterTransaction in project Conductor by bluelinelabs.
the class RouterPagerAdapter method instantiateItem.
@Override
public Object instantiateItem(ViewGroup container, int position) {
final String name = makeRouterName(container.getId(), getItemId(position));
Router router = host.getChildRouter(container, name);
if (!router.hasRootController()) {
Bundle routerSavedState = savedPages.get(position);
if (routerSavedState != null) {
router.restoreInstanceState(routerSavedState);
savedPages.remove(position);
savedPageHistory.remove((Integer) position);
}
}
router.rebindIfNeeded();
configureRouter(router, position);
if (router != currentPrimaryRouter) {
for (RouterTransaction transaction : router.getBackstack()) {
transaction.controller().setOptionsMenuHidden(true);
}
}
visibleRouters.put(position, router);
return router;
}
Aggregations