Removed unused scroll-view effect changes
[platform/core/uifw/dali-demo.git] / demo / dali-table-view.cpp
index 5d4610b..6bb1bb7 100644 (file)
@@ -22,7 +22,6 @@
 #include <algorithm>
 #include <sstream>
 #include <unistd.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
 
 // INTERNAL INCLUDES
 #include "shared/view.h"
@@ -66,6 +65,8 @@ const float EFFECT_SNAP_DURATION = 0.66f;                       ///< Scroll Snap
 const float EFFECT_FLICK_DURATION = 0.5f;                       ///< Scroll Flick Duration for Effects
 const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f);
 
+
+
 const int NUM_BACKGROUND_IMAGES = 18;
 const float BACKGROUND_SWIPE_SCALE = 0.025f;
 const float BACKGROUND_SPREAD_SCALE = 1.5f;
@@ -81,21 +82,6 @@ const Vector4 BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 1.0f );
 const float BUBBLE_MIN_Z = -1.0;
 const float BUBBLE_MAX_Z = 0.0f;
 
-// 3D Effect constants
-const Vector2 ANGLE_SWING_3DEFFECT( Math::PI_2 * 0.75, Math::PI_2 * 0.75f ); ///< Angle Swing in radians
-const Vector2 POSITION_SWING_3DEFFECT( 0.55f, 0.4f );             ///< Position Swing relative to stage size.
-const Vector3 ANCHOR_3DEFFECT_STYLE0( -105.0f, 30.0f, -240.0f ); ///< Rotation Anchor position for 3D Effect (Style 0)
-const Vector3 ANCHOR_3DEFFECT_STYLE1( 65.0f, -70.0f, -500.0f );  ///< Rotation Anchor position for 3D Effect (Style 1)
-
-const Dali::Vector4 TABLE_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f);
-
-Vector3 ScalePointSize(const Vector3& vec)
-{
-  return Vector3( DemoHelper::ScalePointSize( vec.x ), DemoHelper::ScalePointSize( vec.y ), DemoHelper::ScalePointSize( vec.z ) );
-}
-
-#define DP(x) DemoHelper::ScalePointSize(x)
-
 /**
  * Creates the background image
  */
@@ -107,7 +93,7 @@ ImageActor CreateBackground( std::string imagePath )
   background.SetAnchorPoint( AnchorPoint::CENTER );
   background.SetParentOrigin( ParentOrigin::CENTER );
   background.SetZ( -1.0f );
-  background.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
   return background;
 }
@@ -124,27 +110,26 @@ const float IMAGE_BORDER_BOTTOM = IMAGE_BORDER_LEFT;
 struct AnimateBubbleConstraint
 {
 public:
-  AnimateBubbleConstraint( const Vector3& initialPos, float scale, float size )
+  AnimateBubbleConstraint( const Vector3& initialPos, float scale )
       : mInitialX( initialPos.x ),
-        mScale( scale ),
-        mShapeSize( size )
+        mScale( scale )
   {
   }
 
-  Vector3 operator()( const Vector3& current, const PropertyInput& scrollProperty, const PropertyInput& parentSize )
+  void operator()( Vector3& position, const PropertyInputContainer& inputs )
   {
-    Vector3 pos( current );
-    const float parentHeight = parentSize.GetVector3().height;
+    const Vector3& parentSize = inputs[1]->GetVector3();
+    const Vector3& childSize = inputs[2]->GetVector3();
 
-    // Wrap bubbles vertically
-    if( pos.y + mShapeSize * 0.5f < -parentHeight * 0.5f )
+    // Wrap bubbles verically.
+    if( position.y + childSize.y * 0.5f < -parentSize.y * 0.5f )
     {
-      pos.y = parentHeight * 0.5f + mShapeSize * 0.5f;
+      position.y = parentSize.y * 0.5f + childSize.y * 0.5f;
     }
 
-    // Bubbles X position moves parallax to horizontal panning by a scale factor unique to each bubble
-    pos.x = mInitialX + ( scrollProperty.GetVector3().x * mScale );
-    return pos;
+    // Bubbles X position moves parallax to horizontal
+    // panning by a scale factor unique to each bubble.
+    position.x = mInitialX + ( inputs[0]->GetVector2().x * mScale );
   }
 
 private:
@@ -216,9 +201,7 @@ void DaliTableView::SortAlphabetically( bool sortAlphabetically )
 
 void DaliTableView::Initialize( Application& application )
 {
-  // Provide the stylesheet
-  StyleManager styleManager = StyleManager::Get();
-  styleManager.RequestThemeChange( DALI_DEMO_THEME_PATH );
+  DemoHelper::RequestThemeChange();
 
   Stage::GetCurrent().KeyEventSignal().Connect( this, &DaliTableView::OnKeyEvent );
 
@@ -232,7 +215,7 @@ void DaliTableView::Initialize( Application& application )
   mRootActor = TableView::New( 4, 1 );
   mRootActor.SetAnchorPoint( AnchorPoint::CENTER );
   mRootActor.SetParentOrigin( ParentOrigin::CENTER );
-  mRootActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mRootActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   Stage::GetCurrent().Add( mRootActor );
 
   // Toolbar at top
@@ -248,7 +231,7 @@ void DaliTableView::Initialize( Application& application )
   // Add logo
   Dali::ImageActor logo = CreateLogo( LOGO_PATH );
   logo.SetName( "LOGO_IMAGE" );
-  logo.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+  logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   const float paddingHeight = ( ( 1.f-TABLE_RELATIVE_SIZE.y ) * stageSize.y );
   const float logoMargin = paddingHeight * LOGO_MARGIN_RATIO;
 
@@ -262,8 +245,8 @@ void DaliTableView::Initialize( Application& application )
   Alignment alignment = Alignment::New();
   alignment.SetName( "LOGO_ALIGNMENT" );
   alignment.Add( logo );
-  alignment.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-  alignment.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+  alignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+  alignment.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
   Actor alignmentActor = alignment;
   alignmentActor.SetPadding( Padding( 0.0f, 0.0f, logoMargin, logoMargin ));
   mRootActor.AddChild( alignment, TableView::CellPosition( 1, 0 ) );
@@ -271,11 +254,10 @@ void DaliTableView::Initialize( Application& application )
 
   // scrollview occupying the majority of the screen
   mScrollView = ScrollView::New();
-  mScrollView.SetRelayoutEnabled( true );
 
   mScrollView.SetAnchorPoint( AnchorPoint::CENTER );
   mScrollView.SetParentOrigin( ParentOrigin::CENTER );
-  mScrollView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   const float buttonsPageMargin = ( 1.0f - TABLE_RELATIVE_SIZE.x ) * 0.5f * stageSize.width;
   mScrollView.SetPadding( Padding( buttonsPageMargin, buttonsPageMargin, 0.0f, 0.0f ) );
 
@@ -288,22 +270,20 @@ void DaliTableView::Initialize( Application& application )
   mScrollViewLayer.SetAnchorPoint( AnchorPoint::CENTER );
   mScrollViewLayer.SetParentOrigin( ParentOrigin::CENTER );
   mScrollViewLayer.SetDrawMode( DrawMode::OVERLAY );
-  mScrollViewLayer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
   // Create solid background colour.
   ImageActor backgroundColourActor = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR );
   backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER );
   backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER );
-  backgroundColourActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-  backgroundColourActor.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  backgroundColourActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
   backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) );
   backgroundColourActor.SetZ( BACKGROUND_Z );
   mScrollViewLayer.Add( backgroundColourActor );
 
   // Populate background and bubbles - needs to be scrollViewLayer so scroll ends show
   Actor bubbleContainer = Actor::New();
-  bubbleContainer.SetRelayoutEnabled( true );
-  bubbleContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER );
   bubbleContainer.SetParentOrigin( ParentOrigin::CENTER );
   mScrollViewLayer.Add( bubbleContainer );
@@ -311,7 +291,7 @@ void DaliTableView::Initialize( Application& application )
   SetupBackground( bubbleContainer );
 
   Alignment buttonsAlignment = Alignment::New();
-  buttonsAlignment.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  buttonsAlignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   buttonsAlignment.Add( mScrollViewLayer );
 
   mScrollViewLayer.Add( mScrollView );
@@ -327,11 +307,7 @@ void DaliTableView::Initialize( Application& application )
   Populate();
 
   // Remove constraints for inner cube effect
-  ApplyCubeEffectToActors();
-
-  // Set initial orientation
-  unsigned int degrees = application.GetOrientation().GetDegrees();
-  Rotate( degrees );
+  ApplyCubeEffectToPages();
 
   Dali::Window winHandle = application.GetWindow();
   winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT );
@@ -339,7 +315,12 @@ void DaliTableView::Initialize( Application& application )
   winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE );
   winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
 
+  // Set initial orientation
   Dali::Orientation orientation = winHandle.GetOrientation();
+
+  unsigned int degrees = winHandle.GetOrientation().GetDegrees();
+  Rotate( degrees );
+
   orientation.ChangedSignal().Connect( this, &DaliTableView::OrientationChanged );
 
   winHandle.ShowIndicator( Dali::Window::INVISIBLE );
@@ -354,21 +335,14 @@ void DaliTableView::Initialize( Application& application )
   KeyboardFocusManager::Get().FocusedActorActivatedSignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
 }
 
-void DaliTableView::ApplyCubeEffectToActors()
+void DaliTableView::ApplyCubeEffectToPages()
 {
-  for( ActorIter pageIter = mPages.begin(); pageIter != mPages.end(); ++pageIter )
+  ScrollViewPagePathEffect effect = ScrollViewPagePathEffect::DownCast( mScrollViewEffect );
+  unsigned int pageCount(0);
+  for( std::vector< Actor >::iterator pageIter = mPages.begin(); pageIter != mPages.end(); ++pageIter )
   {
     Actor page = *pageIter;
-
-    for( unsigned int i = 0, numChildren = page.GetChildCount(); i < numChildren; ++i)
-    {
-      // Remove old effect's manual constraints.
-      Actor child = page.GetChildAt(i);
-      if( child )
-      {
-        ApplyCubeEffectToActor( child );
-      }
-    }
+    effect.ApplyToPage( page, pageCount++ );
   }
 }
 
@@ -400,7 +374,7 @@ void DaliTableView::Populate()
       TableView page = TableView::New( 3, 3 );
       page.SetAnchorPoint( AnchorPoint::CENTER );
       page.SetParentOrigin( ParentOrigin::CENTER );
-      page.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+      page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
       mScrollView.Add( page );
 
       // Calculate the number of images going across (columns) within a page, according to the screen resolution and dpi.
@@ -454,9 +428,9 @@ void DaliTableView::Populate()
   }
 
   // Update Ruler info.
-  mScrollRulerX = new FixedRuler( stageSize.width * TABLE_RELATIVE_SIZE.x );
+  mScrollRulerX = new FixedRuler( stageSize.width * TABLE_RELATIVE_SIZE.x * 0.5f );
   mScrollRulerY = new DefaultRuler();
-  mScrollRulerX->SetDomain( RulerDomain( 0.0f, mTotalPages * stageSize.width * TABLE_RELATIVE_SIZE.x, true ) );
+  mScrollRulerX->SetDomain( RulerDomain( 0.0f, (mTotalPages+1) * stageSize.width * TABLE_RELATIVE_SIZE.x * 0.5f, true ) );
   mScrollRulerY->Disable();
   mScrollView.SetRulerX( mScrollRulerX );
   mScrollView.SetRulerY( mScrollRulerY );
@@ -485,8 +459,8 @@ void DaliTableView::Rotate( unsigned int degrees )
   }
 
   mRotateAnimation = Animation::New( ROTATE_ANIMATION_TIME );
-  mRotateAnimation.RotateTo( mRootActor, Degree( 360 - degrees ), Vector3::ZAXIS, AlphaFunctions::EaseOut );
-  mRotateAnimation.Resize( mRootActor, targetSize, AlphaFunctions::EaseOut );
+  mRotateAnimation.AnimateTo( Property( mRootActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 - degrees ) ), Vector3::ZAXIS ), AlphaFunction::EASE_OUT );
+  mRotateAnimation.AnimateTo( Property( mRootActor, Actor::Property::SIZE ), targetSize, AlphaFunction::EASE_OUT );
   mRotateAnimation.Play();
 }
 
@@ -496,9 +470,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
   content.SetName( name );
   content.SetAnchorPoint( AnchorPoint::CENTER );
   content.SetParentOrigin( ParentOrigin::CENTER );
-  content.SetRelayoutEnabled( true );
-  content.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-  content.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  content.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
   content.SetSizeModeFactor( sizeMultiplier );
 
   // create background image
@@ -509,7 +481,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
     image.SetAnchorPoint( AnchorPoint::CENTER );
     image.SetParentOrigin( ParentOrigin::CENTER );
     // make the image 100% of tile
-    image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+    image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
     // move image back to get text appear in front
     image.SetZ( -1 );
@@ -519,7 +491,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
 
     // Add stencil
     ImageActor stencil = NewStencilImage();
-    stencil.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+    stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
     image.Add( stencil );
   }
 
@@ -530,8 +502,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit
   label.SetProperty( TextLabel::Property::TEXT, title );
   label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
-  label.SetResizePolicy( FILL_TO_PARENT, HEIGHT );
-  label.SetColor( TABLE_TEXT_STYLE_COLOR );
+  label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
   content.Add( label );
 
   // Set the tile to be keyboard focusable
@@ -600,10 +571,10 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event )
 
       // scale the content actor within the Tile, as to not affect the placement within the Table.
       Actor content = actor.GetChildAt(0);
-      mPressedAnimation.ScaleTo( content, Vector3( 0.9f, 0.9f, 1.0f ), AlphaFunctions::EaseInOut, 0.0f,
-                                 BUTTON_PRESS_ANIMATION_TIME * 0.5f );
-      mPressedAnimation.ScaleTo( content, Vector3::ONE, AlphaFunctions::EaseInOut, BUTTON_PRESS_ANIMATION_TIME * 0.5f,
-                                 BUTTON_PRESS_ANIMATION_TIME * 0.5f );
+      mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3( 0.9f, 0.9f, 1.0f ), AlphaFunction::EASE_IN_OUT,
+                                 TimePeriod( 0.0f, BUTTON_PRESS_ANIMATION_TIME * 0.5f ) );
+      mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3::ONE, AlphaFunction::EASE_IN_OUT,
+                                 TimePeriod( BUTTON_PRESS_ANIMATION_TIME * 0.5f, BUTTON_PRESS_ANIMATION_TIME * 0.5f ) );
       mPressedAnimation.Play();
       mPressedAnimation.FinishedSignal().Connect( this, &DaliTableView::OnPressedAnimationFinished );
     }
@@ -648,14 +619,14 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation& source )
   }
 }
 
-void DaliTableView::OnScrollStart( const Dali::Vector3& position )
+void DaliTableView::OnScrollStart( const Dali::Vector2& position )
 {
   mScrolling = true;
 
   PlayAnimation();
 }
 
-void DaliTableView::OnScrollComplete( const Dali::Vector3& position )
+void DaliTableView::OnScrollComplete( const Dali::Vector2& position )
 {
   mScrolling = false;
 
@@ -692,21 +663,29 @@ void DaliTableView::ApplyScrollViewEffect()
 
 void DaliTableView::SetupInnerPageCubeEffect()
 {
-  mScrollViewEffect = ScrollViewCubeEffect::New();
-  mScrollView.SetScrollSnapDuration( EFFECT_SNAP_DURATION );
-  mScrollView.SetScrollFlickDuration( EFFECT_FLICK_DURATION );
-  mScrollView.RemoveConstraintsFromChildren();
-}
+  const Vector2 stageSize = Stage::GetCurrent().GetSize();
 
-void DaliTableView::ApplyCubeEffectToActor( Actor actor )
-{
-  actor.RemoveConstraints();
+  Dali::Path path = Dali::Path::New();
+  Dali::Property::Array points;
+  points.Resize(3);
+  points[0] = Vector3( stageSize.x*0.5, 0.0f,  stageSize.x*0.5f);
+  points[1] = Vector3( 0.0f, 0.0f, 0.0f );
+  points[2] = Vector3( -stageSize.x*0.5f, 0.0f, stageSize.x*0.5f);
+  path.SetProperty( Path::Property::POINTS, points );
+
+  Dali::Property::Array controlPoints;
+  controlPoints.Resize(4);
+  controlPoints[0] = Vector3( stageSize.x*0.5f, 0.0f, stageSize.x*0.3f );
+  controlPoints[1] = Vector3( stageSize.x*0.3f, 0.0f, 0.0f );
+  controlPoints[2] = Vector3(-stageSize.x*0.3f, 0.0f, 0.0f );
+  controlPoints[3] = Vector3(-stageSize.x*0.5f, 0.0f,  stageSize.x*0.3f );
+  path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints );
 
-  ScrollViewCubeEffect cubeEffect = ScrollViewCubeEffect::DownCast(mScrollViewEffect);
-  cubeEffect.ApplyToActor( actor,
-                           ScalePointSize( ( rand() & 1 ) ? ANCHOR_3DEFFECT_STYLE0 : ANCHOR_3DEFFECT_STYLE1 ),
-                           ANGLE_SWING_3DEFFECT,
-                           POSITION_SWING_3DEFFECT * Vector2(Stage::GetCurrent().GetSize()));
+
+  mScrollViewEffect = ScrollViewPagePathEffect::New(path,
+                                                    Vector3(-1.0f,0.0f,0.0f),
+                                                    Toolkit::ScrollView::Property::SCROLL_FINAL_X,
+                                                    Vector3(stageSize.x*TABLE_RELATIVE_SIZE.x,stageSize.y*TABLE_RELATIVE_SIZE.y,0.0f),mTotalPages);
 }
 
 void DaliTableView::OnKeyEvent( const KeyEvent& event )
@@ -751,25 +730,23 @@ void DaliTableView::InitialiseBackgroundActors( Actor actor )
   {
     Actor child = actor.GetChildAt( i );
 
-    const Vector3 childSize = child.GetTargetSize();
-
     // Calculate a random position
     Vector3 childPos( Random::Range( -size.x * 0.5f * BACKGROUND_SPREAD_SCALE, size.x * 0.5f * BACKGROUND_SPREAD_SCALE ),
-                      Random::Range( -size.y * 0.5f - childSize.height, size.y * 0.5f + childSize.height ),
+                      Random::Range( -size.y, size.y ),
                       Random::Range( BUBBLE_MIN_Z, BUBBLE_MAX_Z ) );
 
     child.SetPosition( childPos );
 
     // Define bubble horizontal parallax and vertical wrapping
-    Constraint animConstraint = Constraint::New < Vector3 > ( Actor::Property::POSITION,
-      Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-      Dali::ParentSource( Dali::Actor::Property::SIZE ),
-      AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ), childSize.height ) );
-    child.ApplyConstraint( animConstraint );
+    Constraint animConstraint = Constraint::New < Vector3 > ( child, Actor::Property::POSITION, AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ) ) );
+    animConstraint.AddSource( Source( mScrollView, ScrollView::Property::SCROLL_POSITION ) );
+    animConstraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
+    animConstraint.AddSource( Dali::LocalSource( Dali::Actor::Property::SIZE ) );
+    animConstraint.Apply();
 
     // Kickoff animation
     Animation animation = Animation::New( Random::Range( 40.0f, 80.0f ) );
-    animation.MoveBy( child, Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunctions::Linear );
+    animation.AnimateBy( Property( child, Actor::Property::POSITION ), Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunction::LINEAR );
     animation.SetLooping( true );
     animation.Play();
     mBackgroundAnimations.push_back( animation );
@@ -785,7 +762,6 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage dis
     Vector4 randColour( hue, hue * 0.5, 0.0f, Random::Range( 0.3f, 0.6f ));
 
     ImageActor dfActor = ImageActor::New( distanceField );
-    dfActor.SetRelayoutEnabled( false );
     dfActor.SetSize( Vector2( randSize, randSize ) );
     dfActor.SetParentOrigin( ParentOrigin::CENTER );
 
@@ -891,7 +867,7 @@ void DaliTableView::PauseAnimation()
     {
       Animation anim = *animIter;
 
-      anim.Pause();
+      anim.Stop();
     }
 
     mBackgroundAnimsPlaying = false;
@@ -1007,16 +983,13 @@ void DaliTableView::OnLogoTapped( Dali::Actor actor, const Dali::TapGesture& tap
       mVersionPopup = Dali::Toolkit::Popup::New();
       mVersionPopup.SetParentOrigin( ParentOrigin::CENTER );
       mVersionPopup.SetAnchorPoint( AnchorPoint::CENTER );
-      mVersionPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mVersionPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+      mVersionPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
       mVersionPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
-      mVersionPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+      mVersionPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
       mVersionPopup.SetTitle( stream.str() );
       mVersionPopup.HideTail();
       mVersionPopup.OutsideTouchedSignal().Connect( this, &DaliTableView::HideVersionPopup );
       mVersionPopup.HiddenSignal().Connect( this, &DaliTableView::PopupHidden );
-
-      mVersionPopup.MarkDirtyForRelayout();
     }
 
     mVersionPopup.Show();