Example #1
0
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     if (property == LottieProperty.PolystarPoints)
     {
         _pointsAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.PolystarRotation)
     {
         _rotationAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.Position)
     {
         _positionAnimation.SetValueCallback((ILottieValueCallback <Vector2?>)callback);
     }
     else if (property == LottieProperty.PolystarInnerRadius && _innerRadiusAnimation != null)
     {
         _innerRadiusAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.PolystarOuterRadius)
     {
         _outerRadiusAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.PolystarInnerRoundedness && _innerRoundednessAnimation != null)
     {
         _innerRoundednessAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.PolystarOuterRoundedness)
     {
         _outerRoundednessAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
 }
Example #2
0
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     if (property == LottieProperty.Color)
     {
         _colorAnimation.SetValueCallback((ILottieValueCallback <Color?>)callback);
     }
     else if (property == LottieProperty.Opacity)
     {
         _opacityAnimation.SetValueCallback((ILottieValueCallback <int?>)callback);
     }
     else if (property == LottieProperty.ColorFilter)
     {
         if (callback == null)
         {
             _colorFilterAnimation = null;
         }
         else
         {
             _colorFilterAnimation = new ValueCallbackKeyframeAnimation <ColorFilter, ColorFilter>((ILottieValueCallback <ColorFilter>)callback);
             _colorFilterAnimation.ValueChanged += (sender, args) =>
             {
                 _lottieDrawable.InvalidateSelf();
             };
             _layer.AddAnimation(_colorFilterAnimation);
         }
     }
 }
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     if (property == LottieProperty.EllipseSize)
     {
         _sizeAnimation.SetValueCallback((ILottieValueCallback <Vector2?>)callback);
     }
     else if (property == LottieProperty.Position)
     {
         _positionAnimation.SetValueCallback((ILottieValueCallback <Vector2?>)callback);
     }
 }
Example #4
0
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     if (property == LottieProperty.ColorFilter)
     {
         if (callback == null)
         {
             _colorFilterAnimation = null;
         }
         else
         {
             _colorFilterAnimation = new ValueCallbackKeyframeAnimation <ColorFilter, ColorFilter>((ILottieValueCallback <ColorFilter>)callback);
         }
     }
 }
Example #5
0
 public override void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     base.AddValueCallback(property, callback);
     if (property == LottieProperty.ColorFilter)
     {
         if (callback == null)
         {
             _colorFilterAnimation = null;
         }
         else
         {
             _colorFilterAnimation = new ValueCallbackKeyframeAnimation <SKColorFilter, SKColorFilter>((ILottieValueCallback <SKColorFilter>)callback);
         }
     }
 }
Example #6
0
        public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
        {
            if (_transform.ApplyValueCallback(property, callback))
            {
                return;
            }

            if (property == LottieProperty.RepeaterCopies)
            {
                _copies.SetValueCallback((ILottieValueCallback <float?>)callback);
            }
            else if (property == LottieProperty.RepeaterOffset)
            {
                _offset.SetValueCallback((ILottieValueCallback <float?>)callback);
            }
        }
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     if (property == LottieProperty.ColorFilter)
     {
         if (callback == null)
         {
             _colorFilterAnimation = null;
         }
         else
         {
             _colorFilterAnimation = new ValueCallbackKeyframeAnimation <SKColorFilter, SKColorFilter>((ILottieValueCallback <SKColorFilter>)callback);
             _colorFilterAnimation.ValueChanged += OnValueChanged;
             _layer.AddAnimation(_colorFilterAnimation);
         }
     }
 }
Example #8
0
        public override void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
        {
            base.AddValueCallback(property, callback);

            if (property == LottieProperty.TimeRemap)
            {
                if (callback == null)
                {
                    _timeRemapping = null;
                }
                else
                {
                    _timeRemapping = new ValueCallbackKeyframeAnimation <float?, float?>((ILottieValueCallback <float?>)callback);
                }
            }
        }
Example #9
0
 public override void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     base.AddValueCallback(property, callback);
     if (property == LottieProperty.Color && _colorAnimation != null)
     {
         _colorAnimation.SetValueCallback((ILottieValueCallback <Color?>)callback);
     }
     else if (property == LottieProperty.StrokeColor && _strokeColorAnimation != null)
     {
         _strokeColorAnimation.SetValueCallback((ILottieValueCallback <Color?>)callback);
     }
     else if (property == LottieProperty.StrokeWidth && _strokeWidthAnimation != null)
     {
         _strokeWidthAnimation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.TextTracking)
     {
         _trackingAnimation?.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
 }
Example #10
0
 public override void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     base.AddValueCallback(property, callback);
     if (property == LottieProperty.StrokeColor)
     {
         _colorAnimation.SetValueCallback((ILottieValueCallback <Color?>)callback);
     }
     else if (property == LottieProperty.ColorFilter)
     {
         if (callback == null)
         {
             _colorFilterAnimation = null;
         }
         else
         {
             _colorFilterAnimation = new ValueCallbackKeyframeAnimation <ColorFilter, ColorFilter>((ILottieValueCallback <ColorFilter>)callback);
             _colorFilterAnimation.ValueChanged += OnValueChanged;
             _layer.AddAnimation(_colorAnimation);
         }
     }
 }
Example #11
0
 /// <summary>
 /// Returns whether the callback was applied.
 /// </summary>
 public bool ApplyValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     if (property == LottieProperty.TransformAnchorPoint)
     {
         _anchorPoint.SetValueCallback((ILottieValueCallback <Vector2?>)callback);
     }
     else if (property == LottieProperty.TransformPosition)
     {
         _position.SetValueCallback((ILottieValueCallback <Vector2?>)callback);
     }
     else if (property == LottieProperty.TransformScale)
     {
         _scale.SetValueCallback((ILottieValueCallback <ScaleXy>)callback);
     }
     else if (property == LottieProperty.TransformRotation)
     {
         _rotation.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.TransformOpacity)
     {
         _opacity.SetValueCallback((ILottieValueCallback <int?>)callback);
     }
     else if (property == LottieProperty.TransformStartOpacity && _startOpacity != null)
     {
         _startOpacity.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else if (property == LottieProperty.TransformEndOpacity && _endOpacity != null)
     {
         _endOpacity.SetValueCallback((ILottieValueCallback <float?>)callback);
     }
     else
     {
         return(false);
     }
     return(true);
 }
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
 }
Example #13
0
 internal ValueCallbackKeyframeAnimation(ILottieValueCallback <TA> valueCallback) : base(new List <Keyframe <TK> >())
 {
     SetValueCallback(valueCallback);
 }
 public void AddValueCallback <T>(LottieProperty property, ILottieValueCallback <T> callback)
 {
     _transformAnimation?.ApplyValueCallback(property, callback);
 }