[Issue#] N/A
[Problem] Can't customize ItemView constraint animations
[Cause] API limitations
[Solution] Added API to set the alpha function
Change-Id: I9cd7e789739916e084a6b122b871c8e33c5b4d98
Signed-off-by: Paul Wisbey <p.wisbey@samsung.com>
void DeactivateCurrentLayout();
/**
void DeactivateCurrentLayout();
/**
+ * @brief Set default the alpha function used when applying constraints e.g. during ActivateLayout().
+ *
+ * @param[in] func The default alpha function to use.
+ */
+ void SetDefaultAlphaFunction(AlphaFunction func);
+
+ /**
+ * @brief Retrieve the default alpha function for an animation.
+ *
+ * @return The default alpha function.
+ */
+ AlphaFunction GetDefaultAlphaFunction() const;
+
+ /**
* @brief Set the minimum swipe speed in pixels per second; A pan
* gesture must exceed this to trigger a swipe.
*
* @brief Set the minimum swipe speed in pixels per second; A pan
* gesture must exceed this to trigger a swipe.
*
// EXTERNAL INCLUDES
#include <algorithm>
// EXTERNAL INCLUDES
#include <algorithm>
// INTERNAL INCLUDES
#include <dali/public-api/events/mouse-wheel-event.h>
// INTERNAL INCLUDES
#include <dali/public-api/events/mouse-wheel-event.h>
: Scrollable(),
mItemFactory(factory),
mActiveLayout(NULL),
: Scrollable(),
mItemFactory(factory),
mActiveLayout(NULL),
+ mDefaultAlphaFunction(Dali::Constraint::DEFAULT_ALPHA_FUNCTION),
mAnimatingOvershootOn(false),
mAnimateOvershootOff(false),
mAnchoringEnabled(true),
mAnimatingOvershootOn(false),
mAnimateOvershootOff(false),
mAnchoringEnabled(true),
+void ItemView::SetDefaultAlphaFunction(AlphaFunction func)
+{
+ mDefaultAlphaFunction = func;
+}
+
+AlphaFunction ItemView::GetDefaultAlphaFunction() const
+{
+ return mDefaultAlphaFunction;
+}
+
bool ItemView::OnRefreshTick()
{
// Short-circuit if there is no active layout
bool ItemView::OnRefreshTick()
{
// Short-circuit if there is no active layout
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
+ constraint.SetAlphaFunction(mDefaultAlphaFunction);
actor.ApplyConstraint(constraint);
}
actor.ApplyConstraint(constraint);
}
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
+ constraint.SetAlphaFunction(mDefaultAlphaFunction);
actor.ApplyConstraint(constraint);
}
actor.ApplyConstraint(constraint);
}
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
+ constraint.SetAlphaFunction(mDefaultAlphaFunction);
actor.ApplyConstraint(constraint);
}
actor.ApplyConstraint(constraint);
}
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
+ constraint.SetAlphaFunction(mDefaultAlphaFunction);
// Release color constraints slowly; this allows ItemView to co-exist with ImageActor fade-in
constraint.SetRemoveTime(DEFAULT_COLOR_VISIBILITY_REMOVE_TIME);
// Release color constraints slowly; this allows ItemView to co-exist with ImageActor fade-in
constraint.SetRemoveTime(DEFAULT_COLOR_VISIBILITY_REMOVE_TIME);
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
ParentSource( Actor::SIZE ),
wrapped );
constraint.SetApplyTime(duration);
+ constraint.SetAlphaFunction(mDefaultAlphaFunction);
// Release visibility constraints the same time as the color constraint
constraint.SetRemoveTime(DEFAULT_COLOR_VISIBILITY_REMOVE_TIME);
// Release visibility constraints the same time as the color constraint
constraint.SetRemoveTime(DEFAULT_COLOR_VISIBILITY_REMOVE_TIME);
// EXTERNAL INCLUDES
#include <dali/dali.h>
// EXTERNAL INCLUDES
#include <dali/dali.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
void ActivateLayout(unsigned int layoutIndex, const Vector3& targetSize, float durationSeconds);
/**
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();
* @copydoc Toolkit::ItemView::DeactivateCurrentLayout
*/
void DeactivateCurrentLayout();
ItemLayout* mActiveLayout;
Vector3 mActiveLayoutTargetSize;
ItemLayout* mActiveLayout;
Vector3 mActiveLayoutTargetSize;
+ AlphaFunction mDefaultAlphaFunction;
+
Animation mResizeAnimation;
Animation mScrollAnimation;
Animation mScrollSpeedAnimation;
Animation mResizeAnimation;
Animation mScrollAnimation;
Animation mScrollSpeedAnimation;
GetImpl(*this).DeactivateCurrentLayout();
}
GetImpl(*this).DeactivateCurrentLayout();
}
+void ItemView::SetDefaultAlphaFunction(AlphaFunction func)
+{
+ GetImpl(*this).SetDefaultAlphaFunction(func);
+}
+
+AlphaFunction ItemView::GetDefaultAlphaFunction() const
+{
+ return GetImpl(*this).GetDefaultAlphaFunction();
+}
+
void ItemView::SetMinimumSwipeSpeed(float speed)
{
GetImpl(*this).SetMinimumSwipeSpeed(speed);
void ItemView::SetMinimumSwipeSpeed(float speed)
{
GetImpl(*this).SetMinimumSwipeSpeed(speed);