X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fscrollable%2Fitem-view%2Fitem-layout.cpp;h=54809c32bbaf0ed7854d723ba28b54fe4365e763;hb=2ea37149ec3b54f9f2255cca9eca5429907b5601;hp=7922ae0cdffd200117b925aa372f7ac7da60e6be;hpb=6d762b4acd946b3d02e76c1805e7af9a1a5b1809;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp index 7922ae0..54809c3 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp @@ -152,150 +152,6 @@ float ItemLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayo return currentLayoutPosition; } -void ItemLayout::GetXAxisScrollHint(Vector2& scrollHint) const -{ - scrollHint = Vector2::ZERO; - Radian scrollAngle(GetScrollDirection()); - Vector2 scrollDirection(sinf(scrollAngle), cosf(scrollAngle)); - switch(mOrientation) - { - case ControlOrientation::Up: - { - if(fabsf(scrollDirection.y) < Math::MACHINE_EPSILON_1) - { - // we probably want x scrolling - if(scrollDirection.x > 0.0f) - { - // normal positive scrolling - scrollHint = Vector2::XAXIS; - } - else - { - scrollHint = -Vector2::XAXIS; - } - } - break; - } - case ControlOrientation::Down: - { - if(fabsf(scrollDirection.y) < Math::MACHINE_EPSILON_1) - { - // we probably want x scrolling - if(scrollDirection.x > 0.0f) - { - // normal positive scrolling - scrollHint = -Vector2::XAXIS; - } - else - { - scrollHint = Vector2::XAXIS; - } - } - break; - } - case ControlOrientation::Left: - { - // we probably want x scrolling - if(scrollDirection.x > 0.0f) - { - // normal positive scrolling - scrollHint = Vector2::XAXIS; - } - else - { - scrollHint = -Vector2::XAXIS; - } - break; - } - case ControlOrientation::Right: - { - // we probably want x scrolling - if(scrollDirection.x > 0.0f) - { - // normal positive scrolling - scrollHint = -Vector2::XAXIS; - } - else - { - scrollHint = Vector2::XAXIS; - } - break; - } - } -} - -void ItemLayout::GetYAxisScrollHint(Vector2& scrollHint) const -{ - scrollHint = Vector2::ZERO; - Radian scrollAngle(GetScrollDirection()); - Vector2 scrollDirection(sinf(scrollAngle), cosf(scrollAngle)); - switch(mOrientation) - { - case ControlOrientation::Up: - { - // we probably want x scrolling - if(scrollDirection.y > 0.0f) - { - // normal positive scrolling - scrollHint = Vector2::YAXIS; - } - else - { - scrollHint = -Vector2::YAXIS; - } - break; - } - case ControlOrientation::Down: - { - // we probably want x scrolling - if(scrollDirection.y > 0.0f) - { - // normal positive scrolling - scrollHint = -Vector2::YAXIS; - } - else - { - scrollHint = Vector2::YAXIS; - } - break; - } - case ControlOrientation::Left: - { - if(fabsf(scrollDirection.x) < Math::MACHINE_EPSILON_1) - { - // we probably want x scrolling - if(scrollDirection.y > 0.0f) - { - // normal positive scrolling - scrollHint = -Vector2::YAXIS; - } - else - { - scrollHint = Vector2::YAXIS; - } - } - break; - } - case ControlOrientation::Right: - { - if(fabsf(scrollDirection.x) < Math::MACHINE_EPSILON_1) - { - // we probably want x scrolling - if(scrollDirection.y > 0.0f) - { - // normal positive scrolling - scrollHint = Vector2::YAXIS; - } - else - { - scrollHint = -Vector2::YAXIS; - } - } - break; - } - } -} - int ItemLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled) { switch( direction ) @@ -344,10 +200,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d if (GetPositionConstraint(itemId, positionConstraint)) { WrappedVector3Constraint wrapped(positionConstraint, itemId); - Constraint constraint = Constraint::New( Actor::POSITION, + Constraint constraint = Constraint::New( Actor::Property::POSITION, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::SIZE ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); constraint.SetAlphaFunction(mAlphaFunction); @@ -359,10 +215,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedQuaternionConstraint wrapped(rotationConstraint, itemId); - Constraint constraint = Constraint::New( Actor::ROTATION, + Constraint constraint = Constraint::New( Actor::Property::ORIENTATION, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::SIZE ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); constraint.SetAlphaFunction(mAlphaFunction); @@ -375,10 +231,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedVector3Constraint wrapped(scaleConstraint, itemId); - Constraint constraint = Constraint::New( Actor::SCALE, + Constraint constraint = Constraint::New( Actor::Property::SCALE, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::SIZE ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); constraint.SetAlphaFunction(mAlphaFunction); @@ -391,10 +247,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedVector4Constraint wrapped(colorConstraint, itemId); - Constraint constraint = Constraint::New( Actor::COLOR, + Constraint constraint = Constraint::New( Actor::Property::COLOR, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::SIZE ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds); @@ -409,10 +265,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d { WrappedBoolConstraint wrapped(visibilityConstraint, itemId); - Constraint constraint = Constraint::New( Actor::VISIBLE, + Constraint constraint = Constraint::New( Actor::Property::VISIBLE, Source( scrollPositionObject, scrollPositionProperty ), ParentSource( scrollSpeedProperty ), - ParentSource( Actor::SIZE ), + ParentSource( Actor::Property::SIZE ), wrapped ); constraint.SetApplyTime(durationSeconds);