Inheritance: java.lang.Object
コード例 #1
0
ファイル: ColorFilters.cs プロジェクト: hakeemsm/XobotOS
		private static void addToTheRight (Drawable curr, Drawable prev)
		{
			Rect r = prev.getBounds ();
			int x = r.right + 12;
			int center = (r.top + r.bottom) >> 1;
			int h = curr.getIntrinsicHeight ();
			int y = center - (h >> 1);

			curr.setBounds (x, y, x + curr.getIntrinsicWidth (), y + h);
		}
コード例 #2
0
ファイル: ColorFilters.cs プロジェクト: hakeemsm/XobotOS
		public ColorFilters (Context context)
			: base (context)
		{
			mDrawable = getResources ().getDrawable (R.drawable.btn_default_normal);
			mDrawable.setBounds (0, 0, 150, 48);
			mDrawable.setDither (true);

			int[] resIDs = new int[] {
				R.drawable.btn_circle_normal,
				R.drawable.btn_check_off,
				R.drawable.btn_check_on
			};
			mDrawables = new Drawable[resIDs.Length];
			Drawable prev = mDrawable;
			for (int i = 0; i < resIDs.Length; i++) {
				mDrawables [i] = getResources ().getDrawable (resIDs [i]);
				mDrawables [i].setDither (true);
				addToTheRight (mDrawables [i], prev);
				prev = mDrawables [i];
			}

			mPaint = new Paint ();
			mPaint.setAntiAlias (true);
			mPaint.setTextSize (16);
			mPaint.setTextAlign (Paint.Align.CENTER);

			mPaint2 = new Paint (mPaint);
			mPaint2.setAlpha (64);

			Paint.FontMetrics fm = mPaint.getFontMetrics ();
			mPaintTextOffset = (fm.descent + fm.ascent) * 0.5f;

			mColors = new uint[] {
				0, 0xCC0000FF, 0x880000FF, 0x440000FF, 0xFFCCCCFF,
				0xFF8888FF, 0xFF4444FF
			};

			mModes = new PorterDuff.Mode[] {
				PorterDuff.Mode.SRC_ATOP, PorterDuff.Mode.MULTIPLY,
			};
			mModeIndex = 0;

			updateTitle ();
		}
コード例 #3
0
ファイル: Monkey.cs プロジェクト: hakeemsm/XobotOS
		public Monkey (string name, Drawable drawable, int res)
		{
			this.Name = name;
			this.Drawable = drawable;
			this.ResourceId = res;
		}
コード例 #4
0
ファイル: XobotWindow.cs プロジェクト: hakeemsm/XobotOS
		public override void setChildDrawable (int featureId, Drawable drawable)
		{
			throw new NotImplementedException ();
		}
コード例 #5
0
ファイル: XobotWindow.cs プロジェクト: hakeemsm/XobotOS
		public override void setBackgroundDrawable (Drawable drawable)
		{
			throw new NotImplementedException ();
		}