Revert "[3.0] Patch to synchronize with bug fixes done in Tizen 2.4 MCD branch." 37/97737/1
authordongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 02:40:52 +0000 (11:40 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 02:40:55 +0000 (11:40 +0900)
This reverts commit 80536af2195a6e4efbccfa39849f5e5a23553a65.

Change-Id: I1a1f39cfb8b50fd4182451ee8c7afa72ad8a03d7

automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp

index fdef315..d5c6af5 100644 (file)
@@ -50,7 +50,6 @@ const int RENDER_FRAME_INTERVAL = 16;                     ///< Duration of each
 
 static bool gObjectCreatedCallBackCalled;
 static bool gOnLayoutActivatedCalled;                     ///< Whether the LayoutActivated signal was invoked.
-static bool gOnScrollUpdateCalled;
 
 static void TestCallback(BaseHandle handle)
 {
@@ -62,11 +61,6 @@ static void OnLayoutActivated()
   gOnLayoutActivatedCalled = true;
 }
 
-static void OnScrollUpdate( const Vector2& position )
-{
-  gOnScrollUpdateCalled = true;
-}
-
 // Generate a PanGestureEvent to send to Core
 Integration::PanGestureEvent GeneratePan(
     Gesture::State state,
@@ -1108,44 +1102,3 @@ int UtcDaliItemViewOvershootHorizontal(void)
 
   END_TEST;
 }
-
-int UtcDaliItemEnableDisableRefresh(void)
-{
-  ToolkitTestApplication application;
-  Dali::Stage stage = Dali::Stage::GetCurrent();
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-
-  // Create a grid layout and add it to ItemView
-  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
-  view.AddLayout(*gridLayout);
-  stage.Add(view);
-
-  // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(stage.GetSize());
-  view.ActivateLayout(0, stageSize, 0.5f);
-
-  //Connect to signal scroll updated
-  view.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
-
-  Property::Map attributes;
-  view.DoAction("enableRefresh", attributes );
-  gOnScrollUpdateCalled = true;
-  view.SetProperty( ItemView::Property::LAYOUT_POSITION, 100.0f );
-  application.SendNotification();
-  application.Render(1000);
-  DALI_TEST_EQUALS( gOnScrollUpdateCalled, true, TEST_LOCATION );
-
-
-  view.DoAction("disableRefresh", attributes );
-  gOnScrollUpdateCalled = false;
-  view.SetProperty( ItemView::Property::LAYOUT_POSITION, 100.0f );
-  application.SendNotification();
-  application.Render(1000);
-
-  DALI_TEST_EQUALS( gOnScrollUpdateCalled, false, TEST_LOCATION );
-
-  END_TEST;
-}
index 883aacc..3b4038e 100644 (file)
@@ -439,7 +439,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP(void)
 
   scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DirectionBiasLeft, Dali::Toolkit::DirectionBiasLeft );
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2::ZERO, TEST_LOCATION );
 
   scrollView.ScrollTo( target, 0.0f );
   Wait(application, RENDER_DELAY_SCROLL);
@@ -508,7 +508,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP(v
 
   scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DirectionBiasLeft, Dali::Toolkit::DirectionBiasLeft );
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2::ZERO, TEST_LOCATION );
 
   scrollView.ScrollTo( target, 0.0f );
   Wait(application, RENDER_DELAY_SCROLL);
index c8bb12f..b7c1e57 100644 (file)
@@ -262,9 +262,6 @@ DALI_SIGNAL_REGISTRATION(              Toolkit, ItemView, "layoutActivated",
 
 DALI_ACTION_REGISTRATION(              Toolkit, ItemView, "stopScrolling",       ACTION_STOP_SCROLLING   )
 
-DALI_ACTION_REGISTRATION(              Toolkit, ItemView, "enableRefresh",       ACTION_ENABLE_REFRESH   )
-DALI_ACTION_REGISTRATION(              Toolkit, ItemView, "disableRefresh",      ACTION_DISABLE_REFRESH  )
-
 DALI_TYPE_REGISTRATION_END()
 
 bool FindById( const ItemContainer& items, ItemId id )
@@ -320,7 +317,6 @@ ItemView::ItemView(ItemFactory& factory)
   mIsFlicking(false),
   mAddingItems(false),
   mRefreshEnabled(true),
-  mRefreshNotificationEnabled(true),
   mInAnimation(false)
 {
 }
@@ -478,17 +474,14 @@ void ItemView::DeactivateCurrentLayout()
 
 void ItemView::OnRefreshNotification(PropertyNotification& source)
 {
-  if( mRefreshNotificationEnabled )
+  // Cancel scroll animation to prevent any fighting of setting the scroll position property by scroll bar during fast scroll.
+  if(!mRefreshEnabled && mScrollAnimation)
   {
-    // Cancel scroll animation to prevent any fighting of setting the scroll position property by scroll bar during fast scroll.
-    if(!mRefreshEnabled && mScrollAnimation)
-    {
-      RemoveAnimation(mScrollAnimation);
-    }
-
-    // Only cache extra items when it is not a fast scroll
-    DoRefresh(GetCurrentLayoutPosition(0), mRefreshEnabled || mScrollAnimation);
+    RemoveAnimation(mScrollAnimation);
   }
+
+  // Only cache extra items when it is not a fast scroll
+  DoRefresh(GetCurrentLayoutPosition(0), mRefreshEnabled || mScrollAnimation);
 }
 
 void ItemView::Refresh()
@@ -1790,14 +1783,6 @@ bool ItemView::DoAction( BaseObject* object, const std::string& actionName, cons
   {
     GetImpl( itemView ).DoStopScrolling();
   }
-  else if ( 0 == strcmp( actionName.c_str(), ACTION_ENABLE_REFRESH ) )
-  {
-    GetImpl( itemView ).SetRefreshNotificationEnabled( true );
-  }
-  else if ( 0 == strcmp( actionName.c_str(), ACTION_DISABLE_REFRESH ) )
-  {
-    GetImpl( itemView ).SetRefreshNotificationEnabled( false );
-  }
 
   return true;
 }
@@ -1811,11 +1796,6 @@ void ItemView::DoStopScrolling()
   }
 }
 
-void ItemView::SetRefreshNotificationEnabled( bool enabled )
-{
-  mRefreshNotificationEnabled = enabled;
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index 6ed616d..5ae0112 100644 (file)
@@ -335,12 +335,6 @@ public:
    */
   void DoStopScrolling();
 
-  /**
-   * Helper for DoAction( ACTION_ENABLE/DISABLE_REFRESH_NOTIFICATIONS ).
-   * @param[in] enabled Whether to disable refresh notifications or not.
-   */
-  void SetRefreshNotificationEnabled( bool enabled );
-
 private:
 
   /**
@@ -625,7 +619,6 @@ private:
   bool mIsFlicking                      : 1;
   bool mAddingItems                     : 1;
   bool mRefreshEnabled                  : 1;        ///< Whether to refresh the cache automatically
-  bool mRefreshNotificationEnabled      : 1;        ///< Whether to disable refresh notifications or not.
   bool mInAnimation                     : 1;        ///< Keeps track of whether an animation is controlling the overshoot property.
 };
 
index 67ce127..1d53111 100644 (file)
@@ -1693,7 +1693,6 @@ bool ScrollView::AnimateTo(const Vector2& position, const Vector2& positionDurat
   // Position Delta ///////////////////////////////////////////////////////
   if(positionChanged)
   {
-    UpdateMainInternalConstraint();
     if(mWrapMode && findShortcuts)
     {
       // In Wrap Mode, the shortest distance is a little less intuitive...