[dali_1.0.36] Merge branch 'tizen'
[platform/core/uifw/dali-demo.git] / examples / dissolve-effect / dissolve-effect-example.cpp
index ac4e699..8d0f90f 100644 (file)
@@ -163,7 +163,6 @@ private:
   ImageActor                      mCurrentImage;
   ImageActor                      mNextImage;
   unsigned int                    mIndex;
-  Constraint                      mSizeConstraint;
 
   Toolkit::DissolveEffect         mCurrentImageEffect;
   Toolkit::DissolveEffect         mNextImageEffect;
@@ -251,12 +250,12 @@ void DissolveEffectApp::OnInit( Application& application )
   mParent.SetPositionInheritanceMode( USE_PARENT_POSITION );
   mContent.Add( mParent );
 
-  mSizeConstraint= Constraint::New<Vector3>( Actor::Property::SCALE, LocalSource( Actor::Property::SIZE ), ParentSource( Actor::Property::SIZE ), ScaleToFitKeepAspectRatioConstraint() );
-
   // show the first image
   mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
+  mCurrentImage.SetRelayoutEnabled( false );
   mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
-  mCurrentImage.ApplyConstraint( mSizeConstraint );
+  mCurrentImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mCurrentImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
   mParent.Add( mCurrentImage );
 
   mPanGestureDetector.Attach( mCurrentImage );
@@ -284,8 +283,10 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture )
 
     Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
     mNextImage = ImageActor::New( image );
+    mNextImage.SetRelayoutEnabled( false );
     mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
-    mNextImage.ApplyConstraint( mSizeConstraint );
+    mNextImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+    mNextImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
     mNextImage.SetZ(INITIAL_DEPTH);
     mParent.Add( mNextImage );
     Vector2 size = Vector2( mCurrentImage.GetCurrentSize() );
@@ -303,7 +304,7 @@ void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement)
   mAnimation.AnimateTo( Property(mCurrentImageEffect, mCurrentImageEffect.GetDistortionPropertyName()), 1.0f, AlphaFunctions::Linear );
 
   mNextImage.SetOpacity(0.0f);
-  mAnimation.OpacityTo( mNextImage, 1.0, AlphaFunctions::Linear );
+  mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::Linear );
 
   if(mUseHighPrecision)
   {
@@ -314,7 +315,7 @@ void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement)
   }
   else
   {
-    mAnimation.MoveTo(mNextImage, Vector3(0.0f, 0.0f, 0.0f), AlphaFunctions::Linear);
+    mAnimation.AnimateTo( Property( mNextImage, Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), AlphaFunctions::Linear );
   }
 
   mAnimation.FinishedSignal().Connect( this, &DissolveEffectApp::OnTransitionCompleted );
@@ -397,7 +398,8 @@ bool DissolveEffectApp::OnTimerTick()
     Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
     mNextImage = ImageActor::New( image );
     mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
-    mNextImage.ApplyConstraint( mSizeConstraint );
+    mNextImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+    mNextImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
     mNextImage.SetZ(INITIAL_DEPTH);
     mParent.Add( mNextImage );
     switch( mCentralLineIndex%4 )