*
*/
-#include <dali/dali.h>
-#include <dali-toolkit/public-api/shader-effects/bouncing-effect.h>
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/common/intrusive-ptr.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/object/property-notification.h>
+#include <dali/public-api/object/ref-object.h>
namespace Dali
{
void Reset();
/**
+ * Clears the overshoot
+ */
+ void ClearOvershoot();
+
+ /**
* Create an initialized ScrollOvershootIndicator
*
* @return A pointer to the created ScrollOvershootIndicator.
*/
static ScrollOvershootIndicator* New();
+ /**
+ * Set the color of the overshoot effect.
+ * @parm[in] color The color of the overshoot effect
+ */
+ void SetOvershootEffectColor( const Vector4& color );
+
private:
ScrollOvershootEffectPtr mEffectX; ///< effect used for x-axis/horizontal display
ScrollOvershootEffectPtr mEffectY; ///< effect used for y-axis/vertical display
*/
virtual void UpdatePropertyNotifications() {}
+ /**
+ * @copydoc ScrollOvershootIndicator::SetOvershootEffectColor()
+ */
+ virtual void SetOvershootEffectColor( const Vector4& color ) = 0;
+
+ /**
+ * Sets shader overshoot value, either immediately of by animating over time
+ *
+ * @param[in] amount The amount to set overshoot to [-1.0f,1.0f]
+ * @param[in] animate Whether to animate or set immediately
+ */
+ virtual void SetOvershoot(float amount, bool animate = true) = 0;
+
private:
bool mVertical; ///< whether this is a vertical/horizontal effect
};
void UpdatePropertyNotifications();
/**
+ * @copydoc ScrollOvershootEffect::SetOvershootEffectColor()
+ */
+ void SetOvershootEffectColor( const Vector4& color );
+
+ /**
* Updates the vibility of the overshoot image as well as updating its size, position and rotation
* This function is called when animation starts and finishes
*
void OnOvershootNotification(PropertyNotification& source);
/**
- * Sets shader overshoot value, either immediately of by animating over time
- *
- * @param[in] amount The amount to set overshoot to [-1.0f,1.0f]
- * @param[in] animate Whether to animate or set immediately
+ * @copydoc ScrollOvershootEffect::SetOvershoot()
*/
void SetOvershoot(float amount, bool animate = true);
static ScrollOvershootEffectRipplePtr New( bool vertical, Scrollable& scrollable );
private:
- ImageActor mOvershootImage; ///< the overshoot image...
+ Actor mOvershootOverlay; ///< the actor which displays the overshoot effect
Scrollable& mAttachedScrollView; ///< the actor that this indicator has been attached to
- BouncingEffect mRippleEffect; ///< the ripple vertex/fragment shader effect
Animation mScrollOvershootAnimation; ///< overshoot animation
PropertyNotification mOvershootIncreaseNotification;///< notification used to inform as overshoot increases
PropertyNotification mOvershootDecreaseNotification;///< notification used to inform as overshoot decreases
- Property::Index mCanScrollPropertyIndex; ///< property index to a property that informs indicator if it is needed
Property::Index mOvershootProperty; ///< index of the overshoot property in the scrollable actor
Property::Index mEffectOvershootProperty; ///< index of the effect's overshoot property
- float mMaxOvershootImageSize; ///< maximum height of the image when overshoot value is 1.0f
- float mOvershootAnimationDuration; ///< time taken for overshoot to go from fully offscreen to fully onscreen and vice versa
- float mOvershoot; ///< last overshoot value as detected by notifications
- unsigned short mAnimationStateFlags; ///< contains flags indicating the current state of the overshoot animation
+ float mOvershoot; ///< last overshoot value as detected by notifications
+ unsigned short mAnimationStateFlags; ///< contains flags indicating the current state of the overshoot animation
};
} // namespace Internal