public abstract class ViewAware extends Object implements ImageAware
View
. Keeps weak reference of View to prevent memory leaks.限定符和类型 | 字段和说明 |
---|---|
protected boolean |
checkActualViewSize |
protected Reference<android.view.View> |
viewRef |
static String |
WARN_CANT_SET_BITMAP |
static String |
WARN_CANT_SET_DRAWABLE |
构造器和说明 |
---|
ViewAware(android.view.View view)
Constructor.
|
ViewAware(android.view.View view,
boolean checkActualViewSize)
Constructor
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
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
在接口中 ImageAware
public int getHeight()
view
parameters, configuration
parameters or device display dimensions.getHeight
在接口中 ImageAware
public ViewScaleType getScaleType()
ImageAware
getScaleType
在接口中 ImageAware
public android.view.View getWrappedView()
ImageAware
View
. Can return null if no view is wrapped or view was
collected by GC.getWrappedView
在接口中 ImageAware
public boolean isCollected()
ImageAware
ImageLoadingListener#onLoadingCancelled(String, View)
callback.isCollected
在接口中 ImageAware
public int getId()
ImageAware
getId
在接口中 ImageAware
public boolean setImageDrawable(android.graphics.drawable.Drawable drawable)
ImageAware
BitmapDisplayer
.< br />
Is called on UI thread if ImageLoader was called on UI thread. Otherwise - on background thread.setImageDrawable
在接口中 ImageAware
public boolean setImageBitmap(android.graphics.Bitmap bitmap)
ImageAware
Bitmap
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
在接口中 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)