예제 #1
0
 public void OnAnimationUpdate(ValueAnimator animation)
 {
     try
     {
         var   evaluator = new ArgbEvaluator();
         var   newStart  = (int)evaluator.Evaluate(animation.AnimatedFraction, Start, End);
         var   newMid    = (int)evaluator.Evaluate(animation.AnimatedFraction, Mid, Start);
         var   newEnd    = (int)evaluator.Evaluate(animation.AnimatedFraction, End, Mid);
         int[] newArray  = { newStart, newMid, newEnd };
         GradientDrawableView.SetColors(newArray);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
 public void OnAnimationUpdate(ValueAnimator animation)
 {
     try
     {
         var   evaluator = new ArgbEvaluator();
         var   newStart  = (int)evaluator.Evaluate(animation.AnimatedFraction, Start, End);
         var   newMid    = (int)evaluator.Evaluate(animation.AnimatedFraction, Mid, Start);
         var   newEnd    = (int)evaluator.Evaluate(animation.AnimatedFraction, End, Mid);
         int[] newArray  = { newStart, newMid, newEnd };
         GradientDrawableView.SetColors(newArray);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
예제 #3
0
 private void DrawTickMarks(Canvas canvas)
 {
     for (int i = 0; i < _marksCount; i++)
     {
         var offset = MarksSpacing * i + PaddingLeft;
         if (Width * Progress * 0.01 >= offset)
         {
             var colorInt = (int)_argbEvaluator.Evaluate(offset / (float)(MarksSpacing * (_marksCount - 1)), Style.R255G121B4.ToArgb(), Style.R255G22B5.ToArgb());
             var hex      = $"#{Integer.ToHexString(colorInt)}";
             TickMarkActive.Color = Color.ParseColor(hex);
             canvas.DrawCircle(offset, Height / 2, _markRadius, TickMarkActive);
         }
         else
         {
             canvas.DrawCircle(offset, Height / 2, _markRadius, TickMarkInActive);
         }
     }
 }