(OvershootIndicator) Enable new shader bounce effect for overshoot
authorJulien Heanley <j.heanley@partner.samsung.com>
Fri, 9 May 2014 08:56:38 +0000 (09:56 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 15 May 2014 11:53:49 +0000 (12:53 +0100)
Change-Id: Ia1067b8c74296dc35d79d7fdd7084639c5727664
Signed-off-by: Julien Heanley <j.heanley@partner.samsung.com>
base/dali-toolkit/images/overshoot_ripple.png [deleted file]
base/dali-toolkit/images/scroll_overshoot.png [deleted file]
base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h
base/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
base/dali-toolkit/internal/controls/scrollable/scrollable-impl.h

diff --git a/base/dali-toolkit/images/overshoot_ripple.png b/base/dali-toolkit/images/overshoot_ripple.png
deleted file mode 100644 (file)
index ae3ccf6..0000000
Binary files a/base/dali-toolkit/images/overshoot_ripple.png and /dev/null differ
diff --git a/base/dali-toolkit/images/scroll_overshoot.png b/base/dali-toolkit/images/scroll_overshoot.png
deleted file mode 100755 (executable)
index 940f559..0000000
Binary files a/base/dali-toolkit/images/scroll_overshoot.png and /dev/null differ
index 93effd8..98577b4 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/events/mouse-wheel-event.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
+#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 
 using namespace std;
 using namespace Dali;
@@ -46,7 +47,6 @@ const float DEFAULT_COLOR_VISIBILITY_REMOVE_TIME = 0.5f; // 0.5 second
 
 const float MILLISECONDS_PER_SECONDS = 1000.0f;
 
-const char* OVERSHOOT_OVERLAY_RIPPLE_IMAGE_PATH = DALI_IMAGE_DIR "overshoot_ripple.png";
 const Rect<int> OVERSHOOT_BOUNCE_IMAGE_1_PIXEL_AREA( 0, 0, 720, 58 );
 const Vector4 OVERSHOOT_OVERLAY_NINE_PATCH_BORDER(0.0f, 0.0f, 1.0f, 12.0f);
 const float MAXIMUM_OVERSHOOT_HEIGHT = 36.0f;  // 36 pixels
@@ -1669,14 +1669,12 @@ void ItemView::SetOvershootEnabled( bool enable )
   Actor self = Self();
   if( enable )
   {
-    mOvershootEffect = OvershootRippleEffect::New();
-    Image overshootImage = Image::New( OVERSHOOT_OVERLAY_RIPPLE_IMAGE_PATH );
-    mOvershootOverlay = ImageActor::New( overshootImage );
+    mOvershootEffect = BouncingEffect::New(Scrollable::DEFAULT_OVERSHOOT_COLOUR);
+    mOvershootOverlay = CreateSolidColorActor(Vector4::ONE);
     mOvershootOverlay.SetParentOrigin(ParentOrigin::TOP_LEFT);
     mOvershootOverlay.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     mOvershootOverlay.SetDrawMode(DrawMode::OVERLAY);
     mOvershootOverlay.SetShaderEffect(mOvershootEffect);
-    mOvershootOverlay.SetPixelArea(OVERSHOOT_BOUNCE_IMAGE_1_PIXEL_AREA);
     self.Add(mOvershootOverlay);
     Constraint constraint = Constraint::New<float>( Actor::SIZE_WIDTH,
                                                       ParentSource( mPropertyScrollDirection ),
@@ -1704,7 +1702,7 @@ void ItemView::SetOvershootEnabled( bool enable )
                                         OvershootOverlayVisibilityConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
 
-    int effectOvershootPropertyIndex = mOvershootEffect.GetPropertyIndex(mOvershootEffect.GetOvershootPropertyName());
+    int effectOvershootPropertyIndex = mOvershootEffect.GetPropertyIndex(mOvershootEffect.GetProgressRatePropertyName());
     Actor self = Self();
     constraint = Constraint::New<float>( effectOvershootPropertyIndex,
                                          Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
index 242cf27..5bdc060 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
+#include <dali-toolkit/public-api/shader-effects/bouncing-effect.h>
 
 namespace Dali
 {
@@ -573,7 +573,7 @@ private:
   Dali::Gesture::State mGestureState;
 
   ImageActor mOvershootOverlay;           ///< The overlay actor for overshoot effect
-  OvershootRippleEffect mOvershootEffect; ///< The vertex/fragment shader used to display the overshoot ripple effect
+  BouncingEffect mOvershootEffect; ///< The vertex/fragment shader used to display the overshoot ripple effect
 
   Dali::Toolkit::ScrollConnector mScrollConnector; ///< Connects ItemView with scrollable components e.g. scroll bars
   Constrainable   mScrollPositionObject;     ///< From mScrollConnector
index 20f16d8..b5f1b10 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
+#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 
 using namespace Dali;
 
@@ -33,8 +34,6 @@ namespace Toolkit
 namespace Internal
 {
 
-const char* OVERSHOOT_OVERLAY_IMAGE_PATH = DALI_IMAGE_DIR "scroll_overshoot.png";
-const char* OVERSHOOT_OVERLAY_RIPPLE_IMAGE_PATH = DALI_IMAGE_DIR "overshoot_ripple.png";
 const float DEFAULT_MAX_OVERSHOOT_HEIGHT = 36.0f;  // 36 pixels
 const Rect<int> OVERSHOOT_RIPPLE_IMAGE_1_PIXEL_AREA( 0, 0, 720, 58 );
 const float DEFAULT_OVERSHOOT_ANIMATION_DURATION = 0.35f;  // time in seconds
@@ -99,260 +98,16 @@ ScrollOvershootEffect::ScrollOvershootEffect(bool vertical) :
 
 }
 
-ScrollOvershootEffectGradient::ScrollOvershootEffectGradient(bool vertical) :
-    ScrollOvershootEffect(vertical),
-    mMaxOvershootImageSize(DEFAULT_MAX_OVERSHOOT_HEIGHT)
-{
-  Image overshootImage = Image::New( OVERSHOOT_OVERLAY_IMAGE_PATH );
-  mOvershootImage = ImageActor::New( overshootImage );
-  mOvershootImage.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  mOvershootImage.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  mOvershootImage.SetDrawMode(DrawMode::OVERLAY);
-}
-
-void ScrollOvershootEffectGradient::Apply(Scrollable& scrollable)
-{
-  Actor scrollableActor = scrollable.Self();
-  int overshootXPropertyIndex = scrollableActor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
-  int overshootYPropertyIndex = scrollableActor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-
-  Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
-                                                    Source( scrollableActor, overshootXPropertyIndex ),
-                                                    Source( scrollableActor, overshootYPropertyIndex ),
-                                                    Source( scrollableActor, Actor::SIZE ),
-                                                    boost::bind( &ScrollOvershootEffectGradient::SizeConstraint, this, _1, _2, _3, _4) );
-  mSizeConstraint = mOvershootImage.ApplyConstraint(constraint);
-
-  constraint = Constraint::New<Quaternion>( Actor::ROTATION,
-                                            Source( scrollableActor, overshootXPropertyIndex ),
-                                            Source( scrollableActor, overshootYPropertyIndex ),
-                                            boost::bind( &ScrollOvershootEffectGradient::RotationConstraint, this, _1, _2, _3) );
-  mRotationConstraint = mOvershootImage.ApplyConstraint(constraint);
-
-  constraint = Constraint::New<Vector3>( Actor::POSITION,
-                                         Source( scrollableActor, Actor::SIZE ),
-                                         Source( scrollableActor, overshootXPropertyIndex ),
-                                         Source( scrollableActor, overshootYPropertyIndex ),
-                                         boost::bind( &ScrollOvershootEffectGradient::PositionConstraint, this, _1, _2, _3, _4) );
-  mPositionConstraint = mOvershootImage.ApplyConstraint(constraint);
-
-  constraint = Constraint::New<bool>( Actor::VISIBLE,
-                                      Source( scrollableActor, IsVertical() ? scrollableActor.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL) : scrollableActor.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL)),
-                                      boost::bind( &ScrollOvershootEffectGradient::VisibilityConstraint, this, _1, _2) );
-  mVisibilityConstraint = mOvershootImage.ApplyConstraint(constraint);
-  scrollable.AddOverlay(mOvershootImage);
-  SetPropertyNotifications(scrollableActor);
-}
-
-void ScrollOvershootEffectGradient::Remove(Scrollable& scrollable)
-{
-  if(mOvershootImage)
-  {
-    if(mSizeConstraint)
-    {
-      mOvershootImage.RemoveConstraint(mSizeConstraint);
-      mSizeConstraint = NULL;
-    }
-    if(mRotationConstraint)
-    {
-      mOvershootImage.RemoveConstraint(mRotationConstraint);
-      mRotationConstraint = NULL;
-    }
-    if(mPositionConstraint)
-    {
-      mOvershootImage.RemoveConstraint(mPositionConstraint);
-      mPositionConstraint = NULL;
-    }
-    if(mVisibilityConstraint)
-    {
-      mOvershootImage.RemoveConstraint(mVisibilityConstraint);
-      mVisibilityConstraint = NULL;
-    }
-    scrollable.RemoveOverlay(mOvershootImage);
-  }
-}
-
-Vector3 ScrollOvershootEffectGradient::SizeConstraint(const Vector3& current,
-    const PropertyInput& overshootPropertyX, const PropertyInput& overshootPropertyY,
-    const PropertyInput& parentSizeProperty)
-{
-  float overshootx = overshootPropertyX.GetFloat();
-  float overshooty = overshootPropertyY.GetFloat();
-  const Vector3 parentSize = parentSizeProperty.GetVector3();
-
-  float overlayWidth = IsVertical() ? parentSize.x : parentSize.y;
-  float overlayHeight = mMaxOvershootImageSize * fabsf(IsVertical() ? overshooty : overshootx);
-
-  return Vector3(overlayWidth, overlayHeight, current.z);
-}
-
-Quaternion ScrollOvershootEffectGradient::RotationConstraint(const Quaternion& current,
-    const PropertyInput& overshootPropertyX, const PropertyInput& overshootPropertyY)
-{
-  float overshootx = overshootPropertyX.GetFloat();
-  float overshooty = overshootPropertyY.GetFloat();
-
-  Quaternion rotation;
-
-  if(IsVertical())
-  {
-    if(overshooty < -Math::MACHINE_EPSILON_0)
-    {
-      rotation = Quaternion(Math::PI, Vector3::ZAXIS);
-    }
-    else if(overshooty > Math::MACHINE_EPSILON_0)
-    {
-      rotation = Quaternion(0.0f, Vector3::ZAXIS);
-    }
-  }
-  else
-  {
-    if(overshootx < -Math::MACHINE_EPSILON_0)
-    {
-      rotation = Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
-    }
-    else if(overshootx > Math::MACHINE_EPSILON_0)
-    {
-      rotation = Quaternion(1.5f * Math::PI, Vector3::ZAXIS);
-    }
-  }
-
-  return rotation;
-}
-
-Vector3 ScrollOvershootEffectGradient::PositionConstraint(const Vector3&    current,
-    const PropertyInput& parentSizeProperty,
-    const PropertyInput& overshootPropertyX, const PropertyInput& overshootPropertyY)
-{
-  float overshootx = overshootPropertyX.GetFloat();
-  float overshooty = overshootPropertyY.GetFloat();
-  const Vector3 parentSize = parentSizeProperty.GetVector3();
-
-  Vector3 relativeOffset = Vector3::ZERO;
-
-  if(IsVertical())
-  {
-    if(overshooty > Math::MACHINE_EPSILON_0)
-    {
-      relativeOffset = Vector3(0.0f, 0.0f, 0.0f);
-    }
-    else if (overshooty < -Math::MACHINE_EPSILON_0)
-    {
-      relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
-    }
-  }
-  else
-  {
-    if(overshootx > Math::MACHINE_EPSILON_0)
-    {
-      relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
-    }
-    else if (overshootx < -Math::MACHINE_EPSILON_0)
-    {
-      relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
-    }
-  }
-
-  return relativeOffset * parentSize;
-}
-
-bool ScrollOvershootEffectGradient::VisibilityConstraint(const bool& current,
-    const PropertyInput& canScrollProperty)
-{
-  return canScrollProperty.GetBoolean();
-}
-
-ScrollOvershootEffectGradientPtr ScrollOvershootEffectGradient::New(bool vertical)
-{
-  return new ScrollOvershootEffectGradient(vertical);
-}
-
-namespace
-{
-
-const std::string OVERSHOOT_PROPERTY_NAME( "uOvershoot" );
-const std::string OVERSHOOT_IMAGE_COUNT_PROPERTY_NAME( "uOvershootImageCount" );
-
-} // namespace
-
-OvershootRippleEffect::OvershootRippleEffect()
-{
-}
-
-//Call the Parent copy constructor to add reference to the implementation for this object
-OvershootRippleEffect::OvershootRippleEffect(ShaderEffect handle)
-:ShaderEffect(handle)
-{
-}
-
-OvershootRippleEffect::~OvershootRippleEffect()
-{
-}
-
-OvershootRippleEffect OvershootRippleEffect::New()
-{
-  std::string vertextShader(
-      "precision mediump float;                     \n"
-      "uniform  float  uOvershoot;                  \n"
-      "uniform  float  uOvershootImageCount;        \n"
-      "void main()                                  \n"
-      "{                                            \n"
-      "  gl_Position = uProjection * uModelView * vec4(aPosition, 1.0); \n"
-      "  vTexCoord = aTexCoord;                     \n"
-      "  vTexCoord.y += (1.0 / uOvershootImageCount) * min(floor((abs(uOvershoot) * (uOvershootImageCount - 1.0)) + 0.5), (uOvershootImageCount - 1.0)); \n"
-      "}                                            \n" );
-
-  std::string fragmentShader(
-      "void main()                                  \n"
-      "{                                            \n"
-      "  gl_FragColor = texture2D(sTexture, vTexCoord);    \n"
-      "}                                            \n" );
-
-  // Create the implementation, temporarily owned on stack,
-  Dali::ShaderEffect shaderEffectCustom =  Dali::ShaderEffect::New(
-      vertextShader,
-      fragmentShader);
-
-  /* Pass ownership to OvershootRippleEffect through overloaded constructor, So that it now has access to the
-     Dali::ShaderEffect implementation */
-  OvershootRippleEffect handle( shaderEffectCustom );
-  handle.SetUniform(OVERSHOOT_PROPERTY_NAME, 0.0f);
-  handle.SetUniform(OVERSHOOT_IMAGE_COUNT_PROPERTY_NAME, 10.0f);
-  return handle;
-}
-
-void OvershootRippleEffect::SetOvershoot( float overshoot )
-{
-  SetUniform( OVERSHOOT_PROPERTY_NAME, overshoot );
-}
-
-void OvershootRippleEffect::SetOvershootImageCount( float imageCount )
-{
-  SetUniform( OVERSHOOT_IMAGE_COUNT_PROPERTY_NAME, imageCount );
-}
-
-const std::string& OvershootRippleEffect::GetOvershootPropertyName() const
-{
-  return OVERSHOOT_PROPERTY_NAME;
-}
-
-const std::string& OvershootRippleEffect::GetOvershootImageCountPropertyName() const
-{
-  return OVERSHOOT_IMAGE_COUNT_PROPERTY_NAME;
-}
-
 ScrollOvershootEffectRipple::ScrollOvershootEffectRipple(bool vertical) :
     ScrollOvershootEffect(vertical),
     mMaxOvershootImageSize(DEFAULT_MAX_OVERSHOOT_HEIGHT)
 {
-  mRippleEffect = OvershootRippleEffect::New();
-  Image overshootImage = Image::New( OVERSHOOT_OVERLAY_RIPPLE_IMAGE_PATH );
-  mOvershootImage = ImageActor::New( overshootImage );
+  mRippleEffect = BouncingEffect::New(Scrollable::DEFAULT_OVERSHOOT_COLOUR);
+  mOvershootImage = CreateSolidColorActor(Vector4::ONE);
   mOvershootImage.SetParentOrigin(ParentOrigin::TOP_LEFT);
   mOvershootImage.SetAnchorPoint(AnchorPoint::TOP_LEFT);
   mOvershootImage.SetDrawMode(DrawMode::OVERLAY);
   mOvershootImage.SetShaderEffect(mRippleEffect);
-  mOvershootImage.SetPixelArea(OVERSHOOT_RIPPLE_IMAGE_1_PIXEL_AREA);
   mOvershootImage.SetVisible(false);
   mAnimatingOvershootOn = false;
   mAnimateOvershootOff = false;
@@ -394,7 +149,7 @@ void ScrollOvershootEffectRipple::Reset()
   mAnimatingOvershootOn = false;
   mAnimateOvershootOff = false;
   mOvershootImage.SetVisible(false);
-  mRippleEffect.SetUniform(mRippleEffect.GetOvershootPropertyName(), 0.0f);
+  mRippleEffect.SetProgressRate(0.0f);
   if(mScrollOvershootAnimation)
   {
     mScrollOvershootAnimation.Clear();
@@ -404,7 +159,7 @@ void ScrollOvershootEffectRipple::Reset()
 
 void ScrollOvershootEffectRipple::UpdateConstraints(Actor& scrollable)
 {
-  int overshootPropertyIndex = mRippleEffect.GetPropertyIndex(mRippleEffect.GetOvershootPropertyName());
+  int overshootPropertyIndex = mRippleEffect.GetPropertyIndex(mRippleEffect.GetProgressRatePropertyName());
   Constraint constraint;
   if(!mSizeConstraint)
   {
@@ -565,7 +320,7 @@ void ScrollOvershootEffectRipple::AnimateScrollOvershoot(float overshootAmount)
   // make sure we animate back if needed
   mAnimateOvershootOff = (!animatingOn && mAnimatingOvershootOn);
 
-  int overShootProperty = mRippleEffect.GetPropertyIndex(mRippleEffect.GetOvershootPropertyName());
+  int overShootProperty = mRippleEffect.GetPropertyIndex(mRippleEffect.GetProgressRatePropertyName());
   float currentOvershoot = mRippleEffect.GetProperty<float>(overShootProperty);
   if(((currentOvershoot < 0.0f && overshootAmount > 0.0f)
       || (currentOvershoot > 0.0f && overshootAmount < 0.0f)))
index 4358059..d59df83 100644 (file)
@@ -18,6 +18,7 @@
 //
 
 #include <dali/dali.h>
+#include <dali-toolkit/public-api/shader-effects/bouncing-effect.h>
 
 namespace Dali
 {
@@ -140,148 +141,6 @@ private:
 };
 
 /**
- * OvershootRippleEffect is a custom shader effect for the overshoot indicator
- */
-class OvershootRippleEffect : public ShaderEffect
-{
-public:
-
-  /**
-   * Create an uninitialized OvershootRippleEffect; this can be initialized with OvershootRippleEffect::New()
-   * Calling member functions with an uninitialized Dali::Object is not allowed.
-   */
-  OvershootRippleEffect();
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~OvershootRippleEffect();
-
-  /**
-   * Create an initialized OvershootRippleEffect.
-   *
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static OvershootRippleEffect New();
-
-  /**
-   * Set the current overshoot value
-   *
-   * @param[in] overshoot current overshoot value in the range [0.0f,1.0f]
-   */
-  void SetOvershoot(float overshoot);
-
-  /**
-   * Set the number of sub images in the overshoot bounce image
-   *
-   * @param[in] imageCount number of sub images in main ripple effect image
-   */
-  void SetOvershootImageCount(float imageCount);
-
-  /**
-   * Get the name for the overshoot property
-   * which can be used in Animation API's
-   *
-   * @return A std::string containing the property name
-   */
-  const std::string& GetOvershootPropertyName() const;
-
-  /**
-   * Get the name for the sub image count property
-   * which can be used in Animation API's
-   *
-   * @return A std::string containing the property name
-   */
-  const std::string& GetOvershootImageCountPropertyName() const;
-
-private: // Not intended for application developers
-  OvershootRippleEffect(ShaderEffect handle);
-};
-
-/**
- * ScrollOvershootEffectGradient creates a gradiented effect at the end of the scrollable area if the user
- * attempts to scroll past it
- */
-struct ScrollOvershootEffectGradient : public ScrollOvershootEffect
-{
-public:
-  /**
-   * Create a new gradient overshoot effect, passing in whether it is vertical or horizontal
-   *
-   * @param[in] vertical whether this effect is a vertical or horizontal one
-   */
-  ScrollOvershootEffectGradient(bool vertical);
-
-  /**
-   * @copydoc ScrollOvershootEffect::Apply
-   */
-  virtual void Apply(Scrollable& scrollable);
-
-  /**
-   * @copydoc ScrollOvershootEffect::Remove
-   */
-  virtual void Remove(Scrollable& scrollable);
-
-  /**
-   * @copydoc ScrollOvershootEffect::Reset
-   */
-  virtual void Reset() {}
-
-  /**
-   * Constrains the size of the gradient image
-   * @param[in] current current size of the image actor
-   * @param[in] overshootPropertyX current overshoot x amount
-   * @param[in] overshootPropertyY current overshoot y amount
-   * @param[in] parentSizeProperty size of the scrollable area so we can make sure the image stretches across it
-   * @return the new size of the image depending on the overshoot amount
-   */
-  Vector3 SizeConstraint(const Vector3& current, const PropertyInput& overshootPropertyX, const PropertyInput& overshootPropertyY, const PropertyInput& parentSizeProperty);
-
-  /**
-   * Constrains the size of the gradient image
-   * @param[in] current current rotation of the image actor
-   * @param[in] overshootPropertyX current overshoot x amount
-   * @param[in] overshootPropertyY current overshoot y amount
-   * @return new rotation os the gradient image actor
-   */
-  Quaternion RotationConstraint(const Quaternion& current, const PropertyInput& overshootPropertyX, const PropertyInput& overshootPropertyY);
-
-  /**
-   * Constrains the size of the gradient image
-   * @param[in] current current position of the image actor
-   * @param[in] parentSizeProperty size of the scrollable area so we can position image on the edge of it
-   * @param[in] overshootPropertyX current overshoot x amount
-   * @param[in] overshootPropertyY current overshoot y amount
-   * @return new position of the gradient image actor
-   */
-  Vector3 PositionConstraint(const Vector3& current, const PropertyInput& parentSizeProperty, const PropertyInput& overshootPropertyX, const PropertyInput& overshootPropertyY);
-
-  /**
-   * Constrains the size of the gradient image
-   * @param[in] current current visibility of the image actor
-   * @param[in] overshootPropertyX current overshoot x amount
-   * @param[in] overshootPropertyY current overshoot y amount
-   * @return new visibility property depending on overshoot values
-   */
-  bool VisibilityConstraint(const bool& current, const PropertyInput& canScrollProperty);
-
-  /**
-   * Creates a new ScrollOvershootEffectGradient objects and returns a pointer to it
-   * @param[in] vertical whether to create a vertical(true) or horizontal effect
-   * @return a pointer to the new effect
-   */
-  static ScrollOvershootEffectGradientPtr New( bool vertical );
-
-private:
-  float mMaxOvershootImageSize;            ///< maximum size of the image when overshoot value is 1.0f
-  ImageActor mOvershootImage;              ///< the overshoot image...
-  ActiveConstraint    mSizeConstraint;     ///< active constraint handle used to store the image width constraint
-  ActiveConstraint    mRotationConstraint; ///< active constraint handle used to store the image rotation constraint
-  ActiveConstraint    mPositionConstraint; ///< active constraint handle used to store the image position constraint
-  ActiveConstraint    mVisibilityConstraint; ///< active constraint handle used to store the image visibility constraint
-};
-
-/**
  * ScrollOvershootEffectRipple creates an animated bounce effect at the end of the scrollable area if the user
  * attempts to scroll past it
  */
@@ -372,7 +231,7 @@ private:
   bool      mAnimatingOvershootOn;         ///< whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
   bool      mAnimateOvershootOff;          ///< whether we are currently animating overshoot to 1.0f/-1.0f (on) or to 0.0f (off)
   int       mCanScrollPropertyIndex;       ///< property index to a property that informs indicator if it is needed
-  OvershootRippleEffect mRippleEffect;                 // the ripple vertex/fragment shader effect
+  BouncingEffect mRippleEffect;                 // the ripple vertex/fragment shader effect
   PropertyNotification mOvershootPositiveNotification; // stores the property notification used for positive overshoot values
   PropertyNotification mOvershootNegativeNotification; // stores the property notification used for negative overshoot values
   ActiveConstraint    mSizeConstraint;                 // active constraint handle used to store the image width constraint
index 90fb50e..df782be 100644 (file)
@@ -54,6 +54,7 @@ SignalConnectorType s4(mType, Toolkit::Scrollable::SIGNAL_SCROLL_CLAMPED,   &Scr
 
 const std::string Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL( "scrollable-can-scroll-vertical" );
 const std::string Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL( "scrollable-can-scroll-horizontal" );
+const Vector4     Scrollable::DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.6f);
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Scrollable
index 72cc47a..05c9a75 100644 (file)
@@ -44,6 +44,7 @@ class Scrollable : public ControlImpl
 public:
   static const std::string SCROLLABLE_CAN_SCROLL_VERTICAL;
   static const std::string SCROLLABLE_CAN_SCROLL_HORIZONTAL;
+  static const Vector4     DEFAULT_OVERSHOOT_COLOUR;
 
   /**
    * Create a new Scrollable.