Пример #1
0
  @Override
  public String loadURL(URL url, String basePath, boolean animated) {

    basePath = URL.stringAddPathComponent(basePath, getAlias());

    String alias = url.firstPathComponent(basePath);

    if (alias != null) {

      IViewController<T> topController = getCenterViewController();

      if (topController == null || !alias.equals(topController.getAlias())) {

        if (topController != null) {
          if (topController.isViewAppeared()) {
            topController.viewRemoveForSuperView(animated);
          }
          topController.setParentController(null);
        }

        topController = getViewControllerContext().getViewController(url, basePath);

        if (topController != null) {

          topController.setParentController(this);

          View v = topController.getView();

          if (_topControllerDirection == TopControllerDirectionLeft) {
            v.setX(v.getWidth() - FoldWidth);
          } else if (_topControllerDirection == TopControllerDirectionRight) {
            v.setX(FoldWidth - v.getWidth());
          } else {
            v.setX(0);
          }

          if (isViewAppeared()) {
            topController.viewAppearToSuperView(getContentView(), animated);
          }

          setCenterViewController(topController);
        }
      }

      if (topController != null) {
        basePath = topController.loadURL(url, basePath, animated);
      }
    }

    return basePath;
  }