+ horizontalLayout.SetAnimateLayout( true );
+
+ auto layoutTransitionData = LayoutTransitionData::New();
+ {
+ // Instant resize for parent
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
+ layoutTransitionData.AddPropertyAnimator( container, map );
+ }
+ {
+ // Instant position for parent
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
+ }
+ {
+ // Shrink the lost focus child
+ Property::Map map;
+ map[ "affectsSiblings" ] = false;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 80.0f, 80.0f, 0 );
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
+ }
+ {
+ // Grow the gained focus child
+ Property::Map map;
+ map[ "affectsSiblings" ] = false;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 120.0f, 120.0f, 0 );
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus gained child
+ }
+
+ horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
+
+ bool signalReceived(false);
+ LayoutTransitionFinishCheck finishCheck(signalReceived);
+ layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
+ manager.SetFocus( controls[1] );
+
+ application.SendNotification();
+ application.Render( 1u /*just very beginning of the animation*/ );
+
+ finishCheck.CheckSignalNotReceived();
+ // Animation just started
+ DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+ // Animation just finished
+ DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 80.0f, 80.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 120.0f, 120.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render( 10u /* wait a bit more for a signal */ );
+
+ // Now sizes and positions are finally set
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ finishCheck.CheckSignalReceived();
+
+ END_TEST;
+}
+
+int UtcDaliLayouting_FocusChildLayoutTransition02(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliLayouting_FocusChildLayoutTransition02" );
+
+ Stage stage = Stage::GetCurrent();
+ auto container = Control::New();
+ auto horizontalLayout = LinearLayout::New();
+ horizontalLayout.SetAnimateLayout( false );
+ horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
+
+ DevelControl::SetLayout( container, horizontalLayout );
+ container.SetName( "Container" );
+
+ std::vector< Control > controls;
+ controls.push_back( CreateLeafControl( 100, 100 ) );
+ controls.push_back( CreateLeafControl( 100, 100 ) );
+
+ stage.Add( container );
+ container.Add( controls[0] );
+ container.Add( controls[1] );
+
+ KeyInputFocusManager manager = KeyInputFocusManager::Get();
+ manager.SetFocus( controls[0] );
+
+ // Initial rendering done
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ horizontalLayout.SetAnimateLayout( true );
+
+ auto layoutTransitionData = LayoutTransitionData::New();
+ {
+ // Shrink the lost focus child width
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = false;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // move all children
+ }
+ {
+ // Shrink the lost focus child width
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_WIDTH;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 80.0f;
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
+ }
+ {
+ // Shrink the lost focus child height
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_HEIGHT;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 80.0f;
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
+ }
+ {
+ // Grow the gained focus child
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 120.0f, 120.0f, 0 );
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus gained child
+ }
+
+ horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
+
+ bool signalReceived(false);
+ LayoutTransitionFinishCheck finishCheck(signalReceived);
+ layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
+ manager.SetFocus( controls[1] );
+
+ application.SendNotification();
+ application.Render( 1u /*just very beginning of the animation*/ );
+
+ finishCheck.CheckSignalNotReceived();
+ // Animation just started
+ DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+ // Animation just finished
+ DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 360.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 80.0f, 340.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 80.0f, 80.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 120.0f, 120.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render( 10u /* wait a bit more for a signal */ );
+
+ // Now sizes and positions are finally set
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 360.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f, 340.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ finishCheck.CheckSignalReceived();
+
+ END_TEST;
+}
+
+int UtcDaliLayouting_FocusChildLayoutTransition03(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliLayouting_FocusChildLayoutTransition03" );
+
+ Stage stage = Stage::GetCurrent();
+ auto container = Control::New();
+ auto horizontalLayout = LinearLayout::New();
+ horizontalLayout.SetAnimateLayout( false );
+ horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
+
+ DevelControl::SetLayout( container, horizontalLayout );
+ container.SetName( "Container" );
+
+ std::vector< Control > controls;
+ controls.push_back( CreateLeafControl( 100, 100 ) );
+ controls.push_back( CreateLeafControl( 100, 100 ) );
+
+ stage.Add( container );
+ container.Add( controls[0] );
+ container.Add( controls[1] );
+
+ KeyInputFocusManager manager = KeyInputFocusManager::Get();
+ manager.SetFocus( controls[0] );
+
+ // Initial rendering done
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ horizontalLayout.SetAnimateLayout( true );
+
+ auto layoutTransitionData = LayoutTransitionData::New();
+ {
+ // Shrink the lost focus child width
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = false;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // move all children
+ }
+ {
+ // Shrink the lost focus child width
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE_X;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.8f;
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
+ }
+ {
+ // Shrink the lost focus child height
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE_Y;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.8f;
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
+ }
+ {
+ // Grow the gained focus child
+ Property::Map map;
+ map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
+ map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
+ map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
+ map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 1.2f, 1.2f, 1.0f );
+ map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
+ map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
+ .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
+ .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
+ .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
+ layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus gained child
+ }
+
+ horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
+
+ bool signalReceived(false);
+ LayoutTransitionFinishCheck finishCheck(signalReceived);
+ layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
+ manager.SetFocus( controls[1] );
+
+ application.SendNotification();
+ application.Render( 1u /*just very beginning of the animation*/ );
+
+ finishCheck.CheckSignalNotReceived();
+ // Animation just started
+ DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+ // Animation just finished
+ DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( -10.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 90.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetCurrentSize() * controls[0].GetCurrentScale(), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetCurrentSize() * controls[1].GetCurrentScale(), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render( 10u /* wait a bit more for a signal */ );
+
+ // Now sizes and positions are finally set
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( -10.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 90.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ) * controls[0].GetProperty<Vector3>( Actor::Property::SCALE ), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ) * controls[1].GetProperty<Vector3>( Actor::Property::SCALE ), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+