com.bluelinelabs.conductor.Router Java Examples

The following examples show how to use com.bluelinelabs.conductor.Router. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BrowserController.java    From klingar with Apache License 2.0 6 votes vote down vote up
private void observePlayback() {
  disposables.add(musicController.state()
      .compose(bindUntilEvent(DETACH))
      .compose(rx.flowableSchedulers())
      .subscribe(state -> {
        switch (state) {
          case PlaybackStateCompat.STATE_ERROR:
          case PlaybackStateCompat.STATE_NONE:
          case PlaybackStateCompat.STATE_STOPPED:
            for (Router router : getChildRouters()) {
              removeChildRouter(router);
            }
            break;
          default:
            Router miniplayerRouter = getChildRouter(miniplayerContainer);
            if (!miniplayerRouter.hasRootController()) {
              miniplayerRouter.setRoot(RouterTransaction.with(new MiniPlayerController(null)));
            }
        }
      }, Rx::onError));
}
 
Example #2
Source File: DetailController.java    From klingar with Apache License 2.0 6 votes vote down vote up
private void observePlayback() {
  disposables.add(musicController.state()
      .compose(bindUntilEvent(DETACH))
      .compose(rx.flowableSchedulers())
      .subscribe(state -> {
        switch (state) {
          case PlaybackStateCompat.STATE_ERROR:
          case PlaybackStateCompat.STATE_NONE:
          case PlaybackStateCompat.STATE_STOPPED:
            for (Router router : getChildRouters()) {
              removeChildRouter(router);
            }
            break;
          default:
            Router miniplayerRouter = getChildRouter(miniplayerContainer);
            if (!miniplayerRouter.hasRootController()) {
              miniplayerRouter.setRoot(RouterTransaction.with(new MiniPlayerController(null)));
            }
        }
      }, Rx::onError));
}
 
Example #3
Source File: ControllerStateChanger.java    From simple-stack with Apache License 2.0 4 votes vote down vote up
public ControllerStateChanger(Router router) {
    this.router = router;
}