Skip to main content
June 7, 2019
Question

How to make a screen transition?

  • June 7, 2019
  • 1 reply
  • 953 views

Hi,

I want to make a screen transition by hardware button,

i tried to make a screen transition by TouchGFX Designer Interactions and that works fine.

But i have no idea how to make the same transition, using hardware button.

I found an example like this:

in FrontendApplication.cpp

void FrontendApplication::gotoScreen1Custom()
{
 customTransitionCallback = touchgfx::Callback< FrontendApplication >(this, &FrontendApplication::gotoScreen1CustomImpl);
 pendingScreenTransitionCallback = &customTransitionCallback;
}
 
void FrontendApplication::gotoScreen1CustomImpl()
{
 makeTransition<Screen1View, Screen1Presenter, touchgfx::SlideTransition<EAST>, Model >(&currentScreen, &currentPresenter, frontendHeap, &currentTransition, &model);
}

and in Screen2View.cpp need to call

application().gotoScreen1Custom();

Update1:

The problem is that i can not call

application().gotoScreen1Custom();

in my function,

BUT, if i call it in virtual function

void MainScreenView::handleTickEvent(){}

it works.

I guess the problem is in my knowledge of C++ classes,

could you help me to run the function from my own function

Thank you

Anton

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
June 11, 2019

Hi,

If you're trying to transition from e.g. a presenter/view, try executing the following instead:

static_cast<FrontendApplication*>(Application::getInstance())->gotoMyScreen();

/Martin