Added stop expand/collapse animation in OnBoundsChanged
authorSangYong Lee <sangyongim.lee@samsung.com>
Mon, 6 May 2013 12:26:44 +0000 (21:26 +0900)
committerSangYong Lee <sangyongim.lee@samsung.com>
Thu, 9 May 2013 11:03:05 +0000 (20:03 +0900)
Change-Id: I24bbd4d1a5a60a22496e7a2c45da3de81ba54e98
Signed-off-by: SangYong Lee <sangyongim.lee@samsung.com>
src/ui/controls/FUiCtrl_TableViewPresenter.cpp
src/ui/inc/FUiCtrl_TableViewPresenter.h

index e870741..dcea623 100644 (file)
@@ -1673,6 +1673,8 @@ _TableViewPresenter::OnBoundsChanged(void)
 
        if (__pProviderAdaptor != null && __modelInitialized)
        {
+               StopExpandCollapseAnimation();
+
                if (__pTableView->IsReorderModeEnabled() && __reorderInfo.itemIndex != -1)
                {
                        ResetReorderItem(__reorderInfo.groupIndex, __reorderInfo.itemIndex);
@@ -1849,22 +1851,7 @@ _TableViewPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& to
 
        __sweepOccured = false;
 
-       _VisualElement* pVisualElement = __pTableView->GetVisualElement();
-       String animationName(L"EXPAND_GROUP_ANIMATION");
-       VisualElementValueAnimation* pExpandGroupAnimation = dynamic_cast<VisualElementValueAnimation*>(pVisualElement->GetAnimationN(animationName));
-       if (pExpandGroupAnimation != null)
-       {
-               pVisualElement->RemoveAnimation(animationName);
-               delete pExpandGroupAnimation;
-       }
-
-       animationName = L"COLLAPSE_GROUP_ANIMATION";
-       VisualElementValueAnimation* pCollapseGroupAnimation = dynamic_cast<VisualElementValueAnimation*>(pVisualElement->GetAnimationN(animationName));
-       if (pCollapseGroupAnimation != null)
-       {
-               pVisualElement->RemoveAnimation(animationName);
-               delete pCollapseGroupAnimation;
-       }
+       StopExpandCollapseAnimation();
 
        return _ScrollPanelPresenter::OnTouchPressed(source, touchInfo);
 }
@@ -2719,6 +2706,27 @@ _TableViewPresenter::IsGroupExpanded(int groupIndex) const
        return __pListModel->IsGroupExpanded(groupIndex);
 }
 
+void
+_TableViewPresenter::StopExpandCollapseAnimation(void)
+{
+       _VisualElement* pVisualElement = __pTableView->GetVisualElement();
+       String animationName(L"EXPAND_GROUP_ANIMATION");
+       VisualElementValueAnimation* pExpandGroupAnimation = dynamic_cast<VisualElementValueAnimation*>(pVisualElement->GetAnimationN(animationName));
+       if (pExpandGroupAnimation != null)
+       {
+               pVisualElement->RemoveAnimation(animationName);
+               delete pExpandGroupAnimation;
+       }
+
+       animationName = L"COLLAPSE_GROUP_ANIMATION";
+       VisualElementValueAnimation* pCollapseGroupAnimation = dynamic_cast<VisualElementValueAnimation*>(pVisualElement->GetAnimationN(animationName));
+       if (pCollapseGroupAnimation != null)
+       {
+               pVisualElement->RemoveAnimation(animationName);
+               delete pCollapseGroupAnimation;
+       }
+}
+
 int
 _TableViewPresenter::LoadAllItemsInGroup(int groupIndex, bool downward)
 {
index 75e651f..205f5f8 100644 (file)
@@ -238,6 +238,7 @@ public:
        result ExpandGroup(int groupIndex, bool withAnimation);
        result CollapseGroup(int groupIndex, bool withAnimation);
        bool IsGroupExpanded(int groupIndex) const;
+       void StopExpandCollapseAnimation(void);
 
        result SetReorderMode(bool enabled);