}
/**
- * Retrieve the resize animation in the layout.
- *
- * @param[in] animation The resize animation, not owned by the layout
- * @param[in] actor The actor to animate
- * @param [in] size The target size.
- * @param [in] durationSeconds The duration of the resizing.
- */
- virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
- {
- }
-
- /**
* @brief Query the scroll direction of the layout.
* @return The scroll direction in degrees.
*/
itemSize.width = itemSize.height = itemSize.depth = ( IsVertical( GetOrientation() ) ? layoutSize.width : layoutSize.height ) / static_cast<float>( mImpl->mNumberOfColumns + 1 );
}
-void DepthLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
- if(animation)
- {
- animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
- }
-}
-
Degree DepthLayout::GetScrollDirection() const
{
Degree scrollDirection(0.0f);
virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
/**
- * @copydoc ItemLayout::GetResizeAnimation()
- */
- virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
-
- /**
* @copydoc ItemLayout::GetScrollDirection()
*/
virtual Degree GetScrollDirection() const;
itemSize.height = itemSize.depth = itemSize.width * 0.75f;
}
-void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
- if(animation)
- {
- Vector3 currentSize( actor.GetCurrentSize() );
- Vector3 shrink( currentSize );
-
- shrink.width = std::min(size.width, currentSize.width);
- shrink.height = std::min(size.height, currentSize.height);
-
- // Do a nonlinear size animation to shrink the actor first when the actor size changes,
- // so that we can avoid the actors overlapping during orientation change.
- animation.AnimateTo( Property( actor, Actor::Property::SIZE ), shrink, AlphaFunction::EASE_OUT, TimePeriod( 0.0f, durationSeconds * 0.5f ) );
- animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunction::EASE_IN, TimePeriod( 0.0f, durationSeconds ) );
- }
-}
-
Degree GridLayout::GetScrollDirection() const
{
Degree scrollDirection(0.0f);
virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
/**
- * @copydoc ItemLayout::GetResizeAnimation()
- */
- virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
-
- /**
* @copydoc ItemLayout::GetScrollDirection()
*/
virtual Degree GetScrollDirection() const;
itemSize.height = itemSize.depth = ( itemSize.width / 4.0f ) * 3.0f;
}
-void SpiralLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
- if(animation)
- {
- animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
- }
-}
-
Degree SpiralLayout::GetScrollDirection() const
{
Degree scrollDirection(0);
virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
/**
- * @copydoc ItemLayout::GetResizeAnimation()
- */
- virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
-
- /**
* @copydoc ItemLayout::GetScrollDirection()
*/
virtual Degree GetScrollDirection() const;
virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const = 0;
/**
- * @brief Retrieve the resize animation in the layout.
- *
- * @note This allows the layout to provide its own resize animation.
- * @param[in] animation The resize animation, not owned by the layout
- * @param[in] actor The actor to animate
- * @param [in] size The target size.
- * @param [in] durationSeconds The duration of the resizing.
- */
- virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const = 0;
-
- /**
* @brief Query the scroll direction of the layout.
*
* When an input gesture follows this direction, the layout-position of items will be increased.