public BridgingLine(JoinedPath pathA, JoinedPath pathB) {
				this.pathA = pathA;
				this.pathB = pathB;
			}
		public DrawerArrowDrawable(Resources resources, Boolean rounded1) {
			rounded = rounded1;
			float density = resources.DisplayMetrics.Density;
			float strokeWidthPixel = STROKE_WIDTH_DP * density;
			halfStrokeWidthPixel = strokeWidthPixel / 2;

			linePaint = new Paint(Android.Graphics.PaintFlags.SubpixelText | Android.Graphics.PaintFlags.AntiAlias);
			linePaint.StrokeCap=rounded ? Android.Graphics.Paint.Cap.Round : Android.Graphics.Paint.Cap.Butt;
			linePaint.Color=Android.Graphics.Color.Black;
			linePaint.SetStyle (Android.Graphics.Paint.Style.Stroke);
			linePaint.StrokeWidth=strokeWidthPixel;

			int dimen = (int) (DIMEN_DP * density);
			bounds = new Rect(0, 0, dimen, dimen);

			Path first, second;
			JoinedPath joinedA, joinedB;

			// Top
			first = new Path();
			first.MoveTo(5.042f, 20f);
			first.RCubicTo(8.125f, -16.317f, 39.753f, -27.851f, 55.49f, -2.765f);
			second = new Path();
			second.MoveTo(60.531f, 17.235f);
			second.RCubicTo(11.301f, 18.015f, -3.699f, 46.083f, -23.725f, 43.456f);
			scalePath(first, density);
			scalePath(second, density);
			joinedA = new JoinedPath(first, second);

			first = new Path();
			first.MoveTo(64.959f, 20f);
			first.RCubicTo(4.457f, 16.75f, 1.512f, 37.982f, -22.557f, 42.699f);
			second = new Path();
			second.MoveTo(42.402f, 62.699f);
			second.CubicTo(18.333f, 67.418f, 8.807f, 45.646f, 8.807f, 32.823f);
			scalePath(first, density);
			scalePath(second, density);
			joinedB = new JoinedPath(first, second);
			topLine = new BridgingLine(joinedA, joinedB);

			// Middle
			first = new Path();
			first.MoveTo(5.042f, 35f);
			first.CubicTo(5.042f, 20.333f, 18.625f, 6.791f, 35f, 6.791f);
			second = new Path();
			second.MoveTo(35f, 6.791f);
			second.RCubicTo(16.083f, 0f, 26.853f, 16.702f, 26.853f, 28.209f);
			scalePath(first, density);
			scalePath(second, density);
			joinedA = new JoinedPath(first, second);

			first = new Path();
			first.MoveTo(64.959f, 35f);
			first.RCubicTo(0f, 10.926f, -8.709f, 26.416f, -29.958f, 26.416f);
			second = new Path();
			second.MoveTo(35f, 61.416f);
			second.RCubicTo(-7.5f, 0f, -23.946f, -8.211f, -23.946f, -26.416f);
			scalePath(first, density);
			scalePath(second, density);
			joinedB = new JoinedPath(first, second);
			middleLine = new BridgingLine(joinedA, joinedB);

			// Bottom
			first = new Path();
			first.MoveTo(5.042f, 50f);
			first.CubicTo(2.5f, 43.312f, 0.013f, 26.546f, 9.475f, 17.346f);
			second = new Path();
			second.MoveTo(9.475f, 17.346f);
			second.RCubicTo(9.462f, -9.2f, 24.188f, -10.353f, 27.326f, -8.245f);
			scalePath(first, density);
			scalePath(second, density);
			joinedA = new JoinedPath(first, second);

			first = new Path();
			first.MoveTo(64.959f, 50f);
			first.RCubicTo(-7.021f, 10.08f, -20.584f, 19.699f, -37.361f, 12.74f);
			second = new Path();
			second.MoveTo(27.598f, 62.699f);
			second.RCubicTo(-15.723f, -6.521f, -18.8f, -23.543f, -18.8f, -25.642f);
			scalePath(first, density);
			scalePath(second, density);
			joinedB = new JoinedPath(first, second);
			bottomLine = new BridgingLine(joinedA, joinedB);
		}
Beispiel #3
0
 public BridgingLine(JoinedPath pathA, JoinedPath pathB)
 {
     this.pathA = pathA;
     this.pathB = pathB;
 }
Beispiel #4
0
        public DrawerArrowDrawable(Resources resources, Boolean rounded1)
        {
            rounded = rounded1;
            float density          = resources.DisplayMetrics.Density;
            float strokeWidthPixel = STROKE_WIDTH_DP * density;

            halfStrokeWidthPixel = strokeWidthPixel / 2;

            linePaint           = new Paint(global::Android.Graphics.PaintFlags.SubpixelText | global::Android.Graphics.PaintFlags.AntiAlias);
            linePaint.StrokeCap = rounded ? global::Android.Graphics.Paint.Cap.Round : global::Android.Graphics.Paint.Cap.Butt;
            linePaint.Color     = global::Android.Graphics.Color.Black;
            linePaint.SetStyle(global::Android.Graphics.Paint.Style.Stroke);
            linePaint.StrokeWidth = strokeWidthPixel;

            int dimen = (int)(DIMEN_DP * density);

            bounds = new Rect(0, 0, dimen, dimen);

            Path       first, second;
            JoinedPath joinedA, joinedB;

            // Top
            first = new Path();
            first.MoveTo(5.042f, 20f);
            first.RCubicTo(8.125f, -16.317f, 39.753f, -27.851f, 55.49f, -2.765f);
            second = new Path();
            second.MoveTo(60.531f, 17.235f);
            second.RCubicTo(11.301f, 18.015f, -3.699f, 46.083f, -23.725f, 43.456f);
            scalePath(first, density);
            scalePath(second, density);
            joinedA = new JoinedPath(first, second);

            first = new Path();
            first.MoveTo(64.959f, 20f);
            first.RCubicTo(4.457f, 16.75f, 1.512f, 37.982f, -22.557f, 42.699f);
            second = new Path();
            second.MoveTo(42.402f, 62.699f);
            second.CubicTo(18.333f, 67.418f, 8.807f, 45.646f, 8.807f, 32.823f);
            scalePath(first, density);
            scalePath(second, density);
            joinedB = new JoinedPath(first, second);
            topLine = new BridgingLine(joinedA, joinedB);

            // Middle
            first = new Path();
            first.MoveTo(5.042f, 35f);
            first.CubicTo(5.042f, 20.333f, 18.625f, 6.791f, 35f, 6.791f);
            second = new Path();
            second.MoveTo(35f, 6.791f);
            second.RCubicTo(16.083f, 0f, 26.853f, 16.702f, 26.853f, 28.209f);
            scalePath(first, density);
            scalePath(second, density);
            joinedA = new JoinedPath(first, second);

            first = new Path();
            first.MoveTo(64.959f, 35f);
            first.RCubicTo(0f, 10.926f, -8.709f, 26.416f, -29.958f, 26.416f);
            second = new Path();
            second.MoveTo(35f, 61.416f);
            second.RCubicTo(-7.5f, 0f, -23.946f, -8.211f, -23.946f, -26.416f);
            scalePath(first, density);
            scalePath(second, density);
            joinedB    = new JoinedPath(first, second);
            middleLine = new BridgingLine(joinedA, joinedB);

            // Bottom
            first = new Path();
            first.MoveTo(5.042f, 50f);
            first.CubicTo(2.5f, 43.312f, 0.013f, 26.546f, 9.475f, 17.346f);
            second = new Path();
            second.MoveTo(9.475f, 17.346f);
            second.RCubicTo(9.462f, -9.2f, 24.188f, -10.353f, 27.326f, -8.245f);
            scalePath(first, density);
            scalePath(second, density);
            joinedA = new JoinedPath(first, second);

            first = new Path();
            first.MoveTo(64.959f, 50f);
            first.RCubicTo(-7.021f, 10.08f, -20.584f, 19.699f, -37.361f, 12.74f);
            second = new Path();
            second.MoveTo(27.598f, 62.699f);
            second.RCubicTo(-15.723f, -6.521f, -18.8f, -23.543f, -18.8f, -25.642f);
            scalePath(first, density);
            scalePath(second, density);
            joinedB    = new JoinedPath(first, second);
            bottomLine = new BridgingLine(joinedA, joinedB);
        }
        public DrawerArrowDrawable(Resources resources, bool rounded)
        {
            _rounded = rounded;
            float density          = resources.DisplayMetrics.Density;
            float strokeWidthPixel = StrokeWidthDp * density;

            _halfStrokeWidthPixel = strokeWidthPixel / 2;

            _linePaint = new Paint(PaintFlags.SubpixelText | PaintFlags.AntiAlias)
            {
                StrokeCap   = rounded ? Paint.Cap.Round : Paint.Cap.Butt,
                Color       = Color.Black,
                StrokeWidth = strokeWidthPixel
            };
            _linePaint.SetStyle(Paint.Style.Stroke);

            var dimen = (int)(DimenDp * density);

            _bounds = new Rect(0, 0, dimen, dimen);

            //Top
            var first = new Path();

            first.MoveTo(5.042f, 20f);
            first.RCubicTo(8.125f, -16.317f, 39.753f, -27.851f, 55.49f, -2.765f);
            var second = new Path();

            second.MoveTo(60.531f, 17.235f);
            second.RCubicTo(11.301f, 18.015f, -3.699f, 46.083f, -23.725f, 43.456f);
            ScalePath(first, density);
            ScalePath(second, density);
            var joinedA = new JoinedPath(first, second);

            first = new Path();
            first.MoveTo(64.959f, 20f);
            first.RCubicTo(4.457f, 16.75f, 1.512f, 37.982f, -22.557f, 42.699f);
            second = new Path();
            second.MoveTo(42.402f, 62.699f);
            second.CubicTo(18.333f, 67.418f, 8.807f, 45.646f, 8.807f, 32.823f);
            ScalePath(first, density);
            ScalePath(second, density);
            var joinedB = new JoinedPath(first, second);

            _topLine = new BridgingLine(joinedA, joinedB, this);

            // Middle
            first = new Path();
            first.MoveTo(5.042f, 35f);
            first.CubicTo(5.042f, 20.333f, 18.625f, 6.791f, 35f, 6.791f);
            second = new Path();
            second.MoveTo(35f, 6.791f);
            second.RCubicTo(16.083f, 0f, 26.853f, 16.702f, 26.853f, 28.209f);
            ScalePath(first, density);
            ScalePath(second, density);
            joinedA = new JoinedPath(first, second);

            first = new Path();
            first.MoveTo(64.959f, 35f);
            first.RCubicTo(0f, 10.926f, -8.709f, 26.416f, -29.958f, 26.416f);
            second = new Path();
            second.MoveTo(35f, 61.416f);
            second.RCubicTo(-7.5f, 0f, -23.946f, -8.211f, -23.946f, -26.416f);
            ScalePath(first, density);
            ScalePath(second, density);
            joinedB     = new JoinedPath(first, second);
            _middleLine = new BridgingLine(joinedA, joinedB, this);

            // Bottom
            first = new Path();
            first.MoveTo(5.042f, 50f);
            first.CubicTo(2.5f, 43.312f, 0.013f, 26.546f, 9.475f, 17.346f);
            second = new Path();
            second.MoveTo(9.475f, 17.346f);
            second.RCubicTo(9.462f, -9.2f, 24.188f, -10.353f, 27.326f, -8.245f);
            ScalePath(first, density);
            ScalePath(second, density);
            joinedA = new JoinedPath(first, second);

            first = new Path();
            first.MoveTo(64.959f, 50f);
            first.RCubicTo(-7.021f, 10.08f, -20.584f, 19.699f, -37.361f, 12.74f);
            second = new Path();
            second.MoveTo(27.598f, 62.699f);
            second.RCubicTo(-15.723f, -6.521f, -18.8f, -23.543f, -18.8f, -25.642f);
            ScalePath(first, density);
            ScalePath(second, density);
            joinedB     = new JoinedPath(first, second);
            _bottomLine = new BridgingLine(joinedA, joinedB, this);
        }
 public BridgingLine(JoinedPath pathA, JoinedPath pathB, DrawerArrowDrawable drawable)
 {
     _drawable = drawable;
     _pathA    = pathA;
     _pathB    = pathB;
 }