Skip to main content
manto.1
Associate III
January 26, 2022
Question

How to achive screen transition with swipe gesture?

  • January 26, 2022
  • 3 replies
  • 1805 views

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.

  

This topic has been closed for replies.

3 replies

MM..1
Super User
January 26, 2022

Create dummy button interactions for EAST or any other transitions

MAnto.2
Associate II
January 26, 2022

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?

MM..1
Super User
January 26, 2022

You need next dummy interaction.