Modify for P1300328-1966, P130312-7850 and Change using Model API
authorwonyoung12.lee <wonyoung12.lee@samsung.com>
Mon, 1 Apr 2013 08:31:02 +0000 (17:31 +0900)
committerwonyoung12.lee <wonyoung12.lee@samsung.com>
Mon, 1 Apr 2013 08:31:02 +0000 (17:31 +0900)
Change-Id: I9ade46ed4a7d5b8c028329c0ff3b8fbc4dcc6542
Signed-off-by: wonyoung12.lee <wonyoung12.lee@samsung.com>
src/ui/controls/FUiCtrl_IconListPresenter.cpp

index 0042cd5..c9ab146 100755 (executable)
@@ -2825,17 +2825,18 @@ _IconListPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
        {
                if (__selectedIndex >= 0)
                {
+                       fireIndex = __selectedIndex;
                        __isSelectionDelayed = false;
+
+                       PreDrawCheckAnimation(fireIndex);
+                       FireEventAfterTouchRelease(fireIndex);
+
                        if (__isTouchAnimationEnabled)
                        {
-                               FireEventAfterTouchRelease(__selectedIndex);
-                               StartSelectAnimation(__selectedIndex);
+                               StartSelectAnimation(fireIndex);
                        }
                        else
                        {
-                               fireIndex = __selectedIndex;
-                               PreDrawCheckAnimation(fireIndex);
-                               FireEventAfterTouchRelease(fireIndex);
                                DrawCheckAnimation(fireIndex);
                        }
                }
@@ -2843,22 +2844,21 @@ _IconListPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& to
                {
                        ResetTouchActionTimer();
                        OnTouchActionActivated(*__pIconListView, __currentTouchInfo);
+                       fireIndex = __selectedIndex;
                        __isSelectionDelayed = true;
 
+                       PreDrawCheckAnimation(fireIndex);
+                       FireEventAfterTouchRelease(fireIndex);
+
                        if (__isTouchAnimationEnabled)
                        {
-                               FireEventAfterTouchRelease(__selectedIndex);
-                               StartSelectAnimation(__selectedIndex);
+                               StartSelectAnimation(fireIndex);
                        }
                        else
                        {
-                               fireIndex = __selectedIndex;
-                               PreDrawCheckAnimation(fireIndex);
-                               FireEventAfterTouchRelease(fireIndex);
                                DrawCheckAnimation(fireIndex);
                        }
                }
-               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
        }
 
        // Trigger Magnetic Scroll Effect
@@ -2933,6 +2933,7 @@ _IconListPresenter::FireEventAfterTouchRelease(int index)
                        break;
                }
                }
+               PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
        }
 }
 
@@ -3484,29 +3485,18 @@ _IconListPresenter::OnVisualElementAnimationFinished(const VisualElementAnimatio
 
                if (!completedNormally)
                {
-                       if (__pIconListView->GetStyle() == ICON_LIST_VIEW_STYLE_MARK)
+                       if (__pIconListView->GetStyle() == ICON_LIST_VIEW_STYLE_RADIO)
                        {
-                               if (__pPreviousSelectAnimationVE == __pSelectAnimationVE)
-                               {
-                                       bool isChecked = __pListModel->IsItemChecked(DEFAULT_GROUP_INDEX, index);
-                                       __pListModel->SetItemChecked(DEFAULT_GROUP_INDEX, index, !isChecked);
-                               }
-                               else if (&target != __pPreviousSelectAnimationVE)
-                               {
-                                       bool isChecked = __pListModel->IsItemChecked(DEFAULT_GROUP_INDEX, __previousCheckIndex);
-                                       __pListModel->SetItemChecked(DEFAULT_GROUP_INDEX, index, !isChecked);
-                               }
-                               else if (&target != __pSelectAnimationVE)
+                               if (__pListModel->IsItemChecked(DEFAULT_GROUP_INDEX, index))
                                {
-                                       bool isChecked = __pListModel->IsItemChecked(DEFAULT_GROUP_INDEX, index);
-                                       __pListModel->SetItemChecked(DEFAULT_GROUP_INDEX, index, !isChecked);
+                                       __pListModel->SetItemChecked(DEFAULT_GROUP_INDEX, index, false);
+                                       RedrawItem(__checkedRadioIndex);
                                }
                        }
                        RedrawItem(index);
                }
                else
                {
-                       PreDrawCheckAnimation(index);
                        DrawCheckAnimation(index);
                }
                __isSelectAnimationRunning = false;
@@ -3802,8 +3792,6 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged)
                toIndex -= __itemCountPerAxis;
        }
 
-       _ListItemPos from = { DEFAULT_GROUP_INDEX, __reorderToIndex };
-       _ListItemPos to = { DEFAULT_GROUP_INDEX, toIndex };
        _IconListItem* pItem = null;
        _IconListItem* pTempItem = null;
        _VisualElement* pToItemVE = null;
@@ -3930,7 +3918,7 @@ _IconListPresenter::SwapReorderedItems(int toIndex, bool singleItemChanged)
                }
        }
 
-       __pListModel->MoveItem(from, to);
+       __pListModel->MoveItem(DEFAULT_GROUP_INDEX, __reorderToIndex, DEFAULT_GROUP_INDEX, toIndex);
        __reorderToIndex = toIndex;
 }
 
@@ -4470,7 +4458,7 @@ _IconListPresenter::StartCheckAnimation(int index)
        if (index <= INVALID_INDEX)
                return;
 
-       RedrawItem(index, 1.0f, false, 1.0f);
+       RedrawItem(index);
 
        _IconListItem* pItem = static_cast<_IconListItem*>(__pListModel->LoadItem(DEFAULT_GROUP_INDEX, index));
 
@@ -4521,29 +4509,30 @@ result
 _IconListPresenter::DrawCheckAnimation(int index)
 {
        result r = GetLastResult();
-       int tempIndex = index;
        __selectedIndex = INVALID_INDEX;
 
        switch (__pIconListView->GetStyle())
        {
                case ICON_LIST_VIEW_STYLE_NORMAL:
                {
-                       RedrawItem(tempIndex);
+                       RedrawItem(index);
                        break;
                }
                case ICON_LIST_VIEW_STYLE_RADIO:
                {
-                       if (tempIndex != __checkedRadioIndex)
+                       if (index != __checkedRadioIndex)
                        {
                                if (__checkedRadioIndex >= 0 && __pListModel->IsLoadedItem(DEFAULT_GROUP_INDEX, __checkedRadioIndex))
                                {
                                        r = RedrawItem(__checkedRadioIndex);
                                }
-                               __checkedIndex = tempIndex;
+                               __checkedIndex = index;
                                StartCheckAnimation(index);
                        }
                        else
-                               RedrawItem(tempIndex);
+                       {
+                               RedrawItem(index);
+                       }
                        break;
                }
                case ICON_LIST_VIEW_STYLE_MARK:
@@ -4552,18 +4541,17 @@ _IconListPresenter::DrawCheckAnimation(int index)
 
                        if (__isItemChecked)
                        {
-                               r = RedrawItem(tempIndex);
+                               r = RedrawItem(index);
                        }
                        else
                        {
-                               __checkedIndex = tempIndex;
+                               __checkedIndex = index;
                                StartCheckAnimation(index);
                        }
                        break;
                }
        }
 
-       __checkedRadioIndex = INVALID_INDEX;
        __isItemChecked = false;
 
        return r;