Search in sources :

Example 6 with HorizontalChangeHandler

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()));
}
Also used : HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) OnClick(butterknife.OnClick)

Example 7 with 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());
}
Also used : TestController(com.bluelinelabs.conductor.util.TestController) HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) Test(org.junit.Test)

Example 8 with HorizontalChangeHandler

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());
}
Also used : Bundle(android.os.Bundle) TestController(com.bluelinelabs.conductor.util.TestController) VerticalChangeHandler(com.bluelinelabs.conductor.changehandler.VerticalChangeHandler) HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) Test(org.junit.Test)

Aggregations

HorizontalChangeHandler (com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler)8 OnClick (butterknife.OnClick)4 TestController (com.bluelinelabs.conductor.util.TestController)3 Test (org.junit.Test)3 Bundle (android.os.Bundle)1 FadeChangeHandler (com.bluelinelabs.conductor.changehandler.FadeChangeHandler)1 VerticalChangeHandler (com.bluelinelabs.conductor.changehandler.VerticalChangeHandler)1