Наследование: java.lang.Object, android.os.Parcelable
Пример #1
0
		static void drawCentered (Canvas c, Rect r, Paint p)
		{
			float inset = p.getStrokeWidth () * 0.5f;
			if (inset == 0) {   // catch hairlines
				inset = 0.5f;
			}
			c.drawRect (r.left + inset, r.top + inset,
                	r.right - inset, r.bottom - inset, p);
		}
Пример #2
0
		public RoundRects (Context context)
			: base (context)
		{
			mRect = new Rect (0, 0, 120, 120);

			int[] colors = {
				unchecked((int)0xFFFF0000), unchecked((int)0xFF00FF00), unchecked((int)0xFF0000FF)
			};

			mDrawable = new GradientDrawable (GradientDrawable.Orientation.TL_BR, colors);
			mDrawable.setShape (GradientDrawable.RECTANGLE);
			mDrawable.setGradientRadius ((float)(Math.Sqrt (2) * 60));
		}
Пример #3
0
		public override string ToString ()
		{
			StringBuilder sb = new StringBuilder ();
			sb.Append ("Region[");

			bool first = true;
			using (RegionIterator iter = new RegionIterator (this)) {
				Rect r = new Rect ();
				while (iter.next (r)) {
					string text = String.Format (
						"[{0},{0},{0},{0}]", r.left, r.top, r.right, r.bottom);
					if (first)
						first = false;
					else
						sb.Append (",");
					sb.Append (text);
				}
			}
			sb.Append ("]");
			return sb.ToString ();
		}
Пример #4
0
		void drawRgn (Canvas canvas, int color, String str, Region.Op op)
		{
			if (str != null) {
				mPaint.setColor (Color.BLACK);
				canvas.drawText (str, 80, 24, mPaint);
			}

			Region rgn = new Region ();
			rgn.set (mRect1);
			rgn.op (mRect2, op);

			mPaint.setColor (color);
			RegionIterator iter = new RegionIterator (rgn);
			Rect r = new Rect ();

			canvas.translate (0, 30);
			mPaint.setColor (color);
			while (iter.next(r)) {
				canvas.drawRect (r, mPaint);
			}
			drawOriginalRects (canvas, 0x80);
		}
Пример #5
0
 public override void draw(Canvas canvas)
 {
     Rect bounds = Bounds;
     int height = bounds.height();
     paint.TextSize = height;
     Rect textBounds = new Rect();
     string textValue = icon.character().ToString();
     paint.getTextBounds(textValue, 0, 1, textBounds);
     int textHeight = textBounds.height();
     float textBottom = bounds.top + (height - textHeight) / 2f + textHeight - textBounds.bottom;
     canvas.drawText(textValue, bounds.exactCenterX(), textBottom, paint);
 }
Пример #6
0
		public bool requestChildRectangleOnScreen (View child, Rect rectangle, bool immediate)
		{
			return false;
		}
Пример #7
0
		public bool getChildVisibleRect (View child, Rect r, Point offset)
		{
			throw new NotImplementedException ();
		}
Пример #8
0
		public ViewParent invalidateChildInParent (int[] location, Rect r)
		{
			XobotActivityManager.RequestInvalidate (this);
			return null;
		}
Пример #9
0
		public void invalidateChild (View child, Rect r)
		{
			XobotActivityManager.RequestInvalidate (this);
		}
Пример #10
0
 public Canvas lockCanvas(Rect inOutDirty) { throw null; }