Search in sources :

Example 1 with HorizontalChangeHandler

use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.

the class RxLifecycle2Controller 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 disposed of, 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 2 with HorizontalChangeHandler

use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.

the class RxLifecycle2Controller method onNextWithRetainClicked.

@OnClick(R.id.btn_next_retain_view)
void onNextWithRetainClicked() {
    setRetainViewMode(RetainViewMode.RETAIN_DETACH);
    getRouter().pushController(RouterTransaction.with(new TextController("Logcat should now report that the observables from onAttach() has been disposed of, while the constructor and onViewBound() observables are still running.")).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
}
Also used : HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) OnClick(butterknife.OnClick)

Example 3 with HorizontalChangeHandler

use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.

the class RxLifecycleController method onNextWithRetainClicked.

@OnClick(R.id.btn_next_retain_view)
void onNextWithRetainClicked() {
    setRetainViewMode(RetainViewMode.RETAIN_DETACH);
    getRouter().pushController(RouterTransaction.with(new TextController("Logcat should now report that the observables from onAttach() has been unsubscribed from, while the constructor and onViewBound() observables are still running.")).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
}
Also used : HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) OnClick(butterknife.OnClick)

Example 4 with HorizontalChangeHandler

use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.

the class ControllerChangeHandlerTests method testSaveRestore.

@Test
public void testSaveRestore() {
    HorizontalChangeHandler horizontalChangeHandler = new HorizontalChangeHandler();
    FadeChangeHandler fadeChangeHandler = new FadeChangeHandler(120, false);
    RouterTransaction transaction = RouterTransaction.with(new TestController()).pushChangeHandler(horizontalChangeHandler).popChangeHandler(fadeChangeHandler);
    RouterTransaction restoredTransaction = new RouterTransaction(transaction.saveInstanceState());
    ControllerChangeHandler restoredHorizontal = restoredTransaction.pushChangeHandler();
    ControllerChangeHandler restoredFade = restoredTransaction.popChangeHandler();
    assertEquals(horizontalChangeHandler.getClass(), restoredHorizontal.getClass());
    assertEquals(fadeChangeHandler.getClass(), restoredFade.getClass());
    HorizontalChangeHandler restoredHorizontalCast = (HorizontalChangeHandler) restoredHorizontal;
    FadeChangeHandler restoredFadeCast = (FadeChangeHandler) restoredFade;
    assertEquals(horizontalChangeHandler.getAnimationDuration(), restoredHorizontalCast.getAnimationDuration());
    assertEquals(horizontalChangeHandler.removesFromViewOnPush(), restoredHorizontalCast.removesFromViewOnPush());
    assertEquals(fadeChangeHandler.getAnimationDuration(), restoredFadeCast.getAnimationDuration());
    assertEquals(fadeChangeHandler.removesFromViewOnPush(), restoredFadeCast.removesFromViewOnPush());
}
Also used : FadeChangeHandler(com.bluelinelabs.conductor.changehandler.FadeChangeHandler) TestController(com.bluelinelabs.conductor.util.TestController) HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) Test(org.junit.Test)

Example 5 with HorizontalChangeHandler

use of com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler in project Conductor by bluelinelabs.

the class MasterDetailListController method onRowSelected.

void onRowSelected(int index) {
    selectedIndex = index;
    DetailItemModel model = DetailItemModel.values()[index];
    ChildController controller = new ChildController(model.detail, model.backgroundColor, true);
    if (twoPaneView) {
        getChildRouter(detailContainer).setRoot(RouterTransaction.with(controller));
    } else {
        getRouter().pushController(RouterTransaction.with(controller).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
    }
}
Also used : HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler)

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