Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-demo.git] / examples / transition / cube-transition-effect-example.cpp
index abcb394..f38d36e 100644 (file)
@@ -120,7 +120,7 @@ private:
    * Start the transition
    * @param[in] image The image content of the imageActor for transition
    */
-  void OnImageLoaded(Image image);
+  void OnImageLoaded(ResourceImage image);
   /**
    * Main key event handler
    */
@@ -208,17 +208,17 @@ void CubeTransitionApp::OnInit( Application& application )
   mContent = DemoHelper::CreateView( application, mView, mToolBar, "", TOOLBAR_IMAGE, "" );
 
   // Add an effect-changing button on the right of the tool bar.
-  mImageWave = Image::New( EFFECT_WAVE_IMAGE );
-  mImageCross = Image::New( EFFECT_CROSS_IMAGE );
-  mImageFold = Image::New( EFFECT_FOLD_IMAGE );
+  mImageWave = ResourceImage::New( EFFECT_WAVE_IMAGE );
+  mImageCross = ResourceImage::New( EFFECT_CROSS_IMAGE );
+  mImageFold = ResourceImage::New( EFFECT_FOLD_IMAGE );
   mEffectChangeButton = Toolkit::PushButton::New();
   mEffectChangeButton.SetBackgroundImage(mImageWave);
   mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked );
   mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
 
   //Add an slideshow icon on the right of the title
-  mIconSlideshowStart = Image::New( SLIDE_SHOW_START_ICON );
-  mIconSlideshowStop = Image::New( SLIDE_SHOW_STOP_ICON );
+  mIconSlideshowStart = ResourceImage::New( SLIDE_SHOW_START_ICON );
+  mIconSlideshowStop = ResourceImage::New( SLIDE_SHOW_STOP_ICON );
   mSlideshowButton = Toolkit::PushButton::New();
   mSlideshowButton.SetBackgroundImage( mIconSlideshowStart );
   mSlideshowButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnSildeshowButtonClicked );
@@ -261,7 +261,7 @@ void CubeTransitionApp::OnInit( Application& application )
   // show the first image
   mImageConstraint = Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() );
 
-  mCurrentImage = ImageActor::New( Image::New( IMAGES[mIndex] ) );
+  mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) );
   mCurrentImage.SetPositionInheritanceMode( USE_PARENT_POSITION );
   mCurrentImage.ApplyConstraint( mImageConstraint );
   mParent.Add( mCurrentImage );
@@ -298,23 +298,24 @@ void CubeTransitionApp::OnPanGesture( Actor actor, const PanGesture& gesture )
 
 void CubeTransitionApp::GoToNextImage()
 {
-  Image image = Image::New( IMAGES[ mIndex ] );
+  ResourceImage image = ResourceImage::New( IMAGES[ mIndex ] );
   mNextImage = ImageActor::New( image );
   mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION);
   mNextImage.ApplyConstraint( mImageConstraint );
   mCurrentEffect.SetTargetImage(mNextImage);
-  mIsImageLoading = true;
   if( image.GetLoadingState() == ResourceLoadingSucceeded )
   {
-      OnImageLoaded( image );
+    mIsImageLoading = false;
+    OnImageLoaded( image );
   }
   else
   {
+    mIsImageLoading = true;
     image.LoadingFinishedSignal().Connect( this, &CubeTransitionApp::OnImageLoaded );
   }
 }
 
-void CubeTransitionApp::OnImageLoaded(Image image)
+void CubeTransitionApp::OnImageLoaded(ResourceImage image)
 {
    mIsImageLoading = false;
    mCurrentEffect.StartTransition( mPanPosition, mPanDisplacement );