| 596 | } |
| 597 | |
| 598 | void CANavigationController::pushViewController(CAViewController* viewController, bool animated) |
| 599 | { |
| 600 | if (this->getView()->getSuperview() == NULL) |
| 601 | { |
| 602 | return; |
| 603 | } |
| 604 | |
| 605 | float x = this->getView()->getBounds().size.width; |
| 606 | |
| 607 | CAView* lastContainer = m_pContainers.back(); |
| 608 | this->createWithContainer(viewController, DLayout(DHorizontalLayout_L_R(x, -x), DVerticalLayoutFill)); |
| 609 | CAView* newContainer = m_pContainers.back(); |
| 610 | |
| 611 | CAApplication::getApplication()->getTouchDispatcher()->setDispatchEventsFalse(); |
| 612 | |
| 613 | if (animated) |
| 614 | { |
| 615 | CAViewAnimation::beginAnimations("", NULL); |
| 616 | CAViewAnimation::setAnimationDuration(0.25f); |
| 617 | CAViewAnimation::setAnimationDelay(1/30.0f); |
| 618 | CAViewAnimation::setAnimationCurve(CAViewAnimationCurveEaseOut); |
| 619 | lastContainer->setFrameOrigin(DPoint(-x/3.0f, 0)); |
| 620 | CAViewAnimation::commitAnimations(); |
| 621 | |
| 622 | CAViewAnimation::beginAnimations("", NULL); |
| 623 | CAViewAnimation::setAnimationDuration(0.25f); |
| 624 | CAViewAnimation::setAnimationDelay(1/60.0f); |
| 625 | CAViewAnimation::setAnimationCurve(CAViewAnimationCurveEaseOut); |
| 626 | CAViewAnimation::setAnimationDidStopSelector(this, CAViewAnimation0_selector(CANavigationController::pushViewControllerFinish)); |
| 627 | newContainer->setFrameOrigin(DPointZero); |
| 628 | CAViewAnimation::commitAnimations(); |
| 629 | |
| 630 | } |
| 631 | else |
| 632 | { |
| 633 | this->pushViewControllerFinish(); |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | void CANavigationController::pushViewControllerFinish() |
| 638 | { |
no test coverage detected