Fix ItemView insert/remove when outside the current visible range
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / item-view / item-view-impl.h
index 164bd8c..51bb3ae 100644 (file)
@@ -19,7 +19,9 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/dali.h>
+#include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/object/property-notification.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -99,16 +101,6 @@ public:
   void ActivateLayout(unsigned int layoutIndex, const Vector3& targetSize, float durationSeconds);
 
   /**
-   * @copydoc Toolkit::ItemView::SetDefaultAlphaFunction
-   */
-  void SetDefaultAlphaFunction(AlphaFunction func);
-
-  /**
-   * @copydoc Toolkit::ItemView::GetDefaultAlphaFunction
-   */
-  AlphaFunction GetDefaultAlphaFunction() const;
-
-  /**
    * @copydoc Toolkit::ItemView::DeactivateCurrentLayout
    */
   void DeactivateCurrentLayout();
@@ -297,7 +289,7 @@ private:
   /**
    * Remove an Actor if found in the ItemPool.
    * @param[in] itemId The item to remove.
-   * @return True if an actor was removed.
+   * @return True if the remaining actors were reordered.
    */
   bool RemoveActor( unsigned int itemId );
 
@@ -407,6 +399,11 @@ private:
   void ReapplyAllConstraints( float durationSeconds );
 
   /**
+   * Helper to relayout after item(s) are removed.
+   */
+  void OnItemsRemoved();
+
+  /**
    * Helper to remove items outside a given range.
    * @param[in] range The range of required items.
    */
@@ -452,7 +449,7 @@ private:
    *
    * @param[in] gesture The gesture event.
    */
-  void OnPan(PanGesture pan);
+  void OnPan( const PanGesture& pan );
 
   /**
    * Helper to handle anchoring animations.
@@ -558,8 +555,6 @@ private:
   ItemLayout* mActiveLayout;
   Vector3 mActiveLayoutTargetSize;
 
-  AlphaFunction mDefaultAlphaFunction;
-
   Animation mResizeAnimation;
   Animation mScrollAnimation;
   Animation mScrollOvershootAnimation;