2020-04-06 02:12 AM
Hi,
How to create custom containter that has moveAnimator mixin included? Is it possible?
I want to create notification, which is operated using: notificationContainer.show()
The custom container would implement this show() method, which would call startMoveAnimation() to itself, among other stuff.
I can add moveAnimator mixin to container in this in view, but then I need to call the startMoveAnimation etc. routine in every view, instead of just calling show() and letting container deal with the implementation.
How would I create custom container class that has MoveAnimator mixin?
Designer generates it like this:
touchgfx::MoveAnimator< notificationContainer > notificationContainer1;
I cannot figure out how to create such class.
Thanks!
Solved! Go to Solution.
2020-04-08 05:59 AM
Figured out that I can create container (touchgfx default Container) inside the custom container, and then I can get the MoveAnimator on that container and use startMoveAnimation. Maybe bit of a hack, but works fine.
2020-04-06 03:34 AM
If you select the mixin for an instance of a custom container as you're adding it to your view - Then, in your show() function you'll start the animation., so you don't have to do it in every view.
/Martin
2020-04-06 06:06 AM
>If you select the mixin for an instance of a custom container as you're adding it to your view
I have checked the MoveAnimator in the Designer in this View.
>Then, in your show() function you'll start the animation
How can I do that?
startMoveAnimation() etc. is not defined within the container, only in the View. Container class hierarchy is: notificationContainer > notificationContainerBase > touchgfx::Container > Drawable.
None of these have MoveAnimator methods.
2020-04-08 05:59 AM
Figured out that I can create container (touchgfx default Container) inside the custom container, and then I can get the MoveAnimator on that container and use startMoveAnimation. Maybe bit of a hack, but works fine.
2020-04-08 07:10 AM
Ok, great! We sometimes do tricks like that, so don't worry. "Hijack" the root container to be able to do certain things. So don't be ashamed :)
/Martin