Toolkit::ToolBar mToolBar;
Layer mContent;
Toolkit::TextView mTitleActor;
+ Actor mParent;
ImageActor mCurrentImage;
ImageActor mNextImage;
mCurrentImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision);
mNextImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision);
-
mViewTimer = Timer::New( VIEWINGTIME );
mViewTimer.TickSignal().Connect( this, &DissolveEffectApp::OnTimerTick );
mTimerReady = true;
+ // Set size to stage size to avoid seeing a black border on transition
+ mParent = Actor::New();
+ mParent.SetSize( Stage::GetCurrent().GetSize() );
+ mParent.SetPositionInheritanceMode( USE_PARENT_POSITION );
+ mContent.Add( mParent );
+
mSizeConstraint= Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() );
// show the first image
mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) );
mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mCurrentImage.ApplyConstraint( mSizeConstraint );
- mContent.Add(mCurrentImage);
+ mParent.Add( mCurrentImage );
+
mPanGestureDetector.Attach( mCurrentImage );
}
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mNextImage.ApplyConstraint( mSizeConstraint );
mNextImage.SetZ(INITIAL_DEPTH);
- mContent.Add(mNextImage);
+ mParent.Add( mNextImage );
Vector2 size = Vector2( mCurrentImage.GetCurrentSize() );
StartTransition( gesture.position / size, gesture.displacement * Vector2(1.0, size.x/size.y));
}
if( mSlideshow )
{
mPlayStopButton.SetBackgroundImage( mIconStop );
- mPanGestureDetector.Detach( mContent );
+ mPanGestureDetector.Detach( mParent );
mViewTimer.Start();
mTimerReady = false;
}
{
mPlayStopButton.SetBackgroundImage( mIconPlay );
mTimerReady = true;
- mPanGestureDetector.Attach( mContent );
+ mPanGestureDetector.Attach( mParent );
}
return true;
}
{
mCurrentImage.RemoveShaderEffect();
mNextImage.RemoveShaderEffect();
- mContent.Remove(mCurrentImage);
+ mParent.Remove( mCurrentImage );
mPanGestureDetector.Detach( mCurrentImage );
mCurrentImage = mNextImage;
mPanGestureDetector.Attach( mCurrentImage );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mNextImage.ApplyConstraint( mSizeConstraint );
mNextImage.SetZ(INITIAL_DEPTH);
- mContent.Add(mNextImage);
- switch(mCentralLineIndex%4)
+ mParent.Add( mNextImage );
+ switch( mCentralLineIndex%4 )
{
case 0:
{