com.bluelinelabs.conductor.ControllerChangeHandler Java Examples

The following examples show how to use com.bluelinelabs.conductor.ControllerChangeHandler. 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: MainActivity.java    From service-tree with Apache License 2.0 6 votes vote down vote up
@Override
public void onChangeCompleted(@Nullable Controller to, @Nullable Controller from, boolean isPush, @NonNull ViewGroup container, @NonNull ControllerChangeHandler handler) {
    List<RouterTransaction> newState = router.getBackstack();
    Log.d("MainActivity",
            Arrays.toString(previousState.toArray()) + " :: " + Arrays.toString(newState.toArray()));
    for(RouterTransaction previousKey : previousState) {
        if(!newState.contains(previousKey)) {
            serviceTree.removeNodeAndChildren(serviceTree.getNode(previousKey));
            Log.d("MainActivity", "Destroying [" + previousKey + "]");
        }
    }
    for(RouterTransaction newKey : newState) {
        if(!serviceTree.hasNodeWithKey(newKey)) {
            ((BaseController) newKey.controller()).bindServices(serviceTree.createChildNode(serviceTree.getNode(
                    TAG), newKey));
            Log.d("MainActivity", "Bind service to [" + newKey + "]");
        }
    }
    previousState = router.getBackstack();
}
 
Example #2
Source File: ControllerRepoList.java    From AndroidStarterAlt with Apache License 2.0 5 votes vote down vote up
@DebugLog
@Override
public void onViewEvent(final int piActionID, final Repo poRepo, final int piPosition, final View poView) {
    if (piActionID == CellRepo.ROW_PRESSED) {
        final ControllerRepoDetail loVC = new ControllerRepoDetail(poRepo.getBaseId());
        final ControllerChangeHandler loChangeHandler = new CircularRevealChangeHandlerCompat(poView, mRecyclerView);
        final RouterTransaction loTransaction = RouterTransaction.with(loVC)
                .pushChangeHandler(loChangeHandler)
                .popChangeHandler(loChangeHandler);
        getRouter().pushController(loTransaction);
    }
}
 
Example #3
Source File: BaseController.java    From klingar with Apache License 2.0 5 votes vote down vote up
@Override
protected void onChangeEnded(@NonNull ControllerChangeHandler changeHandler,
                             @NonNull ControllerChangeType changeType) {
  super.onChangeEnded(changeHandler, changeType);
  hasExited = !changeType.isEnter;
  if (isDestroyed()) {
    AppWatcher.INSTANCE.getObjectWatcher().watch(this);
  }
}
 
Example #4
Source File: MainActivity.java    From service-tree with Apache License 2.0 2 votes vote down vote up
@Override
public void onChangeStarted(@Nullable Controller to, @Nullable Controller from, boolean isPush, @NonNull ViewGroup container, @NonNull ControllerChangeHandler handler) {

}