|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nostra13.universalimageloader.core.imageaware.ViewAware
public abstract class ViewAware
Wrapper for Android View. Keeps weak reference of View to prevent memory leaks.
| Field Summary | |
|---|---|
protected boolean |
checkActualViewSize
|
protected Reference<android.view.View> |
viewRef
|
static String |
WARN_CANT_SET_BITMAP
|
static String |
WARN_CANT_SET_DRAWABLE
|
| Constructor Summary | |
|---|---|
ViewAware(android.view.View view)
Constructor. |
|
ViewAware(android.view.View view,
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.view.View |
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. |
protected abstract void |
setImageBitmapInto(android.graphics.Bitmap bitmap,
android.view.View view)
Should set Bitmap into incoming view. |
boolean |
setImageDrawable(android.graphics.drawable.Drawable drawable)
Sets image drawable into this image aware view. |
protected abstract void |
setImageDrawableInto(android.graphics.drawable.Drawable drawable,
android.view.View view)
Should set drawable into incoming view. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String WARN_CANT_SET_DRAWABLE
public static final String WARN_CANT_SET_BITMAP
protected Reference<android.view.View> viewRef
protected boolean checkActualViewSize
| Constructor Detail |
|---|
public ViewAware(android.view.View view)
ImageViewAware(imageView, true).
view - View to work with
public ViewAware(android.view.View view,
boolean checkActualViewSize)
view - View to work withcheckActualViewSize - true - then getWidth() and getHeight() will check actual
size of View. 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 View, just layout parameters. | Method Detail |
|---|
public int getWidth()
view parameters, configuration
parameters or device display dimensions.
getWidth in interface ImageAwarepublic int getHeight()
view parameters, configuration
parameters or device display dimensions.
getHeight in interface ImageAwarepublic ViewScaleType getScaleType()
ImageAware
getScaleType in interface ImageAwarepublic android.view.View getWrappedView()
ImageAwareView. Can return null if no view is wrapped or view was
collected by GC.
getWrappedView in interface ImageAwarepublic boolean isCollected()
ImageAwareImageLoadingListener#onLoadingCancelled(String, View) callback.
isCollected in interface ImageAwarepublic int getId()
ImageAware
getId in interface ImageAwarepublic boolean setImageDrawable(android.graphics.drawable.Drawable drawable)
ImageAwareBitmapDisplayer.< br />
Is called on UI thread if ImageLoader was called on UI thread. Otherwise - on background thread.
setImageDrawable in interface ImageAwarepublic boolean setImageBitmap(android.graphics.Bitmap bitmap)
ImageAwareBitmap in this image view aware.
Actually it's used only in
BitmapDisplayer.< br />
Is called on UI thread if ImageLoader was called on UI thread. Otherwise - on background thread.
setImageBitmap in interface ImageAware
protected abstract void setImageDrawableInto(android.graphics.drawable.Drawable drawable,
android.view.View view)
protected abstract void setImageBitmapInto(android.graphics.Bitmap bitmap,
android.view.View view)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||