MCPcopy Create free account
hub / github.com/9miao/CrossApp / pushViewController

Method pushViewController

CrossApp/controller/CAViewController.cpp:598–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598void 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
637void CANavigationController::pushViewControllerFinish()
638{

Calls 10

createWithContainerMethod · 0.95
DHorizontalLayout_L_RFunction · 0.85
DPointClass · 0.85
getSuperviewMethod · 0.80
getViewMethod · 0.80
getTouchDispatcherMethod · 0.80
setFrameOriginMethod · 0.80
backMethod · 0.45

Tested by

no test coverage detected