Code examples for GradientDrawable

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
37:	mDrawPressed = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, 
-
39:	mDrawPressed.setShape(GradientDrawable.RECTANGLE); 
40:	mDrawPressed.setGradientRadius((float)(Math.sqrt(2) * 60)); 
41:	mDrawPressed.setCornerRadius(8); 
Full Snippet Info
8
CodeRank
558:	GradientDrawable gradDraw = new GradientDrawable(Orientation.TOP_BOTTOM, colors); 
559:	gradDraw.setDither(true); 
560:	gradDraw.setLevel(10000); 
561:	gradDraw.setBounds(0, 0, SLIDER_THICKNESS, PALETTE_DIM); 
562:	gradDraw.draw(mVerSliderCv); 
Full Snippet Info
7
CodeRank
587:	topShadow.setBounds(0, 0, getWidth(), getHeight() / visibleItems); 
588:	topShadow.draw(canvas); 
Full Snippet Info
7
CodeRank
400:	final GradientDrawable popupbackground = new GradientDrawable(); 
401:	popupbackground.setCornerRadius(cornerradiusDPI * getResources().getDisplayMetrics().density); 
402:	popupbackground.setStroke((int) (borderwidthDPI * getResources().getDisplayMetrics().density), bordercolor); 
403:	popupbackground.setColor(backgroundcolor); 
Full Snippet Info
6
CodeRank
36:	mDrawPressed = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, 
-
38:	mDrawPressed.setShape(GradientDrawable.RECTANGLE); 
39:	mDrawPressed.setGradientRadius((float)(Math.sqrt(2) * 60)); 
40:	mDrawPressed.setCornerRadius(8); 
Full Snippet Info
6
CodeRank
162:	GradientDrawable gradient = new GradientDrawable(Orientation.TL_BR, 
-
164:	gradient.setDither(true); 
165:	gradient.setBounds(padding, 0, getWidth() - padding, getGradHeight()); 
166:	gradient.draw(canvas); 
Full Snippet Info
6
CodeRank
88:	mGradientDrawable = new GradientDrawable(currentOrientation, mGradientColors); 
-
92:	ApiCompatibilityUtils.setBackgroundForView(mGradientView, mGradientDrawable); 
Full Snippet Info
6
CodeRank
55:	GradientDrawable gd = new GradientDrawable( ) ; 
56:	gd.setStroke(1,stroke); 
57:	gd.setCornerRadius (RADIUS) ; 
58:	gd.setColor ( background) ; 
59:	setBackgroundDrawable(gd) ; 
Full Snippet Info
6
CodeRank
34:	mDrawSelected = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, 
-
36:	mDrawSelected.setShape(GradientDrawable.RECTANGLE); 
37:	mDrawSelected.setGradientRadius((float)(Math.sqrt(2) * 60)); 
38:	mDrawSelected.setCornerRadius(8); 
Full Snippet Info
6
CodeRank
103:	GradientDrawable gd = new GradientDrawable(); 
104:	gd.setColor(cardColor); 
105:	gd.setCornerRadius(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30, context.getResources().getDisplayMetrics())); 
106:	gd.setStroke((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, context.getResources().getDisplayMetrics()), backgroundColor); 
Full Snippet Info
6
CodeRank
100:	mPreviewDrawable.setColor(color); 
101:	mPreviewDrawable.invalidateSelf(); 
Full Snippet Info
6
CodeRank
316:	if (mShowTopShadow) mShadow.draw(canvas); 
Full Snippet Info
6
CodeRank
250:	mBarGradient.setBounds(0, 0, (int)(width*size), mHeight); 
251:	mBarGradient.setColors(mGradientColors); 
252:	mBarGradient.draw(canvas); 
Full Snippet Info
6
CodeRank
145:	GradientDrawable borderLayer=new GradientDrawable(); 
-
147:	borderLayer.setStroke(borderBottomSize, Color.parseColor(this.baseVeilColor)); 
148:	borderLayer.setCornerRadius(this.cornerRadius); 
149:	borderLayer.setColor(Color.TRANSPARENT); 
150:	layers.add(borderLayer); 
Full Snippet Info
6
CodeRank
36:	mDrawPressed = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, 
-
38:	mDrawPressed.setShape(GradientDrawable.RECTANGLE); 
39:	mDrawPressed.setGradientRadius((float)(Math.sqrt(2) * 60)); 
40:	mDrawPressed.setCornerRadius(8); 
Full Snippet Info
6
CodeRank
56:	GradientDrawable gradient = new GradientDrawable(Orientation.TL_BR, colors); 
57:	gradient.setGradientType(GradientDrawable.RADIAL_GRADIENT); 
58:	gradient.setGradientRadius(radius); 
59:	gradient.setGradientCenter(0.5f, 0.5f); 
Full Snippet Info
6
CodeRank
59:	drawable.setCornerRadii(new float[] { r0, r0, r1, r1, 
-
65:	mDrawable.setBounds(mRect); 
-
71:	mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); 
-
73:	mDrawable.draw(canvas); 
-
78:	mDrawable.setGradientType(GradientDrawable.RADIAL_GRADIENT); 
-
80:	mDrawable.draw(canvas); 
-
87:	mDrawable.setGradientType(GradientDrawable.SWEEP_GRADIENT); 
-
89:	mDrawable.draw(canvas); 
-
94:	mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT); 
-
96:	mDrawable.draw(canvas); 
-
103:	mDrawable.setGradientType(GradientDrawable.RADIAL_GRADIENT); 
-
105:	mDrawable.draw(canvas); 
-
110:	mDrawable.setGradientType(GradientDrawable.SWEEP_GRADIENT); 
-
112:	mDrawable.draw(canvas); 
Full Snippet Info
5
CodeRank
37:	mDrawPressed = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, 
-
39:	mDrawPressed.setShape(GradientDrawable.RECTANGLE); 
40:	mDrawPressed.setGradientRadius((float)(Math.sqrt(2) * 60)); 
41:	mDrawPressed.setCornerRadius(8); 
Full Snippet Info
6
CodeRank