use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.
the class RxLifecycleController method onNextWithReleaseClicked.
@OnClick(R.id.btn_next_release_view)
void onNextWithReleaseClicked() {
setRetainViewMode(RetainViewMode.RELEASE_DETACH);
getRouter().pushController(RouterTransaction.with(new TextController("Logcat should now report that the observables from onAttach() and onViewBound() have been unsubscribed from, while the constructor observable is still running.")).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
}
use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.
the class RouterTests method testPopToRootWithNoRemoveViewOnPush.
@Test
public void testPopToRootWithNoRemoveViewOnPush() {
RouterTransaction rootTransaction = RouterTransaction.with(new TestController()).pushChangeHandler(new HorizontalChangeHandler(false));
RouterTransaction transaction1 = RouterTransaction.with(new TestController()).pushChangeHandler(new HorizontalChangeHandler(false));
RouterTransaction transaction2 = RouterTransaction.with(new TestController()).pushChangeHandler(new HorizontalChangeHandler(false));
List<RouterTransaction> backstack = Arrays.asList(rootTransaction, transaction1, transaction2);
router.setBackstack(backstack, null);
assertEquals(3, router.getBackstackSize());
router.popToRoot();
assertEquals(1, router.getBackstackSize());
assertEquals(rootTransaction, router.getBackstack().get(0));
assertTrue(rootTransaction.controller.isAttached());
assertFalse(transaction1.controller.isAttached());
assertFalse(transaction2.controller.isAttached());
}
use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.
the class ControllerTransactionTests method testRouterSaveRestore.
@Test
public void testRouterSaveRestore() {
RouterTransaction transaction = RouterTransaction.with(new TestController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new VerticalChangeHandler()).tag("Test Tag");
Bundle bundle = transaction.saveInstanceState();
RouterTransaction restoredTransaction = new RouterTransaction(bundle);
assertEquals(transaction.controller.getClass(), restoredTransaction.controller.getClass());
assertEquals(transaction.pushChangeHandler().getClass(), restoredTransaction.pushChangeHandler().getClass());
assertEquals(transaction.popChangeHandler().getClass(), restoredTransaction.popChangeHandler().getClass());
assertEquals(transaction.tag(), restoredTransaction.tag());
}
Aggregations