const float SLIDING_ANIMATION_DURATION( 0.2f ); // 200 milli seconds
const float AUTO_INDICATOR_STAY_DURATION(3.0f); // 3 seconds
-const float SHOWING_DISTANCE_HEIGHT_RATE(0.33f);
+const float SHOWING_DISTANCE_HEIGHT_RATE(0.17f); // 10 pixels
enum
{
case Dali::TouchPoint::Down:
{
mTouchedDown = true;
- mTouchedYPosition = touchPoint.local.y;
+ mTouchDownPosition = touchPoint.local;
+
}
break;
{
if( mTouchedDown )
{
- if( touchPoint.local.y > mTouchedYPosition + mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE )
+ float moveDistance = sqrt( (mTouchDownPosition.x - touchPoint.local.x) * (mTouchDownPosition.x - touchPoint.local.x)
+ + (mTouchDownPosition.y - touchPoint.local.y)*(mTouchDownPosition.y - touchPoint.local.y) );
+
+ if( moveDistance > 2 * (mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE) /*threshold for distance*/
+ && touchPoint.local.y - mTouchDownPosition.y > mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE /*threshold for y*/ )
{
ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
mTouchedDown = false;
bool mIsAnimationPlaying; ///< Whether the animation is playing
bool mTouchedDown; ///< Whether the indicator area touched down
- int mTouchedYPosition; ///< Indicator area touched position
+ Dali::Vector2 mTouchDownPosition; ///< Indicator area touched down position
};