506 views
in GUI Development by
Hi everyone,
at the moment I'm trying to implement a swipe animation to change between two full-screen dialogs. What is the best way to implement this? I coun't find a sample or description showing the change animation. As this fullscreen animation consumes a lot of memory efficiency is important in this case. By now I'm only able to detect a swipe gesture and run the dialog change animation afterwards. That's not what the user is used to. I do not necessarely require a view update of the both views during animation.

Any ideas?

1 Answer

0 votes
by
 
Best answer

Hello,

if you are using the Dialogs functionality, it permits you specify transitions (animations) to be performed whjen you show/hide (Present/Dismiss) a dialog. Have you seen the section Perform Dialog transitions with animations? The 'swipe' animation is called in this case Slide Transition. Please see Use default Dialog transition objects and Customize provided Dialog transition animations.

If you are not using the above mentioned Dialog functionality and your dialogs are common GUI components, you can perform animations by using the animation effect objects. Concrete the Move and resize rect effect is suitable to animate the position/size of a GUI component.

Does it help you?

Best regards

Paul Banach

by
Yes I'm using Dialogs functinality. I'm also running the annimations already.The problem is that they are only exceuted at the end of the gesture. There is no animation during the gesture itself. The present dialog is not following the finger like the look and feel you have on your smartphone.
by

Ok, it is more clear now. It is more like a scrollable list with contents. The above described approaches are not applicable in such case. Instead use the Outline view connected with a Slide Touch Handler. With Outline view you can group and scroll GUI components. I have prepared a small Embedded Wizard project demonstrating the idea. It is found in the following ZIP file:

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=13011538146259530122

My simple example limits to 3 dialogs, which are existing the whole time. In the practice you can improve the implementation to be more sophisticated. For example, if you have more than 3 dialogs you can maintain only 3 of them (the actually visible and its left/right neighbour). When the user touches and drags the dialogs, the Slide Touch Handler sends signals to slot methods connected to its OnStart/OnSlide/OnEnd properties. Within the properties you can dynamically create and remove the dialogs if needed. 

Best regards

Paul Banach

by
Thank you for providing me this sample so quickly. That's exaclty what I was looking for!

Embedded Wizard Website | Privacy Policy | Imprint

...