Best code examples for Android ShapeDrawable class (android.graphics.drawable.ShapeDrawable)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ShapeDrawable class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android ShapeDrawable examples from Open Source projects
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
59:	ShapeDrawable shape = new ShapeDrawable(new RectShape()); 
60:	shape.setIntrinsicHeight(height); 
61:	shape.setIntrinsicWidth(width); 
62:	shape.getPaint().setColor(color); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getPaint
107:	ShapeDrawable drawable = new ShapeDrawable(circle); 
108:	ShapeHolder shapeHolder = new ShapeHolder(drawable); 
-
115:	Paint paint = drawable.getPaint(); //new Paint(Paint.ANTI_ALIAS_FLAG); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getPaint
16:	ShapeDrawable shapeDrawable = new ShapeDrawable(); 
17:	Paint paint = shapeDrawable.getPaint(); 
-
19:	assertThat(shapeDrawable.getPaint()).isSameAs(paint); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setIntrinsicHeight, setIntrinsicWidth
120:	painter.setIntrinsicWidth(width); 
121:	painter.setIntrinsicHeight(height); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setShape, resize
88:	Shape s1 = new OvalShape(); 
89:	s1.resize(mIndicatorSize, mIndicatorSize); 
-
102:	((ShapeDrawable) activeDrawable).setShape(s1); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPaint
328:	ShapeDrawable drawable = new ShapeDrawable(rr); 
329:	drawable.getPaint().setColor(badgeColor); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPaint
109:	ShapeDrawable drawable = new ShapeDrawable(circle); 
110:	ShapeHolder shapeHolder = new ShapeHolder(drawable); 
-
117:	Paint paint = drawable.getPaint(); //new Paint(Paint.ANTI_ALIAS_FLAG); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: ofInt, setBounds, getPaint
52:	myShapeDrawable = new ShapeDrawable(shape); 
53:	myShapeDrawable.getPaint().set(paint); 
54:	myShapeDrawable.setBounds(125, 225, 275, 375); 
-
61:	ObjectAnimator a = ObjectAnimator.ofInt(myShapeDrawable, "alpha", 0, 100); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setShaderFactory, setShape
74:	PaintDrawable drawable = new PaintDrawable(); 
75:	drawable.setShape(new RectShape()); 
76:	drawable.setShaderFactory(getShaderFactory(startX, endX)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth, setShape
41:	ShapeDrawable rectangle = new ShapeDrawable (); 
42:	rectangle.setShape(new RectShape()); 
43:	rectangle.setIntrinsicHeight(100); 
44:	rectangle.setIntrinsicWidth(200); 
45:	rectangle.getPaint().setColor(Color.GREEN); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint, setShape
61:	ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape()); 
62:	Paint paint = shapeDrawable.getPaint(); 
-
64:	shapeDrawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight()); 
65:	shapeDrawable.draw(canvas); 
66:	shapeDrawable.setShape(new ArcShape(60, 240)); 
67:	shapeDrawable.setBounds(0, 160, 200, 310); 
68:	shapeDrawable.draw(canvas); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPaint
328:	ShapeDrawable drawable = new ShapeDrawable(rr); 
329:	drawable.getPaint().setColor(badgeColor); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getBounds, invalidateSelf, getPaint
112:	mPreviousBoxBackground.getPaint().setShader(getPreviewBackground(mPreviousColor, mPreviousBoxBackground.getBounds())); 
-
114:	mPreviousBoxBackground.invalidateSelf(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, getPaint
53:	drawable = new ShapeDrawable(shape); 
54:	drawable.getPaint().set(paint); 
55:	drawable.setBounds(125, 225, 275, 375); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, setAlpha
252:	mTabDrawable.setBounds(viewLeft - mTabPadding, 
-
256:	mTabDrawable.setAlpha(alpha); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint
105:	ShapeDrawable drawable = new ShapeDrawable(circle); 
-
113:	Paint paint = drawable.getPaint(); //new Paint(Paint.ANTI_ALIAS_FLAG); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setIntrinsicHeight, setIntrinsicWidth
80:	painter.setIntrinsicWidth(width); 
81:	painter.setIntrinsicHeight(height); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds, getPaint
52:	myShapeDrawable = new ShapeDrawable(shape); 
53:	myShapeDrawable.getPaint().set(paint); 
54:	myShapeDrawable.setBounds(125, 225, 275, 375); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint
31:	ShapeDrawable mDrawable = new ShapeDrawable(new OvalShape()); 
32:	Paint paint = mDrawable.getPaint(); 
-
36:	mDrawable.setBounds((int)(x-xradius), (int)(y-yradius), (int)(x + xradius*2.0d), (int)(y + yradius*2.0d)); 
-
38:	mDrawable.draw(canvas);	//draws mDrawable to canvas 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint
129:	ShapeDrawable drawable = new ShapeDrawable(circle); 
-
137:	Paint paint = drawable.getPaint(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setIntrinsicHeight, setIntrinsicWidth
120:	painter.setIntrinsicWidth(width); 
121:	painter.setIntrinsicHeight(height); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds
54:	drawable = new ShapeDrawable(new RectShape()); 
55:	drawable.setBounds(0,0, 50, 50); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint, setShape
61:	ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape()); 
62:	Paint paint = shapeDrawable.getPaint(); 
-
64:	shapeDrawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight()); 
65:	shapeDrawable.draw(canvas); 
66:	shapeDrawable.setShape(new ArcShape(60, 240)); 
67:	shapeDrawable.setBounds(0, 160, 200, 310); 
68:	shapeDrawable.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, getPaint
46:	drawable = new ShapeDrawable(shape); 
47:	drawable.getPaint().set(paint); 
48:	drawable.setBounds(125, 225, 275, 375); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint
144:	ShapeDrawable drawable = new ShapeDrawable(circle); 
-
152:	Paint paint = drawable.getPaint(); //new Paint(Paint.ANTI_ALIAS_FLAG); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds, draw
35:	ShapeDrawable cover = new ShapeDrawable(new RectShape()); 
-
38:	cover.setBounds(left+coverLeft, top+offset, left+width, top+height+offset); 
39:	cover.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
93:	mDrawables[0] = new ShapeDrawable(new RectShape()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
59:	ShapeDrawable shape = new ShapeDrawable(new RectShape()); 
60:	shape.setIntrinsicHeight(height); 
61:	shape.setIntrinsicWidth(width); 
62:	shape.getPaint().setColor(color); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getBounds, setBounds, draw, getPaint
75:	ShapeDrawable drawable = new ShapeDrawable(tile); 
76:	drawable.setBounds(margin, margin, rht, bot); 
77:	drawable.getPaint().setShader(new LinearGradient(margin, margin, rht, bot, colors, null, Shader.TileMode.REPEAT)); 
78:	drawable.draw(canvas); 
-
85:	Rect r = drawable.getBounds(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint
66:	shape.getPaint().setColor(value); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint
94:	ShapeDrawable stoneDrawable = new ShapeDrawable(new OvalShape()); 
95:	Paint blackStonePaint = stoneDrawable.getPaint(); 
-
102:	stoneDrawable.setBounds(SHADOW_SIZE, SHADOW_SIZE, realStoneSize - SHADOW_SIZE, realStoneSize - SHADOW_SIZE); 
103:	stoneDrawable.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint
92:	mShapeDrawableQQ = new ShapeDrawable(new OvalShape()); 
-
95:	mShapeDrawableQQ.getPaint().setShader(mBitmapShader); 
-
98:	mShapeDrawableQQ.setBounds(0,0, BitQQwidth, BitQQheight); 
-
101:	mShapeDrawableQQ.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
89:	d = new ShapeDrawable(new PathShape(p, 100, 100)); 
90:	d.setIntrinsicHeight(100); 
91:	d.setIntrinsicWidth(100); 
92:	d.getPaint().setColor(Color.YELLOW); 
93:	d.getPaint().setStyle(Paint.Style.STROKE); 
-
102:	mView.setDrawable(d); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint
105:	ShapeDrawable drawable = new ShapeDrawable(circle); 
106:	ShapeHolder shapeHolder = new ShapeHolder(drawable); 
-
113:	Paint paint = drawable.getPaint(); //new Paint(Paint.ANTI_ALIAS_FLAG); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setShape
299:	border = new PaintDrawable(); 
300:	border.setShape(new RoundRectShape(roundedCorner, null, roundedCorner)); 
301:	border.getPaint().setColor(color); 
302:	border.getPaint().setStyle(Style.STROKE); 
303:	border.getPaint().setStrokeWidth(borderWidth); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, getPaint
23:	mDrawable = new ShapeDrawable(new RectShape()); 
24:	mDrawable.getPaint().setColor(0xff74AC23); 
25:	mDrawable.setBounds(x, y, x + width, y + height); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint
173:	ShapeDrawable drawable = new ShapeDrawable(circle); 
-
181:	Paint paint = drawable.getPaint(); //new Paint(Paint.ANTI_ALIAS_FLAG); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint
92:	mShapeDrawableQQ = new ShapeDrawable(new OvalShape()); 
-
95:	mShapeDrawableQQ.getPaint().setShader(mBitmapShader); 
-
98:	mShapeDrawableQQ.setBounds(0,0, BitQQwidth, BitQQheight); 
-
101:	mShapeDrawableQQ.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, getPaint
26:	this.bars.add(newBar(x, y, width, height, Color.RED)); 
-
30:	ShapeDrawable bar = new ShapeDrawable(new RectShape()); 
31:	bar.getPaint().setColor(color); 
32:	bar.setBounds(x, y, x + width, y + height); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, draw
43:	ShapeDrawable cover = new ShapeDrawable(new RectShape()); 
-
46:	cover.setBounds(left+coverLeft, top+offset, left+width, top+height+offset); 
47:	cover.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setPadding
434:	ShapeDrawable innerShape = new ShapeDrawable(new RectShape()); 
435:	Paint innerPaint = innerShape.getPaint(); 
-
439:	innerShape.setPadding(0, 0, 0, innerPadding); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
22:	ShapeDrawable oval = new ShapeDrawable(new OvalShape()); 
23:	oval.setIntrinsicHeight(100); 
24:	oval.setIntrinsicWidth(100); 
25:	oval.getPaint().setColor(Color.RED); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, draw, getPaint
94:	mShapeDrawableQQ = new ShapeDrawable(new OvalShape()); 
-
97:	mShapeDrawableQQ.getPaint().setShader(mBitmapShader); 
-
100:	mShapeDrawableQQ.setBounds(0,0, BitQQwidth, BitQQheight); 
-
103:	mShapeDrawableQQ.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
16:	ShapeDrawable shape = new ShapeDrawable(pathShape); 
17:	shape.getPaint().setColor(Color.WHITE); 
18:	shape.getPaint().setStyle(Style.STROKE); 
19:	shape.setIntrinsicWidth(20); 
20:	shape.setIntrinsicHeight(15); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
25:	ShapeDrawable shape = new ShapeDrawable(pathShape); 
26:	shape.getPaint().setColor(Color.WHITE); 
27:	shape.getPaint().setStyle(Style.STROKE); 
28:	shape.setIntrinsicWidth(50); 
29:	shape.setIntrinsicHeight(50); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
17:	ShapeDrawable shape = new ShapeDrawable(pathShape); 
18:	shape.getPaint().setColor(Color.WHITE); 
19:	shape.getPaint().setStyle(Style.STROKE); 
20:	shape.setIntrinsicWidth(20); 
21:	shape.setIntrinsicHeight(15); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPaint, setIntrinsicHeight, setIntrinsicWidth
9:	ShapeDrawable portion = new ShapeDrawable(new ArcShape(initAngle, angle)); 
10:	portion.setIntrinsicHeight(1000); 
11:	portion.setIntrinsicWidth(1000); 
12:	portion.getPaint().setColor(color); 
Full Snippet Info
6
CodeRank
Related Android ShapeDrawable Questions & Answers:
See Code Examples for Android ShapeDrawable Methods: