public class

UrlImageView

extends ImageView
java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ImageView
       ↳ com.droidux.pack.commons.widget.UrlImageView

Class Overview

Extends the ImageView to work with remote/web images. The corners of this view can also be made round by setting the corner radius. (See setCornerRadius(float)).

Summary

XML Attributes
Attribute Name Related Method Description
dux_cornerRadius setCornerRadius(float) Specifies the corner radius. 
[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
UrlImageView(Context context)
UrlImageView(Context context, AttributeSet attrs)
UrlImageView(Context context, AttributeSet attrs, int defStyle)
Public Methods
UrlImageCache getImageCache()
Gets the cache used to store the web images locally.
void setCornerRadius(float tlRad, float trRad, float brRad, float blRad)
Sets the corner radii of this view.
void setCornerRadius(float radius)
Sets the corner radius of this view.
void setImageCache(UrlImageCache cache)
Sets the cache used to store the web images locally.
void setImageUrl(String url, int placeholder, int error)
Sets a bitmap from the specified url as the content of this view.
void setImageUrl(String url, Drawable placeholder, Drawable error)
Sets a bitmap from the specified url as the content of this view.
[Expand]
Inherited Methods
From class android.widget.ImageView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

XML Attributes

dux_cornerRadius

Since: API Level

Specifies the corner radius. Its value should be a dimension (such as "5dip").

Must be a dimension value, which is a floating point number appended with a unit such as "2.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).

Related Methods

Public Constructors

public UrlImageView (Context context)

Since: API Level 2.5

public UrlImageView (Context context, AttributeSet attrs)

Since: API Level 2.5

public UrlImageView (Context context, AttributeSet attrs, int defStyle)

Since: API Level 2.5

Public Methods

public UrlImageCache getImageCache ()

Since: API Level 2.5

Gets the cache used to store the web images locally.

Returns
  • The cache.

public void setCornerRadius (float tlRad, float trRad, float brRad, float blRad)

Since: API Level 2.5

Sets the corner radii of this view.

Parameters
tlRad top-left radius
trRad top-right radius
brRad bottom-right radius
blRad bottom-left radius

public void setCornerRadius (float radius)

Since: API Level 2.5

Sets the corner radius of this view.

Related XML Attributes
Parameters
radius The corner radius.

public void setImageCache (UrlImageCache cache)

Since: API Level 2.5

Sets the cache used to store the web images locally.

Returns
  • The cache.

public void setImageUrl (String url, int placeholder, int error)

Since: API Level 2.5

Sets a bitmap from the specified url as the content of this view.

Parameters
url The url of the bitmap/image.
placeholder The resource id of a drawable used as placeholder.
error The resource id of a drawable used when the url image download is failed.

public void setImageUrl (String url, Drawable placeholder, Drawable error)

Since: API Level 2.5

Sets a bitmap from the specified url as the content of this view.

Parameters
url The url of the bitmap/image.
placeholder The drawable used as placeholder.
error The drawable used when the url image download is failed.