From: wonyoung12.lee Date: Wed, 22 May 2013 08:45:58 +0000 (+0900) Subject: Modify for N_SE-38897, Didn't work SelectAnimation when RefreshList is called continu... X-Git-Tag: accepted/tizen/20130924.144426~1^2~791^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29ca203943909f7c655d2113b1fe632fa796ca22;p=platform%2Fframework%2Fnative%2Fuifw.git Modify for N_SE-38897, Didn't work SelectAnimation when RefreshList is called continuously Change-Id: Ib031e80e9c292c75794cf974e63cc8b33a575f9b Signed-off-by: wonyoung12.lee --- diff --git a/src/ui/controls/FUiCtrl_IconListPresenter.cpp b/src/ui/controls/FUiCtrl_IconListPresenter.cpp index 0d9a128..54034e5 100644 --- a/src/ui/controls/FUiCtrl_IconListPresenter.cpp +++ b/src/ui/controls/FUiCtrl_IconListPresenter.cpp @@ -101,6 +101,7 @@ _IconListPresenter::_IconListPresenter(_IconListView* pIconListView, _ListViewMo , __pTouchActionTimer(null) , __pMagneticScrollTimer(null) , __pAnimationTimer(null) + , __pRunningAnimationCheckTimer(null) , __magneticScrollAnimation() , __isTouchAnimationEnabled(true) , __previousTouchAnimatinEnabled(true) @@ -140,6 +141,7 @@ _IconListPresenter::_IconListPresenter(_IconListView* pIconListView, _ListViewMo , __moveTransactionId(0) , __firstTouchMove(true) , __firstTouchMoveDirection(ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL) + , __runningAnimationBackupIndex(INVALID_INDEX) { } @@ -205,6 +207,9 @@ _IconListPresenter::Dispose(void) delete __pAnimationTimer; __pAnimationTimer = null; + delete __pRunningAnimationCheckTimer; + __pRunningAnimationCheckTimer = null; + if (__pRemoveItemVE != null) { __pRemoveItemVE->Destroy(); @@ -879,6 +884,12 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type) case LIST_REFRESH_TYPE_ITEM_MODIFY: { + if (__isSelectAnimationRunning && __selectedIndex == index) + { + __runningAnimationBackupIndex = index; + return StartRunningAnimationCheckTimer(); + } + if (__pListModel->IsLoadedItem(DEFAULT_GROUP_INDEX , index) == false) return r; @@ -2649,6 +2660,44 @@ _IconListPresenter::ResetAnimationTimer(void) return E_SUCCESS; } +result +_IconListPresenter::StartRunningAnimationCheckTimer(void) +{ + result r = E_SUCCESS; + + if (__pRunningAnimationCheckTimer == null) + { + __pRunningAnimationCheckTimer = new (std::nothrow) Timer; + SysTryReturn(NID_UI_CTRL, (__pRunningAnimationCheckTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + + r = __pRunningAnimationCheckTimer->Construct(*this); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + __pRunningAnimationCheckTimer->Cancel(); + } + + r = __pRunningAnimationCheckTimer->Start(10); + SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + return r; + +CATCH: + ResetRunningAnimationCheckTimer(); + return r; + +} + +result +_IconListPresenter::ResetRunningAnimationCheckTimer(void) +{ + delete __pRunningAnimationCheckTimer; + __pRunningAnimationCheckTimer = null; + + return E_SUCCESS; +} + // Tizen::Ui::_ControlImpl void _IconListPresenter::OnBoundsChanged(void) @@ -3201,6 +3250,19 @@ _IconListPresenter::OnTimerExpired(Timer& timer) AddAnimation(*pItem, index); } + else if (&timer == __pRunningAnimationCheckTimer) + { + if (!__isSelectAnimationRunning) + { + ResetRunningAnimationCheckTimer(); + RefreshList(__runningAnimationBackupIndex, LIST_REFRESH_TYPE_ITEM_MODIFY); + __runningAnimationBackupIndex = INVALID_INDEX; + } + else + { + StartRunningAnimationCheckTimer(); + } + } } void diff --git a/src/ui/inc/FUiCtrl_IconListPresenter.h b/src/ui/inc/FUiCtrl_IconListPresenter.h index d61ad4d..251b490 100644 --- a/src/ui/inc/FUiCtrl_IconListPresenter.h +++ b/src/ui/inc/FUiCtrl_IconListPresenter.h @@ -333,6 +333,9 @@ private: result StartAnimationTimer(int delay); result ResetAnimationTimer(void); + result StartRunningAnimationCheckTimer(void); + result ResetRunningAnimationCheckTimer(void); + void StartSelectAnimation(int index); void StartCheckAnimation(int index); result DrawCheckAnimation(int index); @@ -400,6 +403,7 @@ private: Tizen::Base::Runtime::Timer* __pTouchActionTimer; Tizen::Base::Runtime::Timer* __pMagneticScrollTimer; Tizen::Base::Runtime::Timer* __pAnimationTimer; + Tizen::Base::Runtime::Timer* __pRunningAnimationCheckTimer; _IconListUtils::MagneticScrollAnimation __magneticScrollAnimation; bool __isTouchAnimationEnabled; bool __previousTouchAnimatinEnabled; @@ -445,6 +449,7 @@ private: bool __firstTouchMove; IconListViewScrollDirection __firstTouchMoveDirection; + int __runningAnimationBackupIndex; }; // _IconListPresenter }}} // Tizen::Ui::Controls