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

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

Android LayerDrawable examples from Open Source projects
This code example shows how to use the following methods: setLayerInset
336:	LayerDrawable ld = new LayerDrawable(new Drawable[]{item0, item1}); 
337:	ld.setLayerInset(1, dipToInt(4f), dipToInt(1f), dipToInt(4f), dipToInt(1f)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayerInset
792:	LayerDrawable d = new LayerDrawable(array); 
793:	d.setLayerInset(1, 1, 1, 1, 1); 
794:	d.setLayerInset(2, 2, 2, 2, 2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setLayerInset
197:	LayerDrawable d = new LayerDrawable(array); 
198:	d.setLayerInset(1, 1, 1, 1, 1); 
199:	d.setLayerInset(2, 2, 2, 2, 2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId
55:	progressLayerDrawable.setId(1, android.R.id.secondaryProgress); 
56:	progressLayerDrawable.setId(2, android.R.id.progress); 
57:	 
58:	//Copy the existing ProgressDrawable bounds to the new one. 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBounds, getIntrinsicHeight, getIntrinsicWidth, setId
148:	return new LayerDrawable(layers); 
-
263:	drawable.setId(backgroundIndex, android.R.id.background); 
-
265:	int w = drawable.getIntrinsicWidth(); 
266:	int h = drawable.getIntrinsicHeight(); 
267:	drawable.setBounds(0, 0, w, h); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
153:	return new LayerDrawable(layers); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setLayerInset
173:	LayerDrawable layerDrawable= new LayerDrawable(layers.<Drawable>toArray(new Drawable[layers.size()])); 
-
177:	layerDrawable.setLayerInset(BACKGROUND_LAYER,0,0,0,principalEdges); 
-
179:	layerDrawable.setLayerInset(IMAGE_LAYER,0,0,0,principalEdges); 
-
181:	layerDrawable.setLayerInset(BORDER_LAYER,0,0,0,((int)NOT_EXICITED_BOTTOM_BORDER_SHADOW_DPI)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
78:	if( nodes != null && nodes.getLength() > 0 ) { return new LayerDrawable( null ); } 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setCallback, scheduleDrawable
19:	LayerDrawable ld = new LayerDrawable(new Drawable[] { 
-
23:	ld.setCallback(new Callback() { 
-
38:	ld.scheduleDrawable(ld, new Runnable() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getBounds, findDrawableByLayerId
50:	final int width = layerDrawable.getBounds().right - layerDrawable.getBounds().left; 
-
55:	Drawable primaryProgressDrawable = layerDrawable.findDrawableByLayerId(android.R.id.progress); 
56:	Drawable secondaryProgressDrawable = layerDrawable.findDrawableByLayerId(android.R.id.secondaryProgress); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
30:	addState(new int[] {attr.state_pressed}, new LayerDrawable(new Drawable[] {getHighlightDrawable(context)/*, unselectedPressed*/})); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setId
82:	ld = new LayerDrawable( list ); 
83:	ld.setId( 0, android.R.id.background ); 
84:	ld.setId( 1, android.R.id.progress ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setLayerInset
86:	LayerDrawable layerDrawable = new LayerDrawable(layers); 
87:	layerDrawable.setLayerInset(0, 0, 0, 0, 0); 
88:	layerDrawable.setLayerInset(1, 0, 0, 0, 0); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setLayerInset
792:	LayerDrawable d = new LayerDrawable(array); 
793:	d.setLayerInset(1, 1, 1, 1, 1); 
794:	d.setLayerInset(2, 2, 2, 2, 2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setBounds, getIntrinsicHeight, getIntrinsicWidth, setId
148:	return new LayerDrawable(layers); 
-
263:	drawable.setId(backgroundIndex, android.R.id.background); 
-
265:	int w = drawable.getIntrinsicWidth(); 
266:	int h = drawable.getIntrinsicHeight(); 
267:	drawable.setBounds(0, 0, w, h); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setLayerInset
236:	LayerDrawable layersList=new LayerDrawable(layers); 
-
242:	layersList.setLayerInset(backgroundLayerIndex,(drawLeftBorder?offsetPadding:0),0,0,offsetPadding); 
243:	layersList.setLayerInset(borderLayerIndex,0,0,0,(shadowSize)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable
145:	iconDrawable.getDrawable(0).setColorFilter( 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setLayerInset
202:	LayerDrawable d = new LayerDrawable(array); 
203:	d.setLayerInset(1, 1, 1, 1, 1); 
204:	d.setLayerInset(2, 2, 2, 2, 2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setColorFilter, getDrawable
66:	Drawable icon = background.getDrawable(1); 
-
70:	background.setColorFilter(COLOR_BACKGROUND_ON, 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, setLayerInset
117:	pieceDrawable.setLayerInset(level, l, t, r, b); 
118:	((BitmapDrawable) pieceDrawable.getDrawable(level)).setGravity(Gravity.LEFT | Gravity.TOP); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, getNumberOfLayers
58:	if (visibleRoom > 0 && visibleRoom < layerDrawable.getNumberOfLayers()) { 
59:	layerDrawable.getDrawable(visibleRoom).setColorFilter(accentColor, Mode.SRC_ATOP); 
60:	layerDrawable.getDrawable(visibleRoom).setAlpha(180); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setLayerInset
46:	LayerDrawable locationMarker = new LayerDrawable(layers); 
47:	locationMarker.setLayerInset(1, 1, 1, 1, 6); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable
154:	lDrawable.getDrawable(1).setCallback(null); 
155:	lDrawable.getDrawable(0).setCallback(null); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setLayerInset
43:	ld.setLayerInset(1, 0, topInset, 0, 0); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setDrawableByLayerId
118:	layerDrawable.setDrawableByLayerId( android.R.id.secondaryProgress, mCurrentDrawable ); 
Full Snippet Info
0
CodeRank
This code example shows how to use the following methods: findDrawableByLayerId
52:	layerDrawable.findDrawableByLayerId(com_android_internal_R_id_toggle); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
441:	return new LayerDrawable(new Drawable[] { innerShape, outerShape }); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, getNumberOfLayers
110:	bitmap = ((BitmapDrawable)transitionDrawable.getDrawable(transitionDrawable.getNumberOfLayers() - 1)).getBitmap(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
319:	LayerDrawable normalState = new LayerDrawable(drawNormal); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
80:	return new LayerDrawable(layers); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setLayerInset
786:	LayerDrawable d = new LayerDrawable(array); 
787:	d.setLayerInset(1, 1, 1, 1, 1); 
788:	d.setLayerInset(2, 2, 2, 2, 2); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
93:	imageView.setImageDrawable(new LayerDrawable(item.getDrawable())); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getDrawable
531:	Drawable d0 = d.getDrawable(0); 
532:	Drawable d1 = d.getDrawable(1); 
533:	Drawable d2 = d.getDrawable(2); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
46:	layer = new LayerDrawable( new Drawable[]{ outer, createLiquid(), bubble } ); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getBounds, setDrawableByLayerId
663:	drawable.setBounds(mLayers.getBounds()); 
664:	mLayers.setDrawableByLayerId(mLayerId, drawable); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
44:	layers = new LayerDrawable(new Drawable[] { pic, dotDraw }); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setLayerInset
88:	buttonImage.setLayerInset(1, (width - drawable.getMinimumWidth()) / 2, 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getDrawable
130:	iconDrawable.getDrawable(0).setColorFilter( 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: draw
116:	mLayerDrawable.draw(canvas); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getDrawable
194:	backgroundDrawable = layerDrawable.getDrawable(0); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods:
79:	return new LayerDrawable(null); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: draw
37:	ld.draw(canvas); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getDrawable
65:	BitmapDrawable bitmapDrawable1 = (BitmapDrawable) drawable.getDrawable(1); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getBounds
47:	final int width = d.getBounds().right - d.getBounds().left; 
Full Snippet Info
4
CodeRank
Related Android LayerDrawable Questions & Answers:
See Code Examples for Android LayerDrawable Methods: