Skip to main content
Epamuk
Associate III
April 8, 2020
Solved

Change Screen cover animation time

  • April 8, 2020
  • 2 replies
  • 1261 views

hello,

In my program I have some screens and I switch between screens by programaticily. If a button pressed below code switches screen

void Screen1_View::changeScreenToScreen2(){
 static_cast<FrontendApplication*>(Application::getInstance())->gotoScreen_Screen2CoverTransitionSouth();
}

This code works fine but I want to change cover time too. Is it possible to change screen transition time ? Is it fixed ?

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi,

Usually, transitions are the same duration for every screen in the application. So the only way to change the animation time is in touchgfx/Transitions/CoverTransition.hpp (Or touchgfx/Transitions/ScreenTrantision.hpp). Increase steps to increase duration, etc.

 CoverTransition(const uint8_t transitionSteps = 20)
 : Transition(),
 handleTickCallback(this, &CoverTransition::tickMoveDrawable),
 direction(templateDirection),
 animationSteps(transitionSteps),
...

/Martin

2 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
April 8, 2020

Hi,

Usually, transitions are the same duration for every screen in the application. So the only way to change the animation time is in touchgfx/Transitions/CoverTransition.hpp (Or touchgfx/Transitions/ScreenTrantision.hpp). Increase steps to increase duration, etc.

 CoverTransition(const uint8_t transitionSteps = 20)
 : Transition(),
 handleTickCallback(this, &CoverTransition::tickMoveDrawable),
 direction(templateDirection),
 animationSteps(transitionSteps),
...

/Martin

MM..1
Chief III
July 12, 2021

How when we need two speeds or more ???

Romain DIELEMAN
ST Employee
July 13, 2021

I guess you need different speed for the same transition based on different scenarios ? I think you should create your own custom transition through code, by copying the code and changing it according to what you need.

Otherwise the "easiest" but annoying solution may be to just mimic the cover transition by faking a screen transition and sliding the widgets/elements of your new screen over what you have.

/Romain

Epamuk
EpamukAuthor
Associate III
April 8, 2020

Thanks, Martin