From 0a1d750c1eb477d03b101dac9d19808c3c9b76cd Mon Sep 17 00:00:00 2001 From: "xb.teng" Date: Thu, 27 Apr 2017 04:14:48 +0800 Subject: [PATCH] Convert AlphaFunction from string type to enum and AnimatorVisual to VisualAnimator Change-Id: I46003dc0df432c61375d296760c55d06bbc4e8c2 Signed-off-by: xb.teng --- .../src/public/BaseComponents/VisualView.cs | 2 +- src/Tizen.NUI/src/public/NUIConstants.cs | 2 +- src/Tizen.NUI/src/public/VisualMaps.cs | 112 ++++++++++++++++++++- 3 files changed, 109 insertions(+), 7 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index faadd52..d816d7d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -208,7 +208,7 @@ namespace Tizen.NUI.BaseComponents /// /// property map to define visual animation /// Animation instance - public Animation AnimateVisual(AnimatorVisual visualMap) + public Animation VisualAnimate(VisualAnimator visualMap) { foreach (var item in _visualDictionary.ToList()) { diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index 31c4ec3..f0b7ecb 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -205,7 +205,7 @@ namespace Tizen.NUI LastViewBehaviourFlag } - public enum DeviceClassType + public enum DeviceClassType { None, Seat, diff --git a/src/Tizen.NUI/src/public/VisualMaps.cs b/src/Tizen.NUI/src/public/VisualMaps.cs index dcd2a06..959dd07 100755 --- a/src/Tizen.NUI/src/public/VisualMaps.cs +++ b/src/Tizen.NUI/src/public/VisualMaps.cs @@ -1981,9 +1981,9 @@ namespace Tizen.NUI /// /// A class encapsulating the property map of a visual transition(Animator). /// - public class AnimatorVisual : VisualMap + public class VisualAnimator : VisualMap { - public AnimatorVisual() : base() + public VisualAnimator() : base() { } @@ -1994,15 +1994,117 @@ namespace Tizen.NUI private string _propertyIndex = null; private object _destinationValue = null; - public string AlphaFunction + public AlphaFunction.BuiltinFunctions AlphaFunction { get { - return _alphaFunction; + switch (_alphaFunction) + { + case "LINEAR": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear; + case "REVERSE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse; + case "EASE_IN_SQUARE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare; + case "EASE_OUT_SQUARE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare; + case "EASE_IN": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn; + case "EASE_OUT": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut; + case "EASE_IN_OUT": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut; + case "EASE_IN_SINE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine; + case "EASE_OUT_SINE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine; + case "EASE_IN_OUT_SINE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine; + case "BOUNCE": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce; + case "SIN": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin; + case "EASE_OUT_BACK": + return Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack; + default: + return Tizen.NUI.AlphaFunction.BuiltinFunctions.Default; + } } set { - _alphaFunction = value; + switch (value) + { + case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear: + { + _alphaFunction = "LINEAR"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse: + { + _alphaFunction = "REVERSE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare: + { + _alphaFunction = "EASE_IN_SQUARE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare: + { + _alphaFunction = "EASE_OUT_SQUARE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn: + { + _alphaFunction = "EASE_IN"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut: + { + _alphaFunction = "EASE_OUT"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut: + { + _alphaFunction = "EASE_IN_OUT"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine: + { + _alphaFunction = "EASE_IN_SINE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine: + { + _alphaFunction = "EASE_OUT_SINE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine: + { + _alphaFunction = "EASE_IN_OUT_SINE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce: + { + _alphaFunction = "BOUNCE"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin: + { + _alphaFunction = "SIN"; + break; + } + case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack: + { + _alphaFunction = "EASE_OUT_BACK"; + break; + } + default: + { + _alphaFunction = "DEFAULT"; + break; + } + } } } -- 2.7.4