|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectandroid.view.View
android.widget.ImageView
com.parse.ParseImageView
public class ParseImageView
A specialized ImageView that downloads and displays remote images stored on Parse's
servers.
Given a ParseFile storing an image, a ParseImageView works seamlessly to fetch
the file data and display it in the background. See below for an example:
ParseImageView imageView = (ParseImageView) findViewById(android.R.id.icon);
// The placeholder will be used before and during the fetch, to be replaced by the fetched image
// data.
imageView.setPlaceholder(getResources().getDrawable(R.drawable.placeholder));
imageView.setParseFile(file);
imageView.loadInBackground(new GetDataCallback() {
@Override
public void done(byte[] data, ParseException e) {
Log.i("ParseImageView",
"Fetched! Data length: " + data.length + ", or exception: " + e.getMessage());
}
});
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.widget.ImageView |
|---|
ImageView.ScaleType |
| Nested classes/interfaces inherited from class android.view.View |
|---|
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
ParseImageView(Context context)
Simple constructor to use when creating a ParseImageView from code. |
|
ParseImageView(Context context,
AttributeSet attributeSet)
Constructor that is called when inflating a ParseImageView from XML. |
|
ParseImageView(Context context,
AttributeSet attributeSet,
int defStyle)
Perform inflation from XML and apply a class-specific base style. |
|
| Method Summary | |
|---|---|
void |
loadInBackground()
Kick off downloading of remote image. |
void |
loadInBackground(GetDataCallback completionCallback)
Kick off downloading of remote image. |
protected void |
onDetachedFromWindow()
|
void |
setImageBitmap(Bitmap bitmap)
|
void |
setParseFile(ParseFile file)
Sets the remote file on Parse's server that stores the image. |
void |
setPlaceholder(Drawable placeholder)
Sets the placeholder to be used while waiting for an image to be loaded. |
| Methods inherited from class android.widget.ImageView |
|---|
clearColorFilter, drawableStateChanged, getBaseline, getDrawable, getImageMatrix, getScaleType, invalidateDrawable, onCreateDrawableState, onDraw, onMeasure, onSetAlpha, setAdjustViewBounds, setAlpha, setColorFilter, setColorFilter, setFrame, setImageDrawable, setImageLevel, setImageMatrix, setImageResource, setImageState, setImageURI, setMaxHeight, setMaxWidth, setScaleType, setSelected, verifyDrawable |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParseImageView(Context context)
ParseImageView from code.
context - Context for this View
public ParseImageView(Context context,
AttributeSet attributeSet)
ParseImageView from XML.
context - Context for this ViewattributeSet - AttributeSet defined for this View in XML
public ParseImageView(Context context,
AttributeSet attributeSet,
int defStyle)
context - Context for this ViewattributeSet - AttributeSet defined for this View in XMLdefStyle - Class-specific base style.| Method Detail |
|---|
protected void onDetachedFromWindow()
onDetachedFromWindow in class Viewpublic void setImageBitmap(Bitmap bitmap)
setImageBitmap in class ImageViewpublic void setPlaceholder(Drawable placeholder)
placeholder - A Drawable to be displayed while the remote image data is being fetched. This
value can be null, and this ImageView will simply be blank while data is
fetched.public void setParseFile(ParseFile file)
file - The remote file on Parse's server.public void loadInBackground()
public void loadInBackground(GetDataCallback completionCallback)
completionCallback will be triggered.
completionCallback - A custom GetDataCallback to be called after the image data is fetched and this
ImageView displays the image.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||