cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a screen transition?

qqAnton
Senior

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

1 REPLY 1
Martin KJELDSEN
Chief III

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