コード例 #1
0
		public static IRenderer Renderer(AnimationMode mode, FitChartValue value, RectF drawingArea)
		{
			if (mode == AnimationMode.Linear)
			{
				return new LinearValueRenderer (drawingArea, value);
			}
			else
			{
				return new OverdrawValueRenderer (drawingArea, value);
			}
		}
コード例 #2
0
		private float CalculateSweepAngle(float animationSeek, FitChartValue value)
		{
			float result;
			var totalSizeOfValue = value.StartAngle + value.SweepAngle;

			if (totalSizeOfValue > animationSeek) {
				result = animationSeek - value.StartAngle;
			}
			else 
			{
				result = value.SweepAngle;
			}

			return result;	
		}
コード例 #3
0
		public void SetValue(float value)
		{
			chartValues.Clear ();

			var chartValue = new FitChartValue (value, valueStrokeColor);
			chartValue.Paint = BuildPaintForValue();
			chartValue.StartAngle = StartAngle;
			chartValue.SweepAngle = CalculateSweepAngle(value);

			chartValues.Add(chartValue);

			maxSweepAngle = chartValue.SweepAngle;

			PlayAnimation();
		}
コード例 #4
0
		public LinearValueRenderer (RectF drawingArea, FitChartValue value) : base(drawingArea, value)
		{
			
		}
コード例 #5
0
		public BaseRenderer (RectF drawingArea, FitChartValue value)
		{
			DrawingArea = drawingArea;
			Value = value;
		}
コード例 #6
0
		private void RenderValue(Canvas canvas, FitChartValue value)
		{
			if (!IsInEditMode)
			{
				var animationSeek = CalculateAnimationSeek ();
				var renderer = RendererFactory.Renderer (AnimationMode, value, drawingArea);
				var path = renderer.BuildPath (animationProgress, animationSeek);

				if (path != null) 
				{
					canvas.DrawPath (path, value.Paint);
				}
			}
			else 
			{ 
				var path = new Path ();
				path.AddArc (drawingArea, StartAngle, DesignModeSweepAngle);
				canvas.DrawPath (path, valueDesignPaint);
			}

		}
コード例 #7
0
		public OverdrawValueRenderer (RectF drawingArea, FitChartValue value) : base(drawingArea, value)
		{
		}