+void LayoutController::UpdateMeasureHierarchyForAnimation( LayoutData& layoutData )
+{
+ LayoutTransition& layoutTransition = layoutData.layoutTransition;
+ Actor transitionOwner = Actor::DownCast( layoutTransition.layoutItem.Get()->GetOwner() );
+ LayoutTransitionDataPtr layoutTransitionDataPtr = layoutTransition.layoutItem->GetTransitionData( layoutTransition.layoutTransitionType );
+
+ if( !layoutTransitionDataPtr->HasUpdateMeasuredSize() )
+ {
+ return;
+ }
+
+ layoutData.updateMeasuredSize = true;
+ layoutTransitionDataPtr->CollectLayoutDataElements( transitionOwner, layoutData );
+
+ UpdateMeasureHierarchyForAnimation( transitionOwner, layoutData );
+
+ for( auto layoutDataElement : layoutData.layoutDataArray )
+ {
+ if( !layoutDataElement.updateMeasuredSize )
+ {
+ continue;
+ }
+
+ Actor actor = Actor::DownCast( layoutDataElement.handle );
+ LayoutDataAnimator animator = layoutData.layoutAnimatorArray[ layoutDataElement.animatorIndex ];
+ float width = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION );
+ float height = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION );
+
+ if( layoutDataElement.AdjustMeasuredSize( width, height, animator.animatorType ) )
+ {
+ mActorSizeSpecs.push_back( ActorSizeSpec( actor ) );
+ actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, static_cast<int>( width ) );
+ actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, static_cast<int>( height ) );
+ }
+ }
+
+ layoutData.updateMeasuredSize = false;
+}
+
+void LayoutController::UpdateMeasureHierarchyForAnimation( Actor root, LayoutData& layoutData )
+{
+ Toolkit::Control control = Toolkit::Control::DownCast( root );
+ if( control )
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutController::UpdateMeasureHierarchyForAnimation control:%s\n", control.GetName().c_str() );
+ Internal::Control& controlImpl = GetImplementation( control );
+ Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl );
+ LayoutItemPtr layout = controlDataImpl.GetLayout();
+
+ if( layout )
+ {
+ auto layoutGroup = Toolkit::LayoutGroup::DownCast( layout.Get() );
+ if( layoutGroup )
+ {
+ unsigned int childCount = layoutGroup.GetChildCount();
+ for( unsigned int i=0; i<childCount; ++i )
+ {
+ auto childLayout = layoutGroup.GetChildAt( i );
+ if( childLayout )
+ {
+ auto childControl = Toolkit::Control::DownCast( childLayout.GetOwner() );
+ LayoutTransitionData::CollectChildrenLayoutDataElements( childControl, layoutData );
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // Depth first descent through actor children
+ for( unsigned int i = 0, count = root.GetChildCount(); i < count; ++i )
+ {
+ UpdateMeasureHierarchyForAnimation( root.GetChildAt( i ), layoutData );
+ }
+ }
+}
+
+void LayoutController::RestoreActorsSpecs()
+{
+ for( auto& actorSizeSpec : mActorSizeSpecs )
+ {
+ Actor actor = actorSizeSpec.actor;
+ actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, actorSizeSpec.widthSpec );
+ actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, actorSizeSpec.heightSpec );
+ }
+}
+