Best code examples for ImageView getDrawable method (android.widget.ImageView.getDrawable)

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

ImageView getDrawable examples from Open Source projects
This code example shows how to use the following methods: getDrawable, setImageDrawable, getTag, setTag
181:	if (thumbImageView.getTag() != null 
182:	&& thumbImageView.getTag().equals(tempThumbnailImageFileName)) { 
-
187:	final BitmapWorkerTask task = new BitmapWorkerTask(thumbImageView, 
-
192:	thumbImageView.setImageDrawable(asyncDrawable); 
193:	thumbImageView.setTag(tempThumbnailImageFileName); 
-
231:	final Drawable drawable = imageView.getDrawable(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getDrawable, setImageMatrix, layout
262:	Drawable d = imageView.getDrawable(); 
-
391:	imageView.setImageMatrix(getViewMatrix()); 
-
399:	imageView.layout(parentLeft, parentTop, parentRight, parentBottom); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getDrawable, getBackground, getHeight, getPaddingBottom, getPaddingTop
71:	int nextHeight = Math.max(mNext.getDrawable().getIntrinsicHeight() + mNext.getPaddingTop() 
72:	+ mNext.getPaddingBottom(), 
73:	mNext.getBackground().getMinimumHeight()); 
-
77:	assertEquals("Next incorrect height", nextHeight, mNext.getHeight()); 
-
80:	assertEquals("Next wrong top", (pauseHeight - nextHeight) / 2, mNext.getTop()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
47:	Drawable placeholder = target.getDrawable(); 
-
50:	target.setImageDrawable(drawable); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getDrawable, setImageResource, setScaleType, setLayoutParams
169:	ImageView i = new ImageView(mContext); 
170:	i.setImageResource(mImageIds[position]); 
171:	i.setLayoutParams(new CoverFlow.LayoutParams(130, 130)); 
172:	i.setScaleType(ImageView.ScaleType.CENTER_INSIDE); 
-
175:	BitmapDrawable drawable = (BitmapDrawable) i.getDrawable(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable
114:	if (destination != null && destination.getDrawable() == temporaryDrawable) { 
115:	handler.post(new Runnable() { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap, setOnClickListener
60:	ImageView closeImageView = new ImageView(GameActivity.getContext()); 
61:	closeImageView.setOnClickListener(new View.OnClickListener() { 
-
82:	closeImageView.setImageBitmap(BitmapFactory.decodeByteArray(closeBytes, 0, closeBytes.length)); 
83:	int margin = closeImageView.getDrawable().getIntrinsicWidth() / 2; 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, getHeight, getWidth
92:	BitmapDrawable bd = (BitmapDrawable) colormap.getDrawable(); 
-
97:	int x = (int) ((event.getX()-15) * bitmap.getWidth() / (colormap.getWidth()-30)); 
98:	int y = (int) ((event.getY()-15) * bitmap.getHeight() / (colormap.getHeight()-30)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
55:	v.setImageDrawable(states); 
-
73:	final Drawable d = v.getDrawable(); 
-
91:	final Drawable d = v.getDrawable(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable, getResources
39:	Resources resources = imageView.getResources(); 
-
47:	Drawable currentDrawable = imageView.getDrawable(); 
-
55:	imageView.setImageDrawable(transitionDrawable); 
-
60:	imageView.setImageDrawable(drawable); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
51:	states.addState(new int[] {}, v.getDrawable()); 
52:	v.setImageDrawable(states); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, getBackground, getHeight, getPaddingBottom, getPaddingTop
65:	int pauseHeight =  Math.max(mPause.getDrawable().getIntrinsicHeight() 
66:	+ mPause.getPaddingTop() + mPause.getPaddingBottom(), 
67:	mPause.getBackground().getMinimumHeight()); 
-
75:	assertEquals("Pause incorrect height", pauseHeight, mPause.getHeight()); 
-
78:	assertEquals("Pause wrong top", 0, mPause.getTop()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
141:	BitmapDownloaderTask task = new BitmapDownloaderTask(imageView); 
-
143:	imageView.setImageDrawable(downloadedDrawable); 
-
190:	Drawable drawable = imageView.getDrawable(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getDrawable, getResources
98:	final DownloadBitmapTask task = new DownloadBitmapTask(imageView, resultReceiver); 
-
100:	new AsyncDrawable(imageView.getResources(), mPlaceHolder, task); 
-
126:	final Drawable drawable = imageView.getDrawable(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setVisibility, setClickable, setEnabled
140:	Drawable drawable = imageView.getDrawable(); 
-
205:	imageView.setVisibility(View.GONE); 
206:	imageView.setClickable(false); 
207:	imageView.setEnabled(false); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable, getContext, setMinimumHeight
90:	BitmapFetcherTask task = new BitmapFetcherTask(imageView.getContext(), imageView); 
91:	DownloadedDrawable downloadedDrawable = new DownloadedDrawable(imageView.getContext(), task, origId); 
92:	imageView.setImageDrawable(downloadedDrawable); 
93:	imageView.setMinimumHeight(colWidth); 
-
122:	MediaStore.Images.Thumbnails.cancelThumbnailRequest(imageView.getContext().getContentResolver(), 
-
140:	Drawable drawable = imageView.getDrawable(); 
-
151:	Drawable drawable = imageView.getDrawable(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable
73:	ANDROID.assertThat(closeButton).isVisible(); 
74:	StateListDrawable states = (StateListDrawable) closeButton.getDrawable(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
117:	Drawable existingDrawable = imageView.getDrawable(); 
-
126:	imageView.setImageDrawable(transitionDrawable); 
-
129:	imageView.setImageDrawable(drawable); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap, setImageDrawable
128:	Drawable existingDrawable = imageView.getDrawable(); 
-
139:	imageView.setImageDrawable(transitionDrawable); 
-
142:	imageView.setImageBitmap(bitmap); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap
257:	Drawable drawable = mArrow.getDrawable(); 
-
266:	mArrow.setImageBitmap(bitmap); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable
24:	.getDrawable(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap, postInvalidate
229:	view.setImageBitmap(b); 
-
233:	final Drawable drawable = view.getDrawable(); 
-
237:	view.postInvalidate(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable
70:	item.mImageView.setImageDrawable(mImageView.getDrawable()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable
14:	super(theView); 
-
16:	hasDrawable = theView.getDrawable() != null; 
-
19:	drawableRect = theView.getDrawable().getBounds(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable
61:	Drawable d = mImageView.getDrawable(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap, setImageURI, setScaleType
227:	bild.setImageBitmap(BitmapFactory.decodeFile(picturePath)); 
228:	bild.setScaleType(ScaleType.CENTER_INSIDE); 
-
241:	bild.setImageURI(Uri.fromFile(file)); 
242:	bild.setScaleType(ScaleType.CENTER_INSIDE); 
-
245:	App.selbst.getProfil().setAvatar(bild.getDrawable()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap, postInvalidate
219:	view.setImageBitmap(b); 
-
223:	final Drawable drawable = view.getDrawable(); 
-
227:	view.postInvalidate(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable
159:	return profilePicture.getDrawable(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
188:	Drawable drawable = imageView.getDrawable(); 
-
190:	imageView.setImageDrawable(drawable); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDrawable, setImageBitmap, getTag
458:	String forUrl = (String) imageView.getTag(); 
-
467:	imageView.setImageBitmap(resizeBitmap); 
468:	((BitmapDrawable) imageView.getDrawable()).setAntiAlias(true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable
108:	else if(isClicked&&(event.getAction() == MotionEvent.ACTION_MOVE) && NMath.isViewContains(mImageButton,event.getX(), event.getY())){ 
109:	Drawable d = mImageButton.getDrawable(); 
-
111:	mImageButton.setImageDrawable(d); 
-
115:	Drawable d = mImageButton.getDrawable(); 
-
117:	mImageButton.setImageDrawable(d); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDrawable, setImageDrawable, getContext
259:	Resources res = imageView.getContext().getResources(); 
-
261:	Drawable currentDrawable = imageView.getDrawable(); 
-
280:	imageView.setImageDrawable(colorChoiceDrawable); 
Full Snippet Info
5
CodeRank
Related ImageView getDrawable Questions & Answers:
Displays an arbitrary image, such as an icon. The ImageView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the image so that it can be used in any layout manager, and pr...
getDrawable Method Overview
Return the view's drawable, or null if no drawable has been assigned.
See Also
  • setAdjustViewBounds
    Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.
  • setAlpha
    This method was deprecated in API level 16. use #setImageAlpha(int) instead
  • setImageURI
    Sets the content of this ImageView to the specified Uri.
  • setMaxHeight
    An optional argument to supply a maximum height for this view.
  • setMaxWidth
    An optional argument to supply a maximum width for this view.
  • setScaleType
    Controls how the image should be resized or moved to match the size of this ImageView.