BasicFieldImageView

public class BasicFieldImageView extends AppCompatImageView
implements FieldView

Renders an image bitmap. The FieldImage source can be any of the following:

  • http: or https: URL
  • data: URI
  • file:///android_assets/ URL
  • A relative path in the project's assets/ directory

Any image format recognized by the Android device's BitmapFactory is valid. Usually this is a .jpg or .png.

Field Summary

protected final Field.Observer mFieldObserver
protected FieldImage mImageField
protected String mImageSrc

Public Constructor Summary

BasicFieldImageView(Context context)
Constructs a new BasicFieldImageView.
BasicFieldImageView(Context context, AttributeSet attrs)
BasicFieldImageView(Context context, AttributeSet attrs, int defStyleAttr)

Public Method Summary

Field
void
setField(Field field)
Sets the Field model for this view.
void
unlinkField()
Disconnect the model from this view.

Protected Method Summary

void
startLoadingImage()
Asynchronously load and set image bitmap.
void

Inherited Method Summary

Fields

protected final Field.Observer mFieldObserver

protected FieldImage mImageField

protected String mImageSrc

Public Constructors

public BasicFieldImageView (Context context)

Constructs a new BasicFieldImageView.

Parameters
context The application's context.

public BasicFieldImageView (Context context, AttributeSet attrs)

Parameters
context
attrs

public BasicFieldImageView (Context context, AttributeSet attrs, int defStyleAttr)

Parameters
context
attrs
defStyleAttr

Public Methods

public Field getField ()

public void setField (Field field)

Sets the Field model for this view. If null the current field will be disconnected from the view if one is set. The field must be of the appropriate type for the specific view implementation or a ClassCastException may be thrown.

Parameters
field The field backing this view.

public void unlinkField ()

Disconnect the model from this view.

Protected Methods

protected void startLoadingImage ()

Asynchronously load and set image bitmap.

protected void updateViewSize ()