Skip to main content
PaulQ
Associate III
Sep 22, 2019 6:50 AM UTC
Question

ZoomAnimationImage End Callback

Hello, I am trying to zoom/pan back and forward continuosly a logo, using ZoomAnimationImage. I need to trigger a callback at the end of the animation in order to reverse/reload animation. I managed to create my callback but it never gets called.

Here are my WelcomeScreenView.hpp/cpp:

#include <touchgfx/containers/ZoomAnimationImage.hpp>
class WelcomeScreenView : public WelcomeScreenViewBase
....
protected:
	virtual void ZoomMoveLogo();
 
 /*
 * Interaction Handlers
 */
	void liveLogoAnimationEndedCallbackHandler(const touchgfx::ZoomAnimationImage& i);
	//void liveLogoAnimationEndedCallbackHandler(const touchgfx::GenericCallback<touchgfx::ZoomAnimationImage>& i);
 
 /*
 * Callback Handler Declarations
 */
 
 /*
 * Interaction Callback Declarations
 */
	Callback < WelcomeScreenView, const touchgfx::ZoomAnimationImage&> liveLogoAnimationEndedCallback; 
 
 /*
 * Member Declarations
 */
 touchgfx::ZoomAnimationImage liveLogo;

My WelcomeScreenView.cpp:

WelcomeScreenView::WelcomeScreenView():
	liveLogoAnimationEndedCallback(this, &WelcomeScreenView::liveLogoAnimationEndedCallbackHandler)
 
...
void WelcomeScreenView::setupScreen()
{
 WelcomeScreenViewBase::setupScreen();
 liveLogo.setPosition(0, 0, 480, 272);
 liveLogo.setVisible(true);	
 liveLogo.setBitmaps (Bitmap(BITMAP_LOGO100X55_ID), Bitmap(BITMAP_LOGO480272_ID));
 liveLogo.setAnimationDelay (100);
}
....
 
void WelcomeScreenView::liveLogoAnimationEndedCallbackHandler(const touchgfx::ZoomAnimationImage& i)	
{
// Never called
}
 
void WelcomeScreenView::ZoomMoveLogo()
{
	liveLogo.startZoomAndMoveAnimation (
		240 - 50, 244 - 28, 100, 56, 
		100);
	liveLogo.setAnimationEndedCallback (liveLogoAnimationEndedCallback);
}

Any idea/suggestion ? Thank you

Paolo

This topic has been closed for replies.

2 replies

PaulQ
PaulQAuthor
Associate III
Sep 23, 2019 7:27 AM UTC

Solved.

Martin KJELDSEN
Principal III
Sep 23, 2019 8:25 PM UTC

Hi Paul,

Glad you solved it. What was the issue? My first guess was that liveLogoAnimationEndedCallbackHandler is empty so optimized out by the compiler, but maybe you replaced any code you had with the // Never called comment.

/Martin