From 17b0a845048893fb8aadd6841c72ed51a92a90e0 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 25 Jun 2015 15:38:10 +0100 Subject: [PATCH] (ItemLayout) Remove redundant GetResizeAnimation Change-Id: I11688a480ad0a37519f3ff35ab6d943fed23cc8a --- .../src/dali-toolkit/utc-Dali-ItemLayout.cpp | 12 ------------ .../controls/scrollable/item-view/depth-layout.cpp | 8 -------- .../controls/scrollable/item-view/depth-layout.h | 5 ----- .../controls/scrollable/item-view/grid-layout.cpp | 17 ----------------- .../controls/scrollable/item-view/grid-layout.h | 5 ----- .../controls/scrollable/item-view/spiral-layout.cpp | 8 -------- .../controls/scrollable/item-view/spiral-layout.h | 5 ----- .../controls/scrollable/item-view/item-layout.h | 11 ----------- 8 files changed, 71 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp index 67a2287..68938b9 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp @@ -186,18 +186,6 @@ public: // From ItemLayout } /** - * 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. */ diff --git a/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp b/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp index 2fa572d..557a089 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp +++ b/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp @@ -418,14 +418,6 @@ void DepthLayout::GetDefaultItemSize( unsigned int itemId, const Vector3& layout itemSize.width = itemSize.height = itemSize.depth = ( IsVertical( GetOrientation() ) ? layoutSize.width : layoutSize.height ) / static_cast( 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); diff --git a/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h b/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h index c1f18f9..82ce8fc 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h +++ b/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h @@ -191,11 +191,6 @@ private: 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; diff --git a/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp b/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp index 9339f0a..e1ca4d0 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp +++ b/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp @@ -506,23 +506,6 @@ void GridLayout::GetDefaultItemSize( unsigned int itemId, const Vector3& layoutS 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); diff --git a/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h b/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h index b2b3bd9..8cbdd33 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h +++ b/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h @@ -234,11 +234,6 @@ private: 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; diff --git a/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp b/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp index 731fa90..83d2a1f 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp +++ b/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp @@ -397,14 +397,6 @@ void SpiralLayout::GetDefaultItemSize( unsigned int itemId, const Vector3& layou 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); diff --git a/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h b/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h index 326dcc7..00f550a 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h +++ b/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h @@ -164,11 +164,6 @@ private: 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; diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h index 2ed5f1e..cc1a2ae 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h @@ -244,17 +244,6 @@ public: 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. -- 2.7.4