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-twist-effect-impl.cpp;h=1a3b893f3dadf4a34223e8d0012ee2d36cdc6bd6;hp=899b6e61281c04ea75d1f3707420acf6d0e5e347;hb=63106d0a9407c87ff624f4b93e2627a0c7cc1e2a;hpb=1ab5a093a38b07a63a5b81ac0394d2ca10eb48d9 diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp index 899b6e6..1a3b893 100755 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-twist-effect-impl.cpp @@ -179,8 +179,7 @@ struct ScrollDropoffTwistRotationConstraint const PropertyInput& scrollablePositionProperty, const PropertyInput& scrollOvershootXProperty, const PropertyInput& scrollOvershootYProperty, - const PropertyInput& pageSizeProperty, - const PropertyInput& activateProperty) + const PropertyInput& pageSizeProperty) { const Vector3& position = actorPositionProperty.GetVector3(); const Vector3& parentPosition = scrollablePositionProperty.GetVector3(); @@ -192,13 +191,6 @@ struct ScrollDropoffTwistRotationConstraint return current; } - const float& activate = activateProperty.GetFloat(); - - if(activate < Math::MACHINE_EPSILON_0) - { - return current; - } - // get distance from centre of scrollable container Vector2 distance = position.GetVectorXY() - parentPosition.GetVectorXY(); @@ -275,19 +267,11 @@ struct ScrollTwistRotationConstraint */ Quaternion operator()(const Quaternion& current, const PropertyInput& scrollOvershootXProperty, - const PropertyInput& scrollOvershootYProperty, - const PropertyInput& activateProperty) + const PropertyInput& scrollOvershootYProperty) { const Vector2 overshoot(scrollOvershootXProperty.GetFloat(), scrollOvershootYProperty.GetFloat()); - if(fabsf(overshoot.x) < Math::MACHINE_EPSILON_0 && fabsf(overshoot.y) < Math::MACHINE_EPSILON_0) - { - return current; - } - - const float& activate = activateProperty.GetFloat(); - - if(activate < Math::MACHINE_EPSILON_0) + if( fabsf(overshoot.x) < Math::MACHINE_EPSILON_0 && fabsf(overshoot.y) < Math::MACHINE_EPSILON_0 ) { return current; } @@ -543,7 +527,6 @@ void ScrollViewTwistEffect::Apply(Actor child) Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME ) ), Source(scrollView, Actor::SIZE ), - Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ), ScrollDropoffTwistRotationConstraint(mMaxSwingAngle, mDropOff, mDropOffDistance, mDropOffFunction) ); } else @@ -551,7 +534,6 @@ void ScrollViewTwistEffect::Apply(Actor child) constraint = Constraint::New( Actor::ROTATION, Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME ) ), Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME ) ), - Source(scrollView, scrollView.GetPropertyIndex( EFFECT_ACTIVATE) ), ScrollTwistRotationConstraint(mMaxSwingAngle) ); } constraint.SetRemoveAction( Constraint::Discard ); @@ -584,8 +566,10 @@ void ScrollViewTwistEffect::OnAttach(Toolkit::ScrollView& scrollView) mPropertyTime = SafeRegisterProperty( scrollView, EFFECT_TIME, 0.0f ); mPropertyReference = SafeRegisterProperty( scrollView, EFFECT_REFERENCE, Vector3::ZERO ); mPropertyDepth = SafeRegisterProperty( scrollView, EFFECT_DEPTH, 0.0f); - mPropertyActivate = SafeRegisterProperty(scrollView, EFFECT_ACTIVATE, 1.0f); + mPropertyActivate = SafeRegisterProperty(scrollView, EFFECT_ACTIVATE, 0.0f); } + // currently cant change overshoot snap back duration, use the constant one from ScrollView + mActivationTime = Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION; // Connect to the scroll view signals scrollView.ScrollStartedSignal().Connect(this, &ScrollViewTwistEffect::OnScrollStart); @@ -677,7 +661,7 @@ void ScrollViewTwistEffect::OnScrollComplete( const Vector3& position ) } Actor scrollView = GetScrollView(); scrollView.SetProperty(mPropertyActivate, 1.0f); - mActivateAnimation = Animation::New(DELAY); + mActivateAnimation = Animation::New(mActivationTime); mActivateAnimation.AnimateTo( Property(scrollView, mPropertyActivate), 0.0f, AlphaFunctions::Linear); mActivateAnimation.FinishedSignal().Connect(this, &ScrollViewTwistEffect::OnActivateAnimationFinished); mActivateAnimation.Play();