Example #1
0
			public SvgCanvas (SvgHelper h, int width, int height) : base ()
			{
				helper = h;
				this.width = width;
				this.height = height;

			}
        public AnimatedPathView(Context context, IAttributeSet attrs, int defStyle)
            : base(context, attrs, defStyle)
        {
            mStrokePaint.SetStyle(Paint.Style.Stroke);
            mFillPaint.SetStyle(Paint.Style.Fill);

            TypedArray a = context.ObtainStyledAttributes(attrs, Resource.Styleable.AnimatedPathView, defStyle, 0);

            try {
                if (a != null)
                {
                    mStrokePaint.StrokeWidth = a.GetDimensionPixelSize(Resource.Styleable.AnimatedPathView_strokeWidth, 1);
                    mStrokePaint.Color       = a.GetColor(Resource.Styleable.AnimatedPathView_strokeColor, unchecked ((int)0xff000000));
                    svg = new SvgHelper(mStrokePaint);
                    mFillPaint.Color = a.GetColor(Resource.Styleable.AnimatedPathView_fillColor, unchecked ((int)0xff000000));
                    phase            = a.GetFloat(Resource.Styleable.AnimatedPathView_phase, 0.0f);
                    duration         = a.GetInt(Resource.Styleable.AnimatedPathView_duration, 4000);
                    fillDuration     = a.GetInt(Resource.Styleable.AnimatedPathView_fillDuration, 4000);
                    fillOffset       = a.GetInt(Resource.Styleable.AnimatedPathView_fillOffset, 2000);
                    fadeFactor       = a.GetFloat(Resource.Styleable.AnimatedPathView_fadeFactor, 10.0f);
                    svgResource      = a.GetResourceId(Resource.Styleable.AnimatedPathView_svgPath, 0);
                }
            } finally {
                if (a != null)
                {
                    a.Recycle();
                }
            }
        }
		public AnimatedPathView (Context context, IAttributeSet attrs, int defStyle)
			: base (context, attrs, defStyle)
		{
			mStrokePaint.SetStyle (Paint.Style.Stroke);
			mFillPaint.SetStyle (Paint.Style.Fill);

			TypedArray a = context.ObtainStyledAttributes (attrs, Resource.Styleable.AnimatedPathView, defStyle, 0);
			try {
				if(a != null) {
					mStrokePaint.StrokeWidth = a.GetDimensionPixelSize (Resource.Styleable.AnimatedPathView_strokeWidth,1);
					mStrokePaint.Color = a.GetColor (Resource.Styleable.AnimatedPathView_strokeColor, unchecked((int)0xff000000));
					svg = new SvgHelper (mStrokePaint);
					mFillPaint.Color = a.GetColor (Resource.Styleable.AnimatedPathView_fillColor, unchecked((int)0xff000000));
					phase = a.GetFloat (Resource.Styleable.AnimatedPathView_phase, 0.0f);
					duration = a.GetInt (Resource.Styleable.AnimatedPathView_duration, 4000);
					fillDuration = a.GetInt (Resource.Styleable.AnimatedPathView_fillDuration, 4000);
					fillOffset = a.GetInt (Resource.Styleable.AnimatedPathView_fillOffset, 2000);
					fadeFactor = a.GetFloat (Resource.Styleable.AnimatedPathView_fadeFactor, 10.0f);
					svgResource = a.GetResourceId (Resource.Styleable.AnimatedPathView_svgPath, 0);
				}
			} finally {
				if (a != null)
					a.Recycle ();
			}

		}
Example #4
0
 public SvgCanvas(SvgHelper h, int width, int height) : base()
 {
     helper      = h;
     this.width  = width;
     this.height = height;
 }