C# Class FFImageLoading.Drawables.SelfDisposingBitmapDrawable

A BitmapDrawable that uses reference counting to determine when internal resources should be freed (Disposed). On Android versions Honeycomb and higher the internal Bitmap is Dispose()d but not recycled. On all other Android versions the Bitmap is recycled then disposed.
Inheritance: Android.Graphics.Drawables.BitmapDrawable, ISelfDisposingBitmapDrawable
Afficher le fichier Open project: daniel-luberda/FFImageLoading Class Usage Examples

Protected Properties

Свойство Type Description
monitor object

Private Properties

Свойство Type Description
CheckState void

Méthodes publiques

Méthode Description
SelfDisposingBitmapDrawable ( ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Android.Graphics.Bitmap bitmap ) : Android.Content.Res
SelfDisposingBitmapDrawable ( IntPtr handle, JniHandleOwnership transfer ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources, Android.Graphics.Bitmap bitmap ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources, Stream stream ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Resources resources, string filePath ) : Android.Content.Res
SelfDisposingBitmapDrawable ( Stream stream ) : Android.Content.Res
SelfDisposingBitmapDrawable ( string filePath ) : Android.Content.Res
SetIsCached ( bool isCached ) : void

This should only be called by caching entities. Increments or decrements the cache reference count. This count represents if the instance is cached by something and should not free its resources when no longer displayed.

SetIsDisplayed ( bool isDisplayed ) : void

This should only be called by Views that are actually going to draw the drawable. Increments or decrements the internal displayed reference count. If the internal reference count becomes 0, NoLongerDisplayed will be raised. If the internal reference count becomes 1, Displayed will be raised. This method should be called from the main thread.

SetIsRetained ( bool isRetained ) : void

If you wish to use the instance beyond the lifecycle managed by the caching entity call this method with true. But be aware that you must also have the same number of calls with false or the instance and its resources will be leaked. Also be aware that once retained, the caching entity will not allow the internal Bitmap allocation to be reused. Retaining an instance does not guarantee it a place in the cache, it can be evicted at any time.

SetNoLongerDisplayed ( ) : void

Méthodes protégées

Méthode Description
OnFreeResources ( ) : void

Private Methods

Méthode Description
CheckState ( ) : void

Method Details

OnFreeResources() protected méthode

protected OnFreeResources ( ) : void
Résultat void

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( ) : Android.Content.Res
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( Android.Graphics.Bitmap bitmap ) : Android.Content.Res
bitmap Android.Graphics.Bitmap
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( IntPtr handle, JniHandleOwnership transfer ) : Android.Content.Res
handle System.IntPtr
transfer JniHandleOwnership
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( Resources resources ) : Android.Content.Res
resources Resources
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( Resources resources, Android.Graphics.Bitmap bitmap ) : Android.Content.Res
resources Resources
bitmap Android.Graphics.Bitmap
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( Resources resources, Stream stream ) : Android.Content.Res
resources Resources
stream Stream
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( Resources resources, string filePath ) : Android.Content.Res
resources Resources
filePath string
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( Stream stream ) : Android.Content.Res
stream Stream
Résultat Android.Content.Res

SelfDisposingBitmapDrawable() public méthode

public SelfDisposingBitmapDrawable ( string filePath ) : Android.Content.Res
filePath string
Résultat Android.Content.Res

SetIsCached() public méthode

This should only be called by caching entities. Increments or decrements the cache reference count. This count represents if the instance is cached by something and should not free its resources when no longer displayed.
public SetIsCached ( bool isCached ) : void
isCached bool If set to true is cached.
Résultat void

SetIsDisplayed() public méthode

This should only be called by Views that are actually going to draw the drawable. Increments or decrements the internal displayed reference count. If the internal reference count becomes 0, NoLongerDisplayed will be raised. If the internal reference count becomes 1, Displayed will be raised. This method should be called from the main thread.
public SetIsDisplayed ( bool isDisplayed ) : void
isDisplayed bool If set to true reference count is /// incremented, otherwise it is decremented.
Résultat void

SetIsRetained() public méthode

If you wish to use the instance beyond the lifecycle managed by the caching entity call this method with true. But be aware that you must also have the same number of calls with false or the instance and its resources will be leaked. Also be aware that once retained, the caching entity will not allow the internal Bitmap allocation to be reused. Retaining an instance does not guarantee it a place in the cache, it can be evicted at any time.
public SetIsRetained ( bool isRetained ) : void
isRetained bool If set to true is retained.
Résultat void

SetNoLongerDisplayed() public méthode

public SetNoLongerDisplayed ( ) : void
Résultat void

Property Details

monitor protected_oe property

protected object monitor
Résultat object