Skip to main content
Tuoman
Senior II
April 6, 2020
Solved

Custom container with mixins (MoveAnimator)

  • April 6, 2020
  • 4 replies
  • 1215 views

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!

This topic has been closed for replies.
Best answer by Tuoman

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.

4 replies

Martin KJELDSEN
Principal III
April 6, 2020

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

Tuoman
TuomanAuthor
Senior II
April 6, 2020

>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.