On released, JumpToTop event will be fired.
authorSungHee Kim <sh.victoria.kim@samsung.com>
Thu, 4 Apr 2013 11:36:16 +0000 (20:36 +0900)
committerSungHee Kim <sh.victoria.kim@samsung.com>
Thu, 4 Apr 2013 11:36:41 +0000 (20:36 +0900)
Change-Id: I6d46d971406dba638a541c32ef1e6ab502ded768
Signed-off-by: SungHee Kim <sh.victoria.kim@samsung.com>
src/ui/controls/FUiCtrl_FastScrollPresenter.cpp
src/ui/controls/FUiCtrl_Scroll.cpp
src/ui/controls/FUiCtrl_ScrollPresenter.cpp
src/ui/inc/FUiCtrl_Scroll.h
src/ui/inc/FUiCtrl_ScrollPresenter.h

index ca3dd39..69f6c9a 100755 (executable)
@@ -1072,14 +1072,14 @@ _FastScrollIndexView::DrawSelectedIndex()
                pCanvas->DrawLine(FloatPoint(0.0f, outlineBounds.height), FloatPoint(outlineBounds.width, outlineBounds.height));
                pCanvas->DrawLine(FloatPoint(outlineBounds.width, outlineBounds.y), FloatPoint(outlineBounds.width, outlineBounds.height));
 
-               pCanvas->DrawLine(FloatPoint(0.0f, outlineBounds.height), FloatPoint(0.0f, bounds.height));
+               pCanvas->DrawLine(FloatPoint(1.0f, outlineBounds.height), FloatPoint(1.0f, bounds.height));
        }
        else if (selectedIndexOrder == childCount - 1)
        {
                pCanvas->DrawLine(FloatPoint(0.0f, outlineBounds.y), FloatPoint(outlineBounds.width, outlineBounds.y));
                pCanvas->DrawLine(FloatPoint(outlineBounds.width, outlineBounds.y), FloatPoint(outlineBounds.width, bounds.height));
 
-               pCanvas->DrawLine(FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, outlineBounds.y));
+               pCanvas->DrawLine(FloatPoint(1.0f, 0.0f), FloatPoint(1.0f, outlineBounds.y));
        }
        else if (__viewConfig.__pSelectedIndexlineBitmap)
        {
@@ -1091,8 +1091,8 @@ _FastScrollIndexView::DrawSelectedIndex()
 
                delete pReplacementColorBackgroundBitmap;
 
-               pCanvas->DrawLine(FloatPoint(0.0f, 0.0f), FloatPoint(0.0f, outlineBounds.y));
-               pCanvas->DrawLine(FloatPoint(0.0f, (outlineBounds.y + outlineBounds.height)), FloatPoint(0.0f, bounds.height));
+               pCanvas->DrawLine(FloatPoint(1.0f, 0.0f), FloatPoint(1.0f, outlineBounds.y));
+               pCanvas->DrawLine(FloatPoint(1.0f, (outlineBounds.y + outlineBounds.height)), FloatPoint(1.0f, bounds.height));
        }
 
        //draw text
@@ -2672,7 +2672,7 @@ _FastScrollPresenter::CalculatePopupBounds(void)
        {
                popupBounds.width = parentBounds.width;
        }
-       
+
        popupBounds.height = __pViewConfig->__popupSize.height;
        if (popupBounds.height > parentBounds.height)
        {
index 8be0ef2..27e6e90 100644 (file)
@@ -300,6 +300,12 @@ _Scroll::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
        return GetPresenter().OnTouchMoved(source, touchinfo);
 }
 
+void
+_Scroll::OnTouchMoveHandled(const _Control& control)
+{
+       return GetPresenter().OnTouchMoveHandled(control);
+}
+
 HitTestResult
 _Scroll::HitTest(const Tizen::Graphics::FloatPoint& point)
 {
index 9b6a05d..68cb484 100755 (executable)
@@ -514,6 +514,12 @@ _ScrollPresenter::SetScrollVisibility(bool visibility)
                return E_SUCCESS;
        }
 
+       if (__jumpToTopPressed && visibility == false)
+       {
+               // ignore visibility off
+               return E_SUCCESS;
+       }
+
        __pCtrlVe->RemoveAllAnimations();
        if (visibility)
        {
@@ -856,6 +862,17 @@ _ScrollPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchin
        return ret;
 }
 
+void
+_ScrollPresenter::OnTouchMoveHandled(const _Control& source)
+{
+       if (__jumpToTopPressed)
+       {
+               __needUpdateJumpTopTop = true;
+               __jumpToTopPressed = false;
+               (GetControl().GetVisualElement())->InvalidateRectangle(null);
+       }
+}
+
 HitTestResult
 _ScrollPresenter::HitTest(const FloatPoint& point)
 {
@@ -2166,7 +2183,7 @@ _ScrollPresenter::DrawJumpToTop(void)
                        pButtonEfBitmap = __pButtonPressEfBitmap;
                        buttonBitmapId = L"SCROLL::BUTTON_BG_PRESSED";
                }
-               
+
                if (__jumpToTopPressed)
                {
                        isCustomBitmap = IS_CUSTOM_BITMAP(SCROLL::BUTTON_BG_PRESSED);
@@ -2175,7 +2192,7 @@ _ScrollPresenter::DrawJumpToTop(void)
                {
                        isCustomBitmap = IS_CUSTOM_BITMAP(SCROLL::BUTTON_BG_NORMAL);
                }
-               
+
                pCanvas = __pJumpToTopVe->GetCanvasN();
                SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, GetLastResult(), "Failed to get the canvas of __pJumpToTopVe");
 
@@ -2353,19 +2370,10 @@ _ScrollPresenter::OnTouchPressedJumpToTop(const _Control& source, const _TouchIn
                FloatPoint touchedPosition = touchinfo.GetCurrentPosition();
                if (jumpToTopBounds.Contains(touchedPosition))
                {
-                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
                        __needUpdateJumpTopTop = true;
                        __jumpToTopPressed = true;
+                       SetScrollVisibility(true);
                        (GetControl().GetVisualElement())->InvalidateRectangle(null);
-
-                       if (__pScrollEvent)
-                       {
-                               _UiScrollEventArg* pEventArg = _UiScrollEventArg::GetScrollJumpToTopEventArgN(*__pScrollCtrl);
-                               SysTryReturn(NID_UI_CTRL, pEventArg, true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-                               __pScrollEvent->Fire(*pEventArg);
-                       }
-
                        return true;
                }
        }
@@ -2379,10 +2387,19 @@ _ScrollPresenter::OnTouchReleasedJumpToTop(const _Control& source, const _TouchI
        if (__jumpToTopPressed)
        {
                __needUpdateJumpTopTop = true;
-       }
+               __jumpToTopPressed = false;
+               (GetControl().GetVisualElement())->InvalidateRectangle(null);
 
-       __jumpToTopPressed = false;
-       (GetControl().GetVisualElement())->InvalidateRectangle(null);
+               if (__pScrollEvent)
+               {
+                       PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+                       _UiScrollEventArg* pEventArg = _UiScrollEventArg::GetScrollJumpToTopEventArgN(*__pScrollCtrl);
+                       SysTryReturn(NID_UI_CTRL, pEventArg, true, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+                       __pScrollEvent->Fire(*pEventArg);
+                       return true;
+               }
+       }
        return false;
 }
 
@@ -2402,6 +2419,7 @@ _ScrollPresenter::OnTouchMovedJumpToTop(const _Control& source, const _TouchInfo
                        __jumpToTopPressed = false;
                        (GetControl().GetVisualElement())->InvalidateRectangle(null);
                }
+               return true;
        }
 
        return false;
index 7de13f7..0d23cb1 100644 (file)
@@ -94,6 +94,7 @@ public:
        virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
+       virtual void OnTouchMoveHandled(const _Control& control);
        virtual Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point);
 
 private:
index 18753c5..975ee3e 100644 (file)
@@ -106,6 +106,7 @@ public:
        bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
        bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
        bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
+       void OnTouchMoveHandled(const _Control& control);
        Tizen::Ui::Animations::HitTestResult HitTest(const Tizen::Graphics::FloatPoint& point);