Item selection on Touch press while Scroll - Blocked
authorSaravana Balaji <saravana.bs@samsung.com>
Sun, 7 Jul 2013 07:20:46 +0000 (12:50 +0530)
committerSaravana Balaji <saravana.bs@samsung.com>
Mon, 8 Jul 2013 12:02:03 +0000 (17:32 +0530)
Change-Id: I1390b85e18707e5f66642b4fb106a9e211677d08
Signed-off-by: Saravana Balaji <saravana.bs@samsung.com>
src/ui/controls/FUiCtrl_ListViewItem.cpp
src/ui/controls/FUiCtrl_TableViewItem.cpp
src/ui/controls/FUiCtrl_TableViewPresenter.cpp
src/ui/inc/FUiCtrl_TableViewItem.h

index b06b46b..7e45bb1 100644 (file)
@@ -1014,6 +1014,11 @@ _ListViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchinf
                return false;
        }
 
+       if (IsTouchPressOnScroll())
+       {
+               return false;
+       }
+
        ClearLastStateChangedInfo();
        StopTextSlideTimer();
 
@@ -1075,6 +1080,12 @@ _ListViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchin
                return false;
        }
 
+       if (IsTouchPressOnScroll())
+       {
+               SetTouchPressOnScroll(false);
+               return false;
+       }
+
        FloatPoint pos = touchinfo.GetCurrentPosition();
        __prevTouchPos.SetPosition(pos.x, pos.y);
 
@@ -1109,6 +1120,11 @@ _ListViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
        FloatPoint pos = touchinfo.GetCurrentPosition();
        __prevTouchPos.SetPosition(pos.x, pos.y);
 
+       if (IsTouchPressOnScroll())
+       {
+               SetTouchPressOnScroll(false);
+       }
+
        if (__touchPressed)
        {
                ClearLastStateChangedInfo();
index 78af994..16f31d1 100644 (file)
@@ -238,6 +238,7 @@ _TableViewItem::_TableViewItem(float itemHeight)
        , __isTabSoundPlayed(false)
        , __isSelectedDetailButton(false)
        , __isSimpleLastItem(false)
+       , __isTouchPressOnScroll(false)
        , __pHighlightVisualElement(null)
        , __pBitmapVisualElement(null)
        , __pMoveItemAnimation(null)
@@ -1232,6 +1233,11 @@ _TableViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchin
                return true;
        }
 
+       if (IsTouchPressOnScroll())
+       {
+               return true;
+       }
+
        __annexOnOffHandlerMoved = false;
        __touchStartPosition = touchinfo.GetCurrentPosition();
 
@@ -1293,8 +1299,14 @@ _TableViewItem::OnTouchPressed(const _Control& source, const _TouchInfo& touchin
 bool
 _TableViewItem::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
 {
-       if(IsReorderMode())
+       if (IsReorderMode())
+       {
+               return true;
+       }
+
+       if (IsTouchPressOnScroll())
        {
+               SetTouchPressOnScroll(false);
                return true;
        }
 
@@ -1483,6 +1495,11 @@ _TableViewItem::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo
                return false;
        }
 
+       if (IsTouchPressOnScroll())
+       {
+               SetTouchPressOnScroll(false);
+       }
+
        if (__isPressedTimerEnabled)
        {
                StopTouchPressedTimer();
@@ -1572,7 +1589,11 @@ _TableViewItem::OnTouchCanceled(const _Control& source, const _TouchInfo& touchi
 _UiTouchEventDelivery
 _TableViewItem::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
-
+       if (IsTouchPressOnScroll())
+       {
+               SetTouchPressOnScroll(false);
+               return _UI_TOUCH_EVENT_DELIVERY_NO;
+       }
        return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES;
 }
 
@@ -5032,5 +5053,18 @@ _TableViewItem::SetSimpleLastItemEnabled(bool enable)
 {
        __isSimpleLastItem = enable;
 }
+
+void
+_TableViewItem::SetTouchPressOnScroll(bool isTouch)
+{
+       __isTouchPressOnScroll = isTouch;
+}
+
+bool
+_TableViewItem::IsTouchPressOnScroll(void) const
+{
+       return __isTouchPressOnScroll;
+}
+
 }}} // Tizen::Ui::Controls
 
index 00e7b3e..3140a33 100644 (file)
@@ -1831,6 +1831,12 @@ _TableViewPresenter::OnPreviewTouchPressed(const _Control& source, const _TouchI
                return response;
        }
 
+       if (IsScrollAnimationRunning())
+       {
+               pItem->SetTouchPressOnScroll(true);
+               return response;
+       }
+
        if (__pTableView->IsReorderModeEnabled())
        {
                __firstTouchMoved = true;
index 01ae5a5..0935f47 100644 (file)
@@ -250,6 +250,8 @@ public:
        void FireItemTouchReleased(void);
        void FireItemTouchPressed(void);
        void SetSimpleLastItemEnabled(bool enable);
+       void SetTouchPressOnScroll(bool isTouch);
+       bool IsTouchPressOnScroll(void) const;
 
        // Accessibility
        virtual void SetAccessibilityElement(void);
@@ -457,6 +459,7 @@ private:
        bool __isTabSoundPlayed;
        bool __isSelectedDetailButton;
        bool __isSimpleLastItem;
+       bool __isTouchPressOnScroll;
 
        Tizen::Ui::Animations::_VisualElement* __pHighlightVisualElement;
        Tizen::Ui::Animations::_VisualElement* __pBitmapVisualElement;