2022-01-26 06:12 AM
I know it is possible to do a screen change with a button. But i would like to do it with swiping gesture. I defined transionits in FrontedApplication .cpp and .hpp files. The probelm is application crashes when transition is acalled:
void MainScreenView::handleDragEvent(const DragEvent& evt)
{
int i = evt.getDeltaX();
touchgfx_printf("Dragged %i\n",i);
if(i < -20)
{
application().userGotoBatteryScreenScreenTransitionEast();
}
}
I found out that all transition types used in the application MUST be added to list in
FrontendHeapBase.hpp
typedef touchgfx::meta::TypeList< touchgfx::NoTransition,
touchgfx::meta::TypeList< SlideTransition<NORTH>,
touchgfx::meta::Nil >
The problem is FrontendHeapBase.hpp file is auto generated and should not be modified.
This line should be added to the list
: touchgfx::meta::TypeList< SlideTransition<East>
But this can be done only if I create a button and add an interaciton that changes screen. But I want to change the screen with swiping gesture.
2022-01-26 06:40 AM
Create dummy button interactions for EAST or any other transitions
2022-01-26 10:28 AM
I created dummy button that has an interaction to change screen with EAST transition. Then I used application().gotoSreen1 function in the handleDragEvent. And it worked ok. The problem occurs when I do the same on the Screen2 and want to make transition to the Screen1 to the west. Then when I drag this to events somehow come to colision. How to solve this?
2022-01-26 10:34 AM
You need next dummy interaction.