/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_TEST_EQUALS( actor.GetProperty<int>(index), 20, TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliAnimationDuration(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ Animation animation = Animation::New( 0.0f );
+ DALI_TEST_EQUALS( 0.0f, animation.GetDuration(), TEST_LOCATION );
+
+ // The animation duration should automatically increase depending on the animator time period
+
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f, TimePeriod( 0.0f, 1.0f ) );
+ DALI_TEST_EQUALS( 1.0f, animation.GetDuration(), TEST_LOCATION );
+
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION_Y ), 200.0f, TimePeriod( 10.0f, 1.0f ) );
+ DALI_TEST_EQUALS( 11.0f, animation.GetDuration(), TEST_LOCATION );
+
+ END_TEST;
+}
#define __DALI_ANIMATION_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* If the "Finish" signal is connected to a member function of an object, it must be disconnected before the object is destroyed.
* This is typically done in the object destructor, and requires either the Dali::Connection object or Dali::Animation handle to be stored.
*
+ * The overall animation time is superseded by the values given in the TimePeriod structure used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and Animate() methods.
+ * If any of the individual calls to those functions exceeds the overall animation time, then the overall animation time is automatically extended.
+ *
* Signals
* | %Signal Name | Method |
* |--------------|--------------------------|
* @SINCE_1_0.0
* @param [in] durationSeconds The duration in seconds.
* @return A handle to a newly allocated Dali resource.
- * @pre DurationSeconds must be greater than zero.
+ * @note durationSeconds can not be negative.
*/
static Animation New(float durationSeconds);