cancel
Showing results for 
Search instead for 
Did you mean: 

How to achive screen transition with swipe gesture?

manto.1
Senior

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();

}

}

0693W00000JNPE5QAP.png 

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.

  

3 REPLIES 3
MM..1
Chief II

Create dummy button interactions for EAST or any other transitions

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?

You need next dummy interaction.