[Tizen] Restore behavior of Uploaded and LoadingFinished signal
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / image-view / image-view-impl.cpp
index edff0e3..0e02114 100755 (executable)
@@ -234,6 +234,22 @@ void ImageView::SetDepthIndex( int depthIndex )
   }
 }
 
+void ImageView::OnStageConnection( int depth )
+{
+  if( mImage )
+  {
+    mImage.UploadedSignal().Emit( mImage );
+  }
+
+  Dali::ResourceImage resourceImage = Dali::ResourceImage::DownCast( mImage );
+  if( resourceImage )
+  {
+    resourceImage.LoadingFinishedSignal().Emit( resourceImage );
+  }
+
+  Control::OnStageConnection( depth ); // Enabled visuals will be put on stage
+}
+
 Vector3 ImageView::GetNaturalSize()
 {
   if( mVisual )
@@ -349,6 +365,14 @@ void ImageView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
 
     mVisual.SetTransformAndSize( transformMap, size );
+
+    // mVisual is not updated util the resource is ready in the case of visual replacement.
+    // So apply the transform and size to the new visual.
+    Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+    if( visual && visual != mVisual )
+    {
+      visual.SetTransformAndSize( transformMap, size );
+    }
   }
 }