cancel
Showing results for 
Search instead for 
Did you mean: 

Change Screen cover animation time

Epamuk
Associate III

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

4 REPLIES 4
Martin KJELDSEN
Chief III

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

Epamuk
Associate III

Thanks, Martin

How when we need two speeds or more ???

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