Calling "app ().GotoScreen ()" transition from handleTickEvent () and handleKeyEvent()
Hi,
Do I need to prevent calling multiple screen transitions from event handlers as illustrated in the following pseudo code ?
Or, once the "application ().gotoOtherScreen ()" is executed in either handleTickEvent () or handleKeyEvent (), there is no way any further handler is called.
I am not sure if there is a way to check for ongoing transition. I thought I saw an API for that somewhere but cannot find it now.
So I call imaginary function "application ().isScreenTransitionInProgress ()".
// ScreenOne.cpp
void ScreenOne
::handleTickEvent () // override final
{
if ( ( true == bGoToScreenTimeout ) && ( false == application ().isScreenTransitionInProgress () ) )
{
application ().gotoOtherScreen ();
}
}
//---------------------------------------------------------
void ScreenOne
::handleKeyEvent ( uint8_t key ) // override final
{
if ( false == application ().isScreenTransitionInProgress () )
{
application ().gotoOtherScreen ();
}
}
Thanks.
