Exemple #1
0
 /// <summary>
 /// TransitionComponents default constructor.
 /// </summary>
 /// <since_tizen> 6 </since_tizen>
 public TransitionComponents()
 {
     Delay         = 0;
     Duration      = 100;
     AlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);
 }
Exemple #2
0
        /// <summary>
        /// TransitionComponents constructor. Stores delay, duration and AlphaFunction.
        /// </summary>
        /// <param name="delay">The delay before the animator starts.</param>
        /// <param name="duration">the duration of the animator.</param>
        /// <param name="alphaFunction">alpha function to use .</param>
        /// <since_tizen> 6 </since_tizen>

        public TransitionComponents(int delay, int duration, AlphaFunction alphaFunction)
        {
            Delay         = delay;
            Duration      = duration;
            AlphaFunction = alphaFunction;
        }
Exemple #3
0
 /// <summary>
 /// Creates an initialized SlideTransition.<br />
 /// </summary>
 /// <remarks>Delay and duration of timePeriod must be greater than zero.</remarks>
 public SlideTransitionItem(View view, Vector2 direction, bool isAppearing, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.SlideTransitionItem.New(view.SwigCPtr, direction.SwigCPtr, timePeriod.SwigCPtr), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
     AppearingTransition = isAppearing;
     AlphaFunction       = alphaFunction;
 }
        /// <summary>
        /// Creates an initialized TransitionItemBase.<br />
        /// </summary>
        public TransitionItemBase(View target, bool isAppearing, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.TransitionItemBase.New(), true)
        {
            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }

            AppearingTransition = isAppearing;
            TimePeriod          = timePeriod;
            AlphaFunction       = alphaFunction;
        }
Exemple #5
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AlphaFunction obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
        /// <summary>
        /// Sets up the main animation with the animators for each item (each layoutPositionData structure)
        /// </summary>
        private void AddAnimatorsToAnimation(LayoutData layoutPositionData)
        {
            LayoutTransition    positionTransition    = new LayoutTransition();
            TransitionCondition conditionForAnimators = layoutPositionData.ConditionForAnimation;

            // LayoutChanged transitions overrides ChangeOnAdd and ChangeOnRemove as siblings will
            // reposition to the new layout not to the insertion/removal of a sibling.
            if (layoutPositionData.ConditionForAnimation.HasFlag(TransitionCondition.LayoutChanged))
            {
                conditionForAnimators = TransitionCondition.LayoutChanged;
            }

            // Set up a default transition, will be overwritten if inherited from parent or set explicitly.
            const int     START_TIME    = 0;
            const int     END_TIME      = 100;
            AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);
            // positionTransitionComponents will be overwritten if set explicitly
            TransitionComponents positionTransitionComponents = new TransitionComponents(START_TIME, END_TIME, alphaFunction);
            bool matchedCustomTransitions = false;

            // Inherit parent transitions if none already set on View for the condition.
            // Transitions set on View rather than LayoutItem so if the Layout changes the transition persist.
            // Still need to inherit Position animator from parent but not other animatable properties if already set.

            TransitionList transitionsForCurrentCondition;

            ILayoutParent layoutParent = layoutPositionData.Item.GetParent();

            if (layoutParent != null)
            {
                // Check if item to aninmate has it's own Transitions for this condition.
                if (layoutPositionData.Item.Owner.LayoutTransitions.ContainsKey(conditionForAnimators))
                {
                    matchedCustomTransitions = true; // If a key exists then a List of atleast 1 transition exists.
                }
                else
                {
                    // Item doesn't have it's own transitions for this condition so copy parents if
                    // has a parent with transitions.
                    transitionsForCurrentCondition = new TransitionList();
                    LayoutGroup    layoutGroup = layoutParent as LayoutGroup;
                    TransitionList parentTransitionList;
                    // Note TryGetValue returns null if key not matched.
                    if (layoutGroup.Owner.LayoutTransitions.TryGetValue(conditionForAnimators, out parentTransitionList))
                    {
                        // Copy parent transitions for this condition to temporary TransitionList.
                        LayoutTransitionsHelper.CopyTransitions(parentTransitionList,
                                                                transitionsForCurrentCondition);

                        SetupAnimationForCustomTransitions(transitionsForCurrentCondition, layoutPositionData.Item.Owner);
                        matchedCustomTransitions = false;
                    }
                }
            }

            // SetupAnimationXXXX functions add Animators to the core Animation, these can be custom or set by the
            // layout system in the case of Positioning.

            if (matchedCustomTransitions)
            {
                // Position transition can be for a layout changing to another layout or an item being added or removed.
                // There can only be one position transition, it will be replaced if set multiple times.
                // transitionsForCurrentCondition represent all non position (custom) properties that should be animated.
                // There can be multiple properties hence returned as a list.
                if (layoutPositionData.Item.Owner.LayoutTransitions.TryGetValue(conditionForAnimators, out transitionsForCurrentCondition))
                {
                    // Search for Position property in the transitionsForCurrentCondition list of custom transitions,
                    // and only use the particular parts of the animator as custom transitions should not effect all parameters of Position.
                    // Typically Delay, Duration and Alphafunction can be custom.
                    FindAndReplaceAnimatorComponentsForProperty(transitionsForCurrentCondition,
                                                                AnimatableProperties.Position,
                                                                ref positionTransitionComponents);

                    SetupAnimationForCustomTransitions(transitionsForCurrentCondition, layoutPositionData.Item.Owner);
                }
            }

            SetupAnimationForPosition(layoutPositionData, positionTransitionComponents);

            SetupAnimationForText(layoutPositionData);
        }
Exemple #7
0
        /// <summary>
        /// Adds a key frame.
        /// </summary>
        /// <param name="progress">A progress value between 0.0 and 1.0.</param>
        /// <param name="value">A value</param>
        /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
        /// <since_tizen> 3 </since_tizen>
        public void Add(float progress, object value, AlphaFunction alpha)
        {
            PropertyValue val = PropertyValue.CreateFromObject(value);

            Add(progress, val, alpha);
        }
Exemple #8
0
 /// <summary>
 /// Creates an initialized fade.<br />
 /// </summary>
 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
 public FadeTransitionItem(View view, float opacity, bool isAppearing, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.FadeTransitionItem.New(view.SwigCPtr, opacity, timePeriod.SwigCPtr), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
     AppearingTransition = isAppearing;
     AlphaFunction       = alphaFunction;
 }
Exemple #9
0
 internal virtual TransitionItemBase CreateTransition(View view, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
 {
     return(new TransitionItemBase(view, appearingTransition, timePeriod, alphaFunction));
 }
Exemple #10
0
 /// <summary>
 /// Adds a key frame.
 /// </summary>
 /// <param name="progress">A progress value between 0.0 and 1.0.</param>
 /// <param name="value">A value.</param>
 /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
 /// <since_tizen> 3 </since_tizen>
 public void Add(float progress, PropertyValue value, AlphaFunction alpha)
 {
     NDalicPINVOKE.KeyFrames_Add__SWIG_1(swigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #11
0
        internal override TransitionItemBase CreateTransition(View view, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
        {
            SlideTransitionItem slide = new SlideTransitionItem(view, Direction, appearingTransition, timePeriod, alphaFunction);

            return(slide);
        }
Exemple #12
0
        public AlphaFunction GetAlphaFunction()
        {
            AlphaFunction alphaFunction = new AlphaFunction(Interop.FrameCallback.FrameUpdateCallback_GetAlphaFunction(swigCPtr), false);

            return(alphaFunction);
        }
Exemple #13
0
 public void SetAlphaFunction(AlphaFunction alphaFunction)
 {
     Interop.FrameCallback.FrameUpdateCallback_SetAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alphaFunction));
 }
Exemple #14
0
 public void SetAlphaFunction(AlphaFunction alphaFunction)
 {
     AlphaFunction = alphaFunction;
 }
Exemple #15
0
 /// <summary>
 /// Creates an initialized ScaleTransition.<br />
 /// </summary>
 /// <remarks>Delay and duration of timePeriod must be greater than zero.</remarks>
 public ScaleTransitionItem(View view, float scale, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.ScaleTransitionItem.New(view.SwigCPtr, scale, timePeriod.SwigCPtr), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
     AppearingTransition = appearingTransition;
     AlphaFunction       = alphaFunction;
 }
Exemple #16
0
        internal override TransitionItemBase CreateTransition(View view, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
        {
            TransitionGroupItem group = new TransitionGroupItem(view, transitionList, UseGroupTimePeriod, StepTransition, UseGroupAlphaFunction, appearingTransition, timePeriod, alphaFunction);

            return(group);
        }
Exemple #17
0
        internal override TransitionItemBase CreateTransition(View view, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
        {
            FadeTransitionItem fade = new FadeTransitionItem(view, Opacity, appearingTransition, timePeriod, alphaFunction);

            return(fade);
        }
Exemple #18
0
        private TransitionComponents CreateDefaultTransitionComponent(int delay, int duration)
        {
            AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);

            return(new TransitionComponents(delay, duration, alphaFunction));
        }
Exemple #19
0
        /// <summary>
        /// Creates an initialized fade.<br />
        /// </summary>
        /// <remarks>DurationmSeconds must be greater than zero.</remarks>
        public TransitionGroupItem(View view, List <TransitionBase> transitionList, bool useGroupTimePeriod, bool stepTransition, bool useGroupAlphaFunction, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
            : base(view, appearingTransition, timePeriod, alphaFunction)
        {
            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }

            this.useGroupTimePeriod    = useGroupTimePeriod;
            this.stepTransition        = stepTransition;
            this.useGroupAlphaFunction = useGroupAlphaFunction;
            transitionView             = view;

            transitionItemList = new List <TransitionItemBase>();
            for (int index = 0; index < transitionList.Count; ++index)
            {
                TimePeriod    localTimePeriod    = new TimePeriod(transitionList[index].GetTimePeriod().DelayMilliseconds, transitionList[index].GetTimePeriod().DurationMilliseconds);
                AlphaFunction localAlphaFunction = transitionList[index].GetAlphaFunction();
                if (useGroupTimePeriod)
                {
                    int stepMilliseconds = 0;
                    if (stepTransition)
                    {
                        stepMilliseconds = TimePeriod.DurationMilliseconds / transitionList.Count;
                    }
                    localTimePeriod.DelayMilliseconds += TimePeriod.DelayMilliseconds + stepMilliseconds * index;
                }
                if (useGroupAlphaFunction)
                {
                    localAlphaFunction = AlphaFunction;
                }
                transitionItemList.Add(transitionList[index].CreateTransition(transitionView, AppearingTransition, localTimePeriod, localAlphaFunction));
            }
        }
 /// <summary>
 /// Creates an initialized TransitionItemBase.<br />
 /// </summary>
 public TransitionItemBase(View target, bool isEntering, TimePeriod timePeriod, AlphaFunction alphaFunction) : this(Interop.TransitionItemBase.New(/*target.SwigCPtr, isEntering, timePeriod.SwigCPtr*/), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
     AlphaFunction = alphaFunction;
 }
Exemple #21
0
        internal override TransitionItemBase CreateTransition(View view, bool appearingTransition, TimePeriod timePeriod, AlphaFunction alphaFunction)
        {
            ScaleTransitionItem scale = new ScaleTransitionItem(view, ScaleFactor, appearingTransition, timePeriod, alphaFunction);

            return(scale);
        }