public abstract class ViewAware extends Object implements ImageAware
View. Keeps weak reference of View to prevent memory leaks.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
checkActualViewSize |
protected Reference<android.view.View> |
viewRef |
static String |
WARN_CANT_SET_BITMAP |
static String |
WARN_CANT_SET_DRAWABLE |
| Constructor and Description |
|---|
ViewAware(android.view.View view)
Constructor.
|
ViewAware(android.view.View view,
boolean checkActualViewSize)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
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.
Displays loaded and decoded image Bitmap in this image view aware. |
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.
Displays drawable in this image aware view for empty Uri, on loading or on loading fail. |
protected abstract void |
setImageDrawableInto(android.graphics.drawable.Drawable drawable,
android.view.View view)
Should set drawable into incoming view.
|
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
public ViewAware(android.view.View view)
ImageViewAware(imageView, true).view - View to work withpublic 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. 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()
ImageAwaregetScaleType 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()
ImageAwaregetId 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 ImageAwareprotected abstract void setImageDrawableInto(android.graphics.drawable.Drawable drawable,
android.view.View view)
protected abstract void setImageBitmapInto(android.graphics.Bitmap bitmap,
android.view.View view)
Copyright © 2011-2015. All Rights Reserved.