Modify for N-SE_43592 and Apply Show Scollbar/Overscroll to apply same concept as...
authorwonyoung12.lee <wonyoung12.lee@samsung.com>
Wed, 3 Jul 2013 08:21:04 +0000 (17:21 +0900)
committerwonyoung12.lee <wonyoung12.lee@samsung.com>
Thu, 4 Jul 2013 05:01:11 +0000 (14:01 +0900)
Change-Id: Ibd02083da636a531c6a37aee92d5a7ddec3fa55f
Signed-off-by: wonyoung12.lee <wonyoung12.lee@samsung.com>
src/ui/controls/FUiCtrl_IconListItem.cpp
src/ui/controls/FUiCtrl_IconListPresenter.cpp
src/ui/inc/FUiCtrl_IconListPresenter.h

index 5a34659..e0043ed 100644 (file)
@@ -1061,13 +1061,17 @@ _IconListItem::SetItemAccessibilityElement(FloatRectangle& rect, int itemIndex,
                }
 
                __pAccessibilityElement->Activate(true);
-               if(IsChecked())
+               if (IsChecked())
                {
-               __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_SELECTED_T_TTS");
+                       __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_SELECTED_T_TTS");
                }
                __pAccessibilityElement->SetName(L"IconListViewItem" + Integer::ToString(itemIndex + 1));
                __pAccessibilityElement->SetLabel(GetText());
-               __pAccessibilityElement->SetBounds(rect);
+
+               if (__pAccessibilityElement->GetBounds() != rect)
+               {
+                       __pAccessibilityElement->SetBounds(rect);
+               }
        }
 
        return __pAccessibilityElement;
index fa10187..67a35fa 100644 (file)
@@ -104,6 +104,7 @@ _IconListPresenter::_IconListPresenter(_IconListView* pIconListView, _ListViewMo
        , __pMagneticScrollTimer(null)
        , __pAnimationTimer(null)
        , __pRunningAnimationCheckTimer(null)
+       , __pFirstShowScrollTimer(null)
        , __magneticScrollAnimation()
        , __isTouchAnimationEnabled(true)
        , __previousTouchAnimatinEnabled(true)
@@ -147,6 +148,7 @@ _IconListPresenter::_IconListPresenter(_IconListView* pIconListView, _ListViewMo
        , __runningAnimationBackupIndex(INVALID_INDEX)
        , __lazyDecodeBackGroundBitmap(false)
        , __lazyDecodeEmptyListBitmap(false)
+       , __needSetAccessibility(false)
 {
 }
 
@@ -215,6 +217,9 @@ _IconListPresenter::Dispose(void)
        delete __pRunningAnimationCheckTimer;
        __pRunningAnimationCheckTimer = null;
 
+       delete __pFirstShowScrollTimer;
+       __pFirstShowScrollTimer = null;
+
        if (__pRemoveItemVE != null)
        {
                __pRemoveItemVE->Destroy();
@@ -917,9 +922,15 @@ _IconListPresenter::RefreshList(int index, ListRefreshType type)
                _IconListItem* pItem = dynamic_cast <_IconListItem*>(__pItemProviderAdaptor->LoadItem(DEFAULT_GROUP_INDEX, index));
                SysTryReturn(NID_UI_CTRL, (pItem != null), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
+               if (pItem->GetItemAccessibilityElement() != null && pItem->GetItemAccessibilityElement()->IsActivated())
+               {
+                       pItem->GetItemAccessibilityElement()->Activate(false);
+               }
+
                r = SetItemAt(index, pItem);
                SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+               __needSetAccessibility = true;
                RedrawItem(index);
                return r;
        }
@@ -999,6 +1010,20 @@ _IconListPresenter::UpdateList(void)
        ResetAnimationTimer();
        StopAllAnimations();
 
+       _AccessibilityContainer* pContainer = __pIconListView->GetAccessibilityContainer();
+       int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX);
+       if (_AccessibilityManager::IsActivated() && (pContainer != null) && itemCount > 0)
+       {
+               for (int index = 0; index < itemCount; index++)
+               {
+                       _IconListItem* pItem = dynamic_cast <_IconListItem*>(__pItemProviderAdaptor->LoadItem(DEFAULT_GROUP_INDEX, index));
+                       if (pItem->GetItemAccessibilityElement() != null)
+                       {
+                               pItem->GetItemAccessibilityElement()->Activate(false);
+                       }
+               }
+       }
+
        result r = RemoveAllItems();
        SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1462,7 +1487,9 @@ _IconListPresenter::Draw(void)
                        pScroll->GetScrollRange(&scrollViewRange, &scrollRange);
                        if (!_FloatCompareGE(scrollViewRange, scrollRange))
                        {
-                               ScrollFadeOut();
+                               pScroll->SetScrollVisibility(true);
+                               pScroll->SetScrollingEffectVisibility(true);
+                               StartFirstShowScrollTimer();
                        }
                }
        }
@@ -2185,6 +2212,17 @@ _IconListPresenter::RedrawItem(int index, bool drawFocusUi, bool doShow)
                pItem->DrawItem(itemRect, LIST_ITEM_STATE_NORMAL);
        }
 
+       if (_AccessibilityManager::IsActivated())
+       {
+               _AccessibilityElement* pAccessibilityElement = pItem->GetItemAccessibilityElement();
+               if (pAccessibilityElement->GetParent() == null && __needSetAccessibility)
+               {
+                       pItem->SetItemAccessibilityElement(itemRect, index);
+                       SetAccessibilityElement(index, pItem);
+                       __needSetAccessibility = false;
+               }
+       }
+
        _VisualElement* pBase = pItem->GetVisualElement();
        pBase->InvalidateRectangle(&itemRect);
        pBase->Draw();
@@ -2730,6 +2768,45 @@ _IconListPresenter::ResetRunningAnimationCheckTimer(void)
        return E_SUCCESS;
 }
 
+result
+_IconListPresenter::StartFirstShowScrollTimer(void)
+{
+       result r = E_SUCCESS;
+
+       if (__pFirstShowScrollTimer == null)
+       {
+               __pFirstShowScrollTimer = new (std::nothrow) Timer;
+               SysTryReturn(NID_UI_CTRL, (__pFirstShowScrollTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+               r = __pFirstShowScrollTimer->Construct(*this);
+               SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+       else
+       {
+               __pFirstShowScrollTimer->Cancel();
+       }
+
+       r = __pFirstShowScrollTimer->Start(1000);
+       SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return r;
+
+CATCH:
+       ResetFirstShowScrollTimer();
+       return r;
+
+}
+
+result
+_IconListPresenter::ResetFirstShowScrollTimer(void)
+{
+       delete __pFirstShowScrollTimer;
+       __pFirstShowScrollTimer = null;
+
+       return E_SUCCESS;
+}
+
+
 // Tizen::Ui::_ControlImpl
 void
 _IconListPresenter::OnBoundsChanged(void)
@@ -3396,6 +3473,11 @@ _IconListPresenter::OnTimerExpired(Timer& timer)
                        StartRunningAnimationCheckTimer();
                }
        }
+       else if (&timer == __pFirstShowScrollTimer)
+       {
+               ScrollFadeOut();
+               ResetFirstShowScrollTimer();
+       }
 }
 
 void
@@ -3796,7 +3878,6 @@ _IconListPresenter::RequestToDrawAccessibilityFocusUi(void)
                        {
                                pItem->GetItemAccessibilityElement()->Activate(false);
                        }
-
                }
 
                for (int i = __lastDrawnIndex+1; i <= lastLoadedItemIndex; i++)
@@ -3808,7 +3889,6 @@ _IconListPresenter::RequestToDrawAccessibilityFocusUi(void)
                        {
                                pItem->GetItemAccessibilityElement()->Activate(false);
                        }
-
                }
 
                // set dummy AccessibilityElement
@@ -3816,6 +3896,7 @@ _IconListPresenter::RequestToDrawAccessibilityFocusUi(void)
                MakeDummyAccessibilityElement((__lastDrawnIndex + 1), false);
 
                _AccessibilityManager::GetInstance()->RequestToDrawFocusUi();
+
                __RequestToDrawAccessibilityFocusUi = false;
 
                // for change GestureMode of _AccessibilityManager
index 6297db7..50f5265 100644 (file)
@@ -349,6 +349,9 @@ private:
        result StartRunningAnimationCheckTimer(void);
        result ResetRunningAnimationCheckTimer(void);
 
+       result StartFirstShowScrollTimer(void);
+       result ResetFirstShowScrollTimer(void);
+
        void StartSelectAnimation(int index);
        void StartCheckAnimation(int index);
        result DrawCheckAnimation(int index);
@@ -426,6 +429,7 @@ private:
        Tizen::Base::Runtime::Timer* __pMagneticScrollTimer;
        Tizen::Base::Runtime::Timer* __pAnimationTimer;
        Tizen::Base::Runtime::Timer* __pRunningAnimationCheckTimer;
+       Tizen::Base::Runtime::Timer* __pFirstShowScrollTimer;
        _IconListUtils::MagneticScrollAnimation __magneticScrollAnimation;
        bool __isTouchAnimationEnabled;
        bool __previousTouchAnimatinEnabled;
@@ -475,6 +479,7 @@ private:
        int __runningAnimationBackupIndex;
        bool __lazyDecodeBackGroundBitmap;
        bool __lazyDecodeEmptyListBitmap;
+       bool __needSetAccessibility;
 }; // _IconListPresenter
 
 }}} // Tizen::Ui::Controls