From 6d48a5dc19d712e599c4b32eda1f4c374dcbe90b Mon Sep 17 00:00:00 2001 From: SangYong Lee Date: Mon, 6 May 2013 21:26:44 +0900 Subject: [PATCH] Added stop expand/collapse animation in OnBoundsChanged Change-Id: I24bbd4d1a5a60a22496e7a2c45da3de81ba54e98 Signed-off-by: SangYong Lee --- src/ui/controls/FUiCtrl_TableViewPresenter.cpp | 40 +++++++++++++++----------- src/ui/inc/FUiCtrl_TableViewPresenter.h | 1 + 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp index e870741..dcea623 100644 --- a/src/ui/controls/FUiCtrl_TableViewPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TableViewPresenter.cpp @@ -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(pVisualElement->GetAnimationN(animationName)); - if (pExpandGroupAnimation != null) - { - pVisualElement->RemoveAnimation(animationName); - delete pExpandGroupAnimation; - } - - animationName = L"COLLAPSE_GROUP_ANIMATION"; - VisualElementValueAnimation* pCollapseGroupAnimation = dynamic_cast(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(pVisualElement->GetAnimationN(animationName)); + if (pExpandGroupAnimation != null) + { + pVisualElement->RemoveAnimation(animationName); + delete pExpandGroupAnimation; + } + + animationName = L"COLLAPSE_GROUP_ANIMATION"; + VisualElementValueAnimation* pCollapseGroupAnimation = dynamic_cast(pVisualElement->GetAnimationN(animationName)); + if (pCollapseGroupAnimation != null) + { + pVisualElement->RemoveAnimation(animationName); + delete pCollapseGroupAnimation; + } +} + int _TableViewPresenter::LoadAllItemsInGroup(int groupIndex, bool downward) { diff --git a/src/ui/inc/FUiCtrl_TableViewPresenter.h b/src/ui/inc/FUiCtrl_TableViewPresenter.h index 75e651f..205f5f8 100644 --- a/src/ui/inc/FUiCtrl_TableViewPresenter.h +++ b/src/ui/inc/FUiCtrl_TableViewPresenter.h @@ -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); -- 2.7.4