cancel
Showing results for 
Search instead for 
Did you mean: 

ZoomAnimationImage End Callback

PaulQ
Associate III

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

2 REPLIES 2
PaulQ
Associate III

Solved.

Martin KJELDSEN
Chief III

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