X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-impl.cpp;h=6cd1a37b3380b91f35e9e324030a487a5214f019;hp=b11b64c72ed79015f40aeb7b98cbb10755b8a4d0;hb=1df5dd2e4d6f9129cf495e9af612f4fc8bd6afda;hpb=00ef589046a32c53d20de1c61af7cc69524e51dc diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index b11b64c..6cd1a37 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -540,7 +540,8 @@ ScrollView::ScrollView() mAxisAutoLockGradient(Toolkit::ScrollView::DEFAULT_AXIS_AUTO_LOCK_GRADIENT), mFrictionCoefficient(Toolkit::ScrollView::DEFAULT_FRICTION_COEFFICIENT), mFlickSpeedCoefficient(Toolkit::ScrollView::DEFAULT_FLICK_SPEED_COEFFICIENT), - mMaxFlickSpeed(Toolkit::ScrollView::DEFAULT_MAX_FLICK_SPEED) + mMaxFlickSpeed(Toolkit::ScrollView::DEFAULT_MAX_FLICK_SPEED), + mInAccessibilityPan(false) { SetRequiresMouseWheelEvents(true); } @@ -1365,7 +1366,8 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity) { horizontal = All; - if(speed2 > flickSpeedThreshold2) // exceeds flick threshold + if( speed2 > flickSpeedThreshold2 || // exceeds flick threshold + mInAccessibilityPan ) // With AccessibilityPan its easier to move between snap positions { if((angle >= -orthoAngleRange) && (angle < orthoAngleRange)) // Swiping East { @@ -1392,7 +1394,8 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity) { vertical = All; - if(speed2 > flickSpeedThreshold2) // exceeds flick threshold + if( speed2 > flickSpeedThreshold2 || // exceeds flick threshold + mInAccessibilityPan ) // With AccessibilityPan its easier to move between snap positions { if((angle >= M_PI_2-orthoAngleRange) && (angle < M_PI_2+orthoAngleRange)) // Swiping South { @@ -2140,17 +2143,23 @@ void ScrollView::OnPan(PanGesture gesture) self.SetProperty( mPropertyScrollStartPagePosition, GetCurrentScrollPosition() ); // Update property: X & Y = Position (only when in panning mode - in snapping mode, X & Y are animated). - Constraint constraint = Constraint::New( mPropertyX, - LocalSource( mPropertyPosition ), - Source( self, mPropertyPanning ), - InternalXConstraint ); - mScrollMainInternalXConstraint = self.ApplyConstraint(constraint); + if( ! mScrollMainInternalXConstraint ) + { + Constraint constraint = Constraint::New( mPropertyX, + LocalSource( mPropertyPosition ), + Source( self, mPropertyPanning ), + InternalXConstraint ); + mScrollMainInternalXConstraint = self.ApplyConstraint( constraint ); + } + if( ! mScrollMainInternalYConstraint ) + { + Constraint constraint = Constraint::New( mPropertyY, + LocalSource( mPropertyPosition ), + Source( self, mPropertyPanning ), + InternalYConstraint ); + mScrollMainInternalYConstraint = self.ApplyConstraint( constraint ); + } - constraint = Constraint::New( mPropertyY, - LocalSource( mPropertyPosition ), - Source( self, mPropertyPanning ), - InternalYConstraint ); - mScrollMainInternalYConstraint = self.ApplyConstraint(constraint); // When panning we want to make sure overshoot values are affected by pre position and post position SetOvershootConstraintsEnabled(true); break; @@ -2171,6 +2180,8 @@ void ScrollView::OnPan(PanGesture gesture) // Remove X & Y position constraints as they are not required when we are not panning. self.RemoveConstraint(mScrollMainInternalXConstraint); self.RemoveConstraint(mScrollMainInternalYConstraint); + mScrollMainInternalXConstraint.Reset(); + mScrollMainInternalYConstraint.Reset(); break; } @@ -2285,7 +2296,11 @@ Vector3 ScrollView::GetOvershoot(Vector3& position) const bool ScrollView::OnAccessibilityPan(PanGesture gesture) { + // Keep track of whether this is an AccessibilityPan + mInAccessibilityPan = true; OnPan(gesture); + mInAccessibilityPan = false; + return true; }