X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-impl.cpp;h=690704de64194cd90bae0c19359f7289b65757e2;hb=78d6c4118411aa10112953fe6844eb08c944dd59;hp=4cc23932dc83b1e0f980d94edd9706d36dadb886;hpb=41278d3fb755de3cb89edf6d80603b18562b4e01;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index 4cc2393..690704d 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -683,6 +683,7 @@ void ScrollView::OnInitialize() mGestureStackDepth = 0; + self.TouchSignal().Connect( this, &ScrollView::OnTouch ); EnableGestureDetection( Gesture::Type( Gesture::Pan ) ); // By default we'll allow the user to freely drag the scroll view, @@ -2043,7 +2044,7 @@ bool ScrollView::OnTouchDownTimeout() return false; } -bool ScrollView::OnTouchEvent(const TouchEvent& event) +bool ScrollView::OnTouch( Actor actor, const TouchData& touch ) { if(!mSensitive) { @@ -2054,21 +2055,21 @@ bool ScrollView::OnTouchEvent(const TouchEvent& event) } // Ignore events with multiple-touch points - if (event.GetPointCount() != 1) + if (touch.GetPointCount() != 1) { DALI_LOG_SCROLL_STATE("[0x%X], multiple touch, ignoring", this); return false; } - const TouchPoint::State pointState = event.GetPoint(0).state; - if( pointState == TouchPoint::Down ) + const PointState::Type pointState = touch.GetState( 0 ); + if( pointState == PointState::DOWN ) { DALI_LOG_SCROLL_STATE("[0x%X] Down", this); if(mGestureStackDepth==0) { - mTouchDownTime = event.time; + mTouchDownTime = touch.GetTime(); // This allows time for a pan-gesture to start, to avoid breaking snap-animation behavior with fast flicks. // If touch-down does not become a pan (after timeout interval), then snap-animation can be interrupted. @@ -2077,8 +2078,8 @@ bool ScrollView::OnTouchEvent(const TouchEvent& event) StartTouchDownTimer(); } } - else if( ( pointState == TouchPoint::Up ) || - ( ( pointState == TouchPoint::Interrupted ) && ( event.GetPoint(0).hitActor == Self() ) ) ) + else if( ( pointState == PointState::UP ) || + ( ( pointState == PointState::INTERRUPTED ) && ( touch.GetHitActor( 0 )== Self() ) ) ) { DALI_LOG_SCROLL_STATE("[0x%X] %s", this, ( ( pointState == TouchPoint::Up ) ? "Up" : "Interrupted" ) ); @@ -2089,8 +2090,8 @@ bool ScrollView::OnTouchEvent(const TouchEvent& event) // otherwise our scroll could be stopped (interrupted) half way through an animation. if(mGestureStackDepth==0 && mTouchDownTimeoutReached) { - if( ( event.GetPoint(0).state == TouchPoint::Interrupted ) || - ( ( event.time - mTouchDownTime ) >= MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET ) ) + if( ( pointState == PointState::INTERRUPTED ) || + ( ( touch.GetTime() - mTouchDownTime ) >= MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET ) ) { // Reset the velocity only if down was received a while ago mLastVelocity = Vector2( 0.0f, 0.0f );