Rename Eden to Focus 44/93444/3
authorUmar <m.umar@partner.samsung.com>
Mon, 24 Oct 2016 09:38:59 +0000 (10:38 +0100)
committerRichard Huang <r.huang@samsung.com>
Mon, 24 Oct 2016 12:46:32 +0000 (05:46 -0700)
Change-Id: I393ef82c0850461bee08b81f06a547ade4222b85

18 files changed:
plugins/dali-swig/examples/firstscreen/App.cs
plugins/dali-swig/examples/firstscreen/EdenData.cs [deleted file]
plugins/dali-swig/examples/firstscreen/EdenEffect.cs [deleted file]
plugins/dali-swig/examples/firstscreen/FocusData.cs [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/FocusEffect.cs [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/IEdenEffect.cs [deleted file]
plugins/dali-swig/examples/firstscreen/IFocusEffect.cs [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/ScrollContainer.cs
plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow.9.png [deleted file]
plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow_n.png [deleted file]
plugins/dali-swig/examples/firstscreen/images/edeneffect/halo.png [deleted file]
plugins/dali-swig/examples/firstscreen/images/edeneffect/horizontalFrame.png [deleted file]
plugins/dali-swig/examples/firstscreen/images/edeneffect/verticalFrame.png [deleted file]
plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow.9.png [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow_n.png [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/images/focuseffect/halo.png [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/images/focuseffect/horizontalFrame.png [new file with mode: 0644]
plugins/dali-swig/examples/firstscreen/images/focuseffect/verticalFrame.png [new file with mode: 0644]

index e96d98da604e32e160a8eb6d66e76d508bb36d5f..5f5819f1bab229867969a63c011551f26b09f033 100644 (file)
@@ -24,7 +24,7 @@ namespace FirstScreen
         private View _topContainer;
         private View _bottomContainer;
 
-        private EdenEffect _edenEffect;
+        private FocusEffect _focusEffect;
         private string _imagePath;
 
         private ImageView _keyboardFocusIndicator;
@@ -116,7 +116,7 @@ namespace FirstScreen
                     HideBottomContainer();
 
                     // Also apply Focus animation on Focused item on Poster ScrollContainer
-                    _postersContainer[_currentPostersContainerID].FocusAnimation(_edenEffect, EdenEffectDirection.BottomToTop);
+                    _postersContainer[_currentPostersContainerID].FocusAnimation(_focusEffect, FocusEffectDirection.BottomToTop);
                 }
             }
             else if (e.Direction == View.KeyboardFocus.Direction.DOWN)
@@ -130,7 +130,7 @@ namespace FirstScreen
                     _menuContainer.SetFocused(true);
 
                     // Also apply Focus animation on Focused item on Menu ScrollContainer
-                    _menuContainer.FocusAnimation(_edenEffect, EdenEffectDirection.TopToBottom);
+                    _menuContainer.FocusAnimation(_focusEffect, FocusEffectDirection.TopToBottom);
                 }
             }
             else if (e.Direction == View.KeyboardFocus.Direction.LEFT)
@@ -337,7 +337,7 @@ namespace FirstScreen
             }
 
             // Add a shadow seperator image between last Launcher icon and Menu ScrollContainer
-            _launcherSeparator = new ImageView(_imagePath + "/eden_launcher_shadow_n.png");
+            _launcherSeparator = new ImageView(_imagePath + "/focus_launcher_shadow_n.png");
             _launcherSeparator.Name = "launcherSeparator";
             _launcherSeparator.WidthResizePolicy = "USE_NATURAL_SIZE";
             _launcherSeparator.HeightResizePolicy = "FILL_TO_PARENT";
@@ -357,7 +357,7 @@ namespace FirstScreen
             _menuContainer.OffsetX = Constants.LauncherWidth;
             _menuContainer.Width = _stageSize.width - Constants.LauncherWidth;
             _menuContainer.Height = _stageSize.height * Constants.MenuContainerHeightFactor;
-            _menuContainer.ShadowBorder = new ImageView(_imagePath + "/eden_launcher_shadow.9.png");
+            _menuContainer.ShadowBorder = new ImageView(_imagePath + "/focus_launcher_shadow.9.png");
             _menuContainer.ShadowBorder.Name = "_menuContainer.ShadowBorder";
             _menuContainer.ShadowBorder.Size = new Vector3(_menuContainer.ItemSize.width + 40.0f, _menuContainer.ItemSize.height + 50.0f, 0.0f);
             _menuContainer.ShadowBorder.Position = new Vector3(0.0f, 5.0f, 0.0f);
@@ -381,7 +381,7 @@ namespace FirstScreen
 
             keyboardFocusManager.SetFocusIndicatorActor(_keyboardFocusIndicator);
 
-            _edenEffect = new EdenEffect();
+            _focusEffect = new FocusEffect();
 
             // Move Fcous to Bottom Container (Menu ScrollContainer)
             ShowBottomContainer();
diff --git a/plugins/dali-swig/examples/firstscreen/EdenData.cs b/plugins/dali-swig/examples/firstscreen/EdenData.cs
deleted file mode 100644 (file)
index 63e9dfd..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-using Dali;
-using System;
-
-namespace FirstScreen
-{
-    public class EdenData
-    {
-        private string _name;                 // Name used for EdenData object (mainly to differentiate key frame animation )
-        private string _imageName;            // Image File Name (to be loaded from disk) used for ImageView used in key frame animation
-        private Vector3 _parentOrigin;        // ParentOrigin applied to ImageView
-        private Vector3 _initSize;            // InitSize used for key frame animation
-        private Vector3 _targetSize;          // TargetSize used for key frame animation
-        private float _keyFrameStart;         // KeyFrameStart used for key frame animation
-        private float _keyFrameEnd;           // KeyFrameEnd used for key frame animation
-        private Direction _direction;         // Direction used for key frame animation
-        private ImageView _imageFocus;        // ImageView used in key frame animation
-
-        // Initialize EdenData used for key frame animation
-        public EdenData(string name, string imageName, Direction direction, Vector3 parentOrigin, Vector3 initSize,
-                        Vector3 targetSize, float keyFrameStart, float keyFrameEnd)
-        {
-            _name = name;
-            _imageName = imageName;
-            _parentOrigin = parentOrigin;
-            _initSize = initSize;
-            _targetSize = targetSize;
-            _keyFrameStart = keyFrameStart;
-            _keyFrameEnd = keyFrameEnd;
-            _direction = direction;
-
-            _imageFocus = new ImageView("./images/edeneffect/" + _imageName); // Desktop
-//            _imageFocus = new ImageView("/home/owner/apps_rw/org.tizen.firstscreen/res/images/edeneffect/" + _imageName); // Target
-
-            _imageFocus.ParentOrigin = _parentOrigin;
-            _imageFocus.AnchorPoint = NDalic.AnchorPointCenter;
-            _imageFocus.Name = _name;
-        }
-
-        public enum Direction
-        {
-            Horizontal,
-            Vertical
-        };
-
-        public Direction EdenDirection
-        {
-            get {return _direction;}
-            set {_direction = value;}
-        }
-
-        public string Name
-        {
-            get {return _name;}
-            set {_name = value;}
-        }
-
-        public string ImageName
-        {
-            get {return _imageName;}
-            set {_imageName = value;}
-        }
-
-        public Vector3 ParentOrigin
-        {
-            get
-            {
-                return _parentOrigin;
-            }
-            set
-            {
-                _parentOrigin = value;
-                _imageFocus.ParentOrigin = _parentOrigin;
-            }
-        }
-
-        public Vector3 InitSize
-        {
-            get {return _initSize;}
-            set {_initSize = value;}
-        }
-
-        public Vector3 TargetSize
-        {
-            get {return _targetSize;}
-            set {_targetSize = value;}
-        }
-
-        public float KeyFrameStart
-        {
-            get {return _keyFrameStart;}
-            set {_keyFrameStart = value;}
-        }
-
-        public float KeyFrameEnd
-        {
-            get {return _keyFrameEnd;}
-            set {_keyFrameEnd = value;}
-        }
-
-        public ImageView ImageItem
-        {
-            get {return _imageFocus;}
-        }
-    }
-}
-
diff --git a/plugins/dali-swig/examples/firstscreen/EdenEffect.cs b/plugins/dali-swig/examples/firstscreen/EdenEffect.cs
deleted file mode 100644 (file)
index 6a84a09..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-using Dali;
-using System;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-
-namespace FirstScreen
-{
-    public class EdenEffect : IEdenEffect
-    {
-        private float _frameThickness;
-        private EdenData[] _edenFocusData; // Each EdenData is used for one key frame animation (total 6 key frame animations needed for EddenEffect)
-        private Animation _animation;      // Animation used to apply all six key frame animations
-
-        public EdenEffect()
-        {
-            _frameThickness = 10.0f;
-            float _bottomFrameTime = 0.6f; // complete the halo/bottom animation 60% of the way through
-            float _sideFrameTime = 0.8f; // Start the side frame  animation after the bottom animation and complete at 80% of the way through
-            float _topFrameTime = 1.0f; // start the top frame animation after the side frame animation and complete at 100% way through
-
-            // Six key frame animations (EdenData objects) needed for EddenEffect
-            // Two key frame animations for top horizontal effect
-            // Two key frame animations for bottom horizontal effect
-            // Two key frame animations for vertical horizontal effect
-            _edenFocusData = new EdenData[6];
-
-            EdenData edenData = new EdenData("halo", "halo.png", EdenData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
-                                             new Vector3(50,20,0),  new Vector3(0.0f, 100.0f , 0.0f), 0.0f, _bottomFrameTime);
-            _edenFocusData[0] = edenData;
-
-            edenData = new EdenData("bottom", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
-                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(0.0f, _frameThickness, 0.0f), 0.0f, _bottomFrameTime);
-            _edenFocusData[1] = edenData;
-
-            edenData = new EdenData("left", "verticalFrame.png", EdenData.Direction.Vertical, NDalic.ParentOriginBottomLeft,
-                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime);
-            _edenFocusData[2] = edenData;
-
-            edenData = new EdenData("right", "verticalFrame.png", EdenData.Direction.Vertical, NDalic.ParentOriginBottomRight,
-                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime);
-            _edenFocusData[3] = edenData;
-
-            edenData = new EdenData("top-left", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginBottomLeft,
-                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(0.0f ,_frameThickness, 0.0f), _sideFrameTime, _topFrameTime);
-            _edenFocusData[4] = edenData;
-
-            edenData = new EdenData("top-right", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginBottomRight,
-                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(0.0f, _frameThickness, 0.0f), _sideFrameTime, _topFrameTime);
-            _edenFocusData[5] = edenData;
-        }
-
-        public void FocusAnimation(View parentItem, Vector3 itemSize, float duration, EdenEffectDirection direction)
-        {
-            var itemWidth = itemSize.x + _frameThickness / 2;
-            var itemHeight = itemSize.y + _frameThickness / 3;
-
-            if (_animation)
-            {
-                _animation.Clear();
-                _animation.Reset();
-            }
-            _animation = new Animation(duration);
-
-            if (direction == EdenEffectDirection.BottomToTop)
-            {
-                _edenFocusData[0].ParentOrigin = NDalic.ParentOriginBottomCenter;
-                _edenFocusData[1].ParentOrigin = NDalic.ParentOriginBottomCenter;
-                _edenFocusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
-                _edenFocusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
-                _edenFocusData[4].ParentOrigin = NDalic.ParentOriginTopLeft;
-                _edenFocusData[5].ParentOrigin = NDalic.ParentOriginTopRight;
-            }
-            else
-            {
-                _edenFocusData[0].ParentOrigin = NDalic.ParentOriginTopCenter;
-                _edenFocusData[1].ParentOrigin = NDalic.ParentOriginTopCenter;
-                _edenFocusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
-                _edenFocusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
-                _edenFocusData[4].ParentOrigin = NDalic.ParentOriginBottomLeft;
-                _edenFocusData[5].ParentOrigin = NDalic.ParentOriginBottomRight;
-            }
-
-            foreach (EdenData edenData in _edenFocusData)
-            {
-                var currentParent =  edenData.ImageItem.GetParent();
-
-                // first parent the controls
-                if (parentItem != currentParent)
-                {
-                    parentItem.Add(edenData.ImageItem);
-                }
-
-                edenData.ImageItem.Size = new Vector3(100.0f,100.0f, 0.0f);
-                parentItem.Add(edenData.ImageItem);
-
-                Vector3 targetSize = edenData.TargetSize;
-                Vector3 initSize = edenData.InitSize;
-
-                if (edenData.EdenDirection == EdenData.Direction.Horizontal)
-                {
-                    // adjust the width to match the parent
-                    targetSize.x = itemWidth;
-                }
-                else // vertical frame
-                {
-                    // adjust the height to match the parent
-                    targetSize.y = itemHeight;
-                }
-
-                // half the size for the top frame as we come out from both left / right sides
-                if (edenData.Name == "top-right" ||  edenData.Name == "top-left")
-                {
-                    targetSize.x = itemWidth - _frameThickness;
-                }
-
-                KeyFrames keyFrames = new KeyFrames();
-
-                keyFrames.Add(0.0f, new Property.Value(initSize));
-                keyFrames.Add(edenData.KeyFrameStart, new Property.Value(initSize));
-                keyFrames.Add(edenData.KeyFrameEnd, new Property.Value(targetSize));
-
-                // for halo add an extra keyframe to shrink it ( in 20% of time after it has finished)
-                if (edenData.Name =="halo")
-                {
-                    keyFrames.Add(edenData.KeyFrameEnd + 0.2f, new Property.Value(initSize));
-                }
-
-                _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.SIZE), keyFrames,
-                                          new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
-
-                // Simulate the vertical frame growing from the top.
-                // Vertical items are anchored to the bottom of the parent... so when they grow
-                // we need to move them to the middle of the parent ( otherwise they stick out the bottom)
-                if (edenData.EdenDirection == EdenData.Direction.Vertical)
-                {
-                    //animate position as well so it looks like animation is coming from bottom
-                    KeyFrames keyFramesV = new KeyFrames();
-
-                    if (direction == EdenEffectDirection.BottomToTop)
-                    {
-                        keyFramesV.Add(0.0f, new Property.Value(0.0f));
-                        keyFramesV.Add(edenData.KeyFrameStart, new Property.Value(0.0f));
-                    }
-                    else
-                    {
-                        keyFramesV.Add(0.0f, new Property.Value(-itemHeight));
-                        keyFramesV.Add(edenData.KeyFrameStart, new Property.Value(-itemHeight));
-                    }
-
-                    keyFramesV.Add(edenData.KeyFrameEnd, new Property.Value(-itemHeight / 2)); // animate to halfway up the control
-
-                    _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_Y), keyFramesV,
-                                              new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
-                }
-
-                // Simulate the top frame growing from the sides.
-                if (edenData.Name == "top-left")
-                {
-                    KeyFrames keyFramesTL = new KeyFrames();
-
-                    keyFramesTL.Add(0.0f, new Property.Value(0.0f));
-                    keyFramesTL.Add(edenData.KeyFrameStart, new Property.Value(0.0f));
-                    keyFramesTL.Add(edenData.KeyFrameEnd, new Property.Value(itemWidth / 2)); // animate to halfway up the control
-
-                    // grow these from the left or right
-                    _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_X), keyFramesTL,
-                                              new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
-                }
-
-                if (edenData.Name == "top-right")
-                {
-                    KeyFrames keyFramesTR = new KeyFrames();
-
-                    keyFramesTR.Add(0.0f, new Property.Value(0.0f));
-                    keyFramesTR.Add(edenData.KeyFrameStart, new Property.Value(0.0f));
-                    keyFramesTR.Add(edenData.KeyFrameEnd, new Property.Value(-itemWidth / 2)); // animate to halfway up the control
-
-                    // grow these from the left or right
-                    _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_X), keyFramesTR,
-                                              new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
-                }
-
-                _animation.Finished += OnAnimationFinished;
-
-                _animation.Play();
-            }
-        }
-
-        private void OnAnimationFinished(object source, Animation.FinishedEventArgs e)
-        {
-            foreach (EdenData edenData in _edenFocusData)
-            {
-                var currentParent =  edenData.ImageItem.GetParent();
-
-                if (currentParent)
-                {
-                    currentParent.Remove(edenData.ImageItem);
-                }
-            }
-        }
-    }
-}
-
diff --git a/plugins/dali-swig/examples/firstscreen/FocusData.cs b/plugins/dali-swig/examples/firstscreen/FocusData.cs
new file mode 100644 (file)
index 0000000..b1ee188
--- /dev/null
@@ -0,0 +1,106 @@
+using Dali;
+using System;
+
+namespace FirstScreen
+{
+    public class FocusData
+    {
+        private string _name;                 // Name used for FocusData object (mainly to differentiate key frame animation )
+        private string _imageName;            // Image File Name (to be loaded from disk) used for ImageView used in key frame animation
+        private Vector3 _parentOrigin;        // ParentOrigin applied to ImageView
+        private Vector3 _initSize;            // InitSize used for key frame animation
+        private Vector3 _targetSize;          // TargetSize used for key frame animation
+        private float _keyFrameStart;         // KeyFrameStart used for key frame animation
+        private float _keyFrameEnd;           // KeyFrameEnd used for key frame animation
+        private Direction _direction;         // Direction used for key frame animation
+        private ImageView _imageFocus;        // ImageView used in key frame animation
+
+        // Initialize FocusData used for key frame animation
+        public FocusData(string name, string imageName, Direction direction, Vector3 parentOrigin, Vector3 initSize,
+                        Vector3 targetSize, float keyFrameStart, float keyFrameEnd)
+        {
+            _name = name;
+            _imageName = imageName;
+            _parentOrigin = parentOrigin;
+            _initSize = initSize;
+            _targetSize = targetSize;
+            _keyFrameStart = keyFrameStart;
+            _keyFrameEnd = keyFrameEnd;
+            _direction = direction;
+
+            _imageFocus = new ImageView("./images/focuseffect/" + _imageName); // Desktop
+//            _imageFocus = new ImageView("/home/owner/apps_rw/org.tizen.firstscreen/res/images/focuseffect/" + _imageName); // Target
+
+            _imageFocus.ParentOrigin = _parentOrigin;
+            _imageFocus.AnchorPoint = NDalic.AnchorPointCenter;
+            _imageFocus.Name = _name;
+        }
+
+        public enum Direction
+        {
+            Horizontal,
+            Vertical
+        };
+
+        public Direction FocusDirection
+        {
+            get {return _direction;}
+            set {_direction = value;}
+        }
+
+        public string Name
+        {
+            get {return _name;}
+            set {_name = value;}
+        }
+
+        public string ImageName
+        {
+            get {return _imageName;}
+            set {_imageName = value;}
+        }
+
+        public Vector3 ParentOrigin
+        {
+            get
+            {
+                return _parentOrigin;
+            }
+            set
+            {
+                _parentOrigin = value;
+                _imageFocus.ParentOrigin = _parentOrigin;
+            }
+        }
+
+        public Vector3 InitSize
+        {
+            get {return _initSize;}
+            set {_initSize = value;}
+        }
+
+        public Vector3 TargetSize
+        {
+            get {return _targetSize;}
+            set {_targetSize = value;}
+        }
+
+        public float KeyFrameStart
+        {
+            get {return _keyFrameStart;}
+            set {_keyFrameStart = value;}
+        }
+
+        public float KeyFrameEnd
+        {
+            get {return _keyFrameEnd;}
+            set {_keyFrameEnd = value;}
+        }
+
+        public ImageView ImageItem
+        {
+            get {return _imageFocus;}
+        }
+    }
+}
+
diff --git a/plugins/dali-swig/examples/firstscreen/FocusEffect.cs b/plugins/dali-swig/examples/firstscreen/FocusEffect.cs
new file mode 100644 (file)
index 0000000..d02e483
--- /dev/null
@@ -0,0 +1,203 @@
+using Dali;
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+
+namespace FirstScreen
+{
+    public class FocusEffect : IFocusEffect
+    {
+        private float _frameThickness;
+        private FocusData[] _focusData; // Each FocusData is used for one key frame animation (total 6 key frame animations needed for EddenEffect)
+        private Animation _animation;      // Animation used to apply all six key frame animations
+
+        public FocusEffect()
+        {
+            _frameThickness = 10.0f;
+            float _bottomFrameTime = 0.6f; // complete the halo/bottom animation 60% of the way through
+            float _sideFrameTime = 0.8f; // Start the side frame  animation after the bottom animation and complete at 80% of the way through
+            float _topFrameTime = 1.0f; // start the top frame animation after the side frame animation and complete at 100% way through
+
+            // Six key frame animations (FocusData objects) needed for EddenEffect
+            // Two key frame animations for top horizontal effect
+            // Two key frame animations for bottom horizontal effect
+            // Two key frame animations for vertical horizontal effect
+            _focusData = new FocusData[6];
+
+            FocusData focusData = new FocusData("halo", "halo.png", FocusData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
+                                             new Vector3(50,20,0),  new Vector3(0.0f, 100.0f , 0.0f), 0.0f, _bottomFrameTime);
+            _focusData[0] = focusData;
+
+            focusData = new FocusData("bottom", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
+                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(0.0f, _frameThickness, 0.0f), 0.0f, _bottomFrameTime);
+            _focusData[1] = focusData;
+
+            focusData = new FocusData("left", "verticalFrame.png", FocusData.Direction.Vertical, NDalic.ParentOriginBottomLeft,
+                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime);
+            _focusData[2] = focusData;
+
+            focusData = new FocusData("right", "verticalFrame.png", FocusData.Direction.Vertical, NDalic.ParentOriginBottomRight,
+                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime);
+            _focusData[3] = focusData;
+
+            focusData = new FocusData("top-left", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginBottomLeft,
+                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(0.0f ,_frameThickness, 0.0f), _sideFrameTime, _topFrameTime);
+            _focusData[4] = focusData;
+
+            focusData = new FocusData("top-right", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginBottomRight,
+                                    new Vector3(0.0f, 0.0f, 0.0f),  new Vector3(0.0f, _frameThickness, 0.0f), _sideFrameTime, _topFrameTime);
+            _focusData[5] = focusData;
+        }
+
+        public void FocusAnimation(View parentItem, Vector3 itemSize, float duration, FocusEffectDirection direction)
+        {
+            var itemWidth = itemSize.x + _frameThickness / 2;
+            var itemHeight = itemSize.y + _frameThickness / 3;
+
+            if (_animation)
+            {
+                _animation.Clear();
+                _animation.Reset();
+            }
+            _animation = new Animation(duration);
+
+            if (direction == FocusEffectDirection.BottomToTop)
+            {
+                _focusData[0].ParentOrigin = NDalic.ParentOriginBottomCenter;
+                _focusData[1].ParentOrigin = NDalic.ParentOriginBottomCenter;
+                _focusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
+                _focusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
+                _focusData[4].ParentOrigin = NDalic.ParentOriginTopLeft;
+                _focusData[5].ParentOrigin = NDalic.ParentOriginTopRight;
+            }
+            else
+            {
+                _focusData[0].ParentOrigin = NDalic.ParentOriginTopCenter;
+                _focusData[1].ParentOrigin = NDalic.ParentOriginTopCenter;
+                _focusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
+                _focusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
+                _focusData[4].ParentOrigin = NDalic.ParentOriginBottomLeft;
+                _focusData[5].ParentOrigin = NDalic.ParentOriginBottomRight;
+            }
+
+            foreach (FocusData focusData in _focusData)
+            {
+                var currentParent =  focusData.ImageItem.GetParent();
+
+                // first parent the controls
+                if (parentItem != currentParent)
+                {
+                    parentItem.Add(focusData.ImageItem);
+                }
+
+                focusData.ImageItem.Size = new Vector3(100.0f,100.0f, 0.0f);
+                parentItem.Add(focusData.ImageItem);
+
+                Vector3 targetSize = focusData.TargetSize;
+                Vector3 initSize = focusData.InitSize;
+
+                if (focusData.FocusDirection == FocusData.Direction.Horizontal)
+                {
+                    // adjust the width to match the parent
+                    targetSize.x = itemWidth;
+                }
+                else // vertical frame
+                {
+                    // adjust the height to match the parent
+                    targetSize.y = itemHeight;
+                }
+
+                // half the size for the top frame as we come out from both left / right sides
+                if (focusData.Name == "top-right" ||  focusData.Name == "top-left")
+                {
+                    targetSize.x = itemWidth - _frameThickness;
+                }
+
+                KeyFrames keyFrames = new KeyFrames();
+
+                keyFrames.Add(0.0f, new Property.Value(initSize));
+                keyFrames.Add(focusData.KeyFrameStart, new Property.Value(initSize));
+                keyFrames.Add(focusData.KeyFrameEnd, new Property.Value(targetSize));
+
+                // for halo add an extra keyframe to shrink it ( in 20% of time after it has finished)
+                if (focusData.Name =="halo")
+                {
+                    keyFrames.Add(focusData.KeyFrameEnd + 0.2f, new Property.Value(initSize));
+                }
+
+                _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.SIZE), keyFrames,
+                                          new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
+
+                // Simulate the vertical frame growing from the top.
+                // Vertical items are anchored to the bottom of the parent... so when they grow
+                // we need to move them to the middle of the parent ( otherwise they stick out the bottom)
+                if (focusData.FocusDirection == FocusData.Direction.Vertical)
+                {
+                    //animate position as well so it looks like animation is coming from bottom
+                    KeyFrames keyFramesV = new KeyFrames();
+
+                    if (direction == FocusEffectDirection.BottomToTop)
+                    {
+                        keyFramesV.Add(0.0f, new Property.Value(0.0f));
+                        keyFramesV.Add(focusData.KeyFrameStart, new Property.Value(0.0f));
+                    }
+                    else
+                    {
+                        keyFramesV.Add(0.0f, new Property.Value(-itemHeight));
+                        keyFramesV.Add(focusData.KeyFrameStart, new Property.Value(-itemHeight));
+                    }
+
+                    keyFramesV.Add(focusData.KeyFrameEnd, new Property.Value(-itemHeight / 2)); // animate to halfway up the control
+
+                    _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_Y), keyFramesV,
+                                              new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
+                }
+
+                // Simulate the top frame growing from the sides.
+                if (focusData.Name == "top-left")
+                {
+                    KeyFrames keyFramesTL = new KeyFrames();
+
+                    keyFramesTL.Add(0.0f, new Property.Value(0.0f));
+                    keyFramesTL.Add(focusData.KeyFrameStart, new Property.Value(0.0f));
+                    keyFramesTL.Add(focusData.KeyFrameEnd, new Property.Value(itemWidth / 2)); // animate to halfway up the control
+
+                    // grow these from the left or right
+                    _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_X), keyFramesTL,
+                                              new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
+                }
+
+                if (focusData.Name == "top-right")
+                {
+                    KeyFrames keyFramesTR = new KeyFrames();
+
+                    keyFramesTR.Add(0.0f, new Property.Value(0.0f));
+                    keyFramesTR.Add(focusData.KeyFrameStart, new Property.Value(0.0f));
+                    keyFramesTR.Add(focusData.KeyFrameEnd, new Property.Value(-itemWidth / 2)); // animate to halfway up the control
+
+                    // grow these from the left or right
+                    _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_X), keyFramesTR,
+                                              new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
+                }
+
+                _animation.Finished += OnAnimationFinished;
+
+                _animation.Play();
+            }
+        }
+
+        private void OnAnimationFinished(object source, Animation.FinishedEventArgs e)
+        {
+            foreach (FocusData focusData in _focusData)
+            {
+                var currentParent =  focusData.ImageItem.GetParent();
+
+                if (currentParent)
+                {
+                    currentParent.Remove(focusData.ImageItem);
+                }
+            }
+        }
+    }
+}
+
diff --git a/plugins/dali-swig/examples/firstscreen/IEdenEffect.cs b/plugins/dali-swig/examples/firstscreen/IEdenEffect.cs
deleted file mode 100644 (file)
index 88ca3b8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-using Dali;
-using System;
-
-namespace FirstScreen
-{
-    public enum EdenEffectDirection
-    {
-        TopToBottom,
-        BottomToTop
-    };
-
-    public interface IEdenEffect
-    {
-        void FocusAnimation(View parentItem, Vector3 itemSize, float duration, EdenEffectDirection direction);
-    }
-}
-
diff --git a/plugins/dali-swig/examples/firstscreen/IFocusEffect.cs b/plugins/dali-swig/examples/firstscreen/IFocusEffect.cs
new file mode 100644 (file)
index 0000000..222c2ed
--- /dev/null
@@ -0,0 +1,17 @@
+using Dali;
+using System;
+
+namespace FirstScreen
+{
+    public enum FocusEffectDirection
+    {
+        TopToBottom,
+        BottomToTop
+    };
+
+    public interface IFocusEffect
+    {
+        void FocusAnimation(View parentItem, Vector3 itemSize, float duration, FocusEffectDirection direction);
+    }
+}
+
index c22c7126efeb6cdc9eea3f0ee54967a4bc5cc6e4..633af05fa95736360ce355a3197d3d9bfd5ca481 100644 (file)
@@ -428,9 +428,9 @@ namespace FirstScreen
         }
 
         // Perform EddenEffect animation on Focused Item specified
-        public void FocusAnimation(EdenEffect edenEffect, EdenEffectDirection direction)
+        public void FocusAnimation(FocusEffect focusEffect, FocusEffectDirection direction)
         {
-            edenEffect.FocusAnimation(_itemList[_focusedItem], _itemSize, 1.0f, direction);
+            focusEffect.FocusAnimation(_itemList[_focusedItem], _itemSize, 1.0f, direction);
         }
 
         public void SetFocused(bool focused)
diff --git a/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow.9.png b/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow.9.png
deleted file mode 100644 (file)
index f989071..0000000
Binary files a/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow.9.png and /dev/null differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow_n.png b/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow_n.png
deleted file mode 100644 (file)
index 0805e9e..0000000
Binary files a/plugins/dali-swig/examples/firstscreen/images/eden_launcher_shadow_n.png and /dev/null differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/edeneffect/halo.png b/plugins/dali-swig/examples/firstscreen/images/edeneffect/halo.png
deleted file mode 100644 (file)
index 307f67e..0000000
Binary files a/plugins/dali-swig/examples/firstscreen/images/edeneffect/halo.png and /dev/null differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/edeneffect/horizontalFrame.png b/plugins/dali-swig/examples/firstscreen/images/edeneffect/horizontalFrame.png
deleted file mode 100644 (file)
index abff4ec..0000000
Binary files a/plugins/dali-swig/examples/firstscreen/images/edeneffect/horizontalFrame.png and /dev/null differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/edeneffect/verticalFrame.png b/plugins/dali-swig/examples/firstscreen/images/edeneffect/verticalFrame.png
deleted file mode 100644 (file)
index bdd372d..0000000
Binary files a/plugins/dali-swig/examples/firstscreen/images/edeneffect/verticalFrame.png and /dev/null differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow.9.png b/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow.9.png
new file mode 100644 (file)
index 0000000..f989071
Binary files /dev/null and b/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow.9.png differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow_n.png b/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow_n.png
new file mode 100644 (file)
index 0000000..0805e9e
Binary files /dev/null and b/plugins/dali-swig/examples/firstscreen/images/focus_launcher_shadow_n.png differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/focuseffect/halo.png b/plugins/dali-swig/examples/firstscreen/images/focuseffect/halo.png
new file mode 100644 (file)
index 0000000..307f67e
Binary files /dev/null and b/plugins/dali-swig/examples/firstscreen/images/focuseffect/halo.png differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/focuseffect/horizontalFrame.png b/plugins/dali-swig/examples/firstscreen/images/focuseffect/horizontalFrame.png
new file mode 100644 (file)
index 0000000..abff4ec
Binary files /dev/null and b/plugins/dali-swig/examples/firstscreen/images/focuseffect/horizontalFrame.png differ
diff --git a/plugins/dali-swig/examples/firstscreen/images/focuseffect/verticalFrame.png b/plugins/dali-swig/examples/firstscreen/images/focuseffect/verticalFrame.png
new file mode 100644 (file)
index 0000000..bdd372d
Binary files /dev/null and b/plugins/dali-swig/examples/firstscreen/images/focuseffect/verticalFrame.png differ