|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nostra13.universalimageloader.core.imageaware.ImageViewAware
public class ImageViewAware
Wrapper for Android ImageView
. Keeps weak reference of ImageView to prevent memory
leaks.
Field Summary | |
---|---|
protected boolean |
checkActualViewSize
|
protected Reference<android.widget.ImageView> |
imageViewRef
|
Constructor Summary | |
---|---|
ImageViewAware(android.widget.ImageView imageView)
Constructor. |
|
ImageViewAware(android.widget.ImageView imageView,
boolean checkActualViewSize)
Constructor |
Method Summary | |
---|---|
int |
getHeight()
Returns height of image aware view. |
int |
getId()
Returns ID of image aware view. |
ViewScaleType |
getScaleType()
Returns scale type which is used for scaling image for this image aware view. |
int |
getWidth()
Returns width of image aware view. |
android.widget.ImageView |
getWrappedView()
Returns wrapped Android View . |
boolean |
isCollected()
Returns a flag whether image aware view is collected by GC or whatsoever. |
boolean |
setImageBitmap(android.graphics.Bitmap bitmap)
Sets image bitmap into this image aware view. |
boolean |
setImageDrawable(android.graphics.drawable.Drawable drawable)
Sets image drawable into this image aware view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Reference<android.widget.ImageView> imageViewRef
protected boolean checkActualViewSize
Constructor Detail |
---|
public ImageViewAware(android.widget.ImageView imageView)
ImageViewAware(imageView, true)
.
imageView
- ImageView
to work withpublic ImageViewAware(android.widget.ImageView imageView, boolean checkActualViewSize)
imageView
- ImageView
to work withcheckActualViewSize
- true - then getWidth()
and getHeight()
will check actual
size of ImageView. It can cause known issues like
this.
But it helps to save memory because memory cache keeps bitmaps of actual (less in
general) size.
false - then getWidth()
and getHeight()
will NOT
consider actual size of ImageView, just layout parameters. Method Detail |
---|
public int getWidth()
view
parameters, configuration
parameters or device display dimensions.
getWidth
in interface ImageAware
public int getHeight()
view
parameters, configuration
parameters or device display dimensions.
getHeight
in interface ImageAware
public ViewScaleType getScaleType()
ImageAware
getScaleType
in interface ImageAware
public android.widget.ImageView getWrappedView()
ImageAware
View
. Can return null if no view is wrapped.
getWrappedView
in interface ImageAware
public boolean isCollected()
ImageAware
ImageLoadingListener#onLoadingCancelled(String, View)
callback.
isCollected
in interface ImageAware
public int getId()
ImageAware
getId
in interface ImageAware
public boolean setImageDrawable(android.graphics.drawable.Drawable drawable)
ImageAware
BitmapDisplayer
.
setImageDrawable
in interface ImageAware
public boolean setImageBitmap(android.graphics.Bitmap bitmap)
ImageAware
Bitmap
in this image view aware.
Actually it's used only in
BitmapDisplayer
.
setImageBitmap
in interface ImageAware
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |