Fixed reordering mode error when calling in OnTouchLongPressed
authorSangYong Lee <sangyongim.lee@samsung.com>
Sun, 7 Apr 2013 09:18:56 +0000 (18:18 +0900)
committerSangYong Lee <sangyongim.lee@samsung.com>
Sun, 7 Apr 2013 09:18:56 +0000 (18:18 +0900)
Change-Id: Ibdd8b4a61ddd96db6a7f50474b8b8735ba7269cd
Signed-off-by: SangYong Lee <sangyongim.lee@samsung.com>
src/ui/controls/FUiCtrl_TableViewPresenter.cpp
src/ui/inc/FUiCtrl_TableViewPresenter.h

index 04e5946..30e729a 100644 (file)
@@ -1679,7 +1679,7 @@ _TableViewPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchI
        {
                __firstTouchMoved = true;
 
-               if (SelectReorderItem(itemPos.groupIndex, itemPos.itemIndex))
+               if (SelectReorderItem(itemPos.groupIndex, itemPos.itemIndex, false))
                {
                        __reorderInfo.touchPressedPositionY = touchInfo.GetCurrentPosition().y;
                }
@@ -3803,12 +3803,10 @@ _TableViewPresenter::SetReorderMode(bool enabled)
                        {
                                if (pItem->GetDrawingStatus() == TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED)
                                {
-                                       if (SelectReorderItem(itemPos.groupIndex, itemPos.itemIndex))
+                                       if (SelectReorderItem(itemPos.groupIndex, itemPos.itemIndex, true))
                                        {
                                                FloatPoint itemPosition = pItem->GetPositionF();
-                                               // +++ check floating
-                                               //FloatPoint touchPosition = pItem->GetLastTouchPressedPosition();
-                                               FloatPoint touchPosition = _CoordinateSystemUtils::ConvertToFloat(pItem->GetLastTouchPressedPosition());
+                                               FloatPoint touchPosition = pItem->GetLastTouchPressedPositionF();
 
                                                __reorderInfo.touchPressedPositionY = itemPosition.y + touchPosition.y - GetScrollPosition();
                                                __reorderInfo.blockedTouchReleaseState = true;
@@ -3828,9 +3826,9 @@ _TableViewPresenter::SetReorderMode(bool enabled)
 }
 
 bool
-_TableViewPresenter::SelectReorderItem(int groupIndex, int itemIndex)
+_TableViewPresenter::SelectReorderItem(int groupIndex, int itemIndex, bool directSelection)
 {
-       if (itemIndex == -1 || GetPressedItemCount() > 0)
+       if (itemIndex == -1 || (!directSelection && GetPressedItemCount() > 0))
        {
                return false;
        }
index 6e7d20d..0c752df 100644 (file)
@@ -299,7 +299,7 @@ private:
        void UnloadInvisibleItems(void);
 
        // reordering
-       bool SelectReorderItem(int groupIndex, int itemIndex);
+       bool SelectReorderItem(int groupIndex, int itemIndex, bool directSelection);
        bool ResetReorderItem(int groupIndex, int itemIndex);
        bool DragSelectedItem(float distance, bool relativeCoordinate);
        bool CheckReorderItemScrollAnimation(_TableViewItem *pItem);