|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.view.View
android.view.ViewGroup
android.widget.FrameLayout
com.facebook.widget.ProfilePictureView
public class ProfilePictureView
View that displays the profile photo of a supplied profile ID, while conforming to user specified dimensions.
Nested Class Summary | |
---|---|
static interface |
ProfilePictureView.OnErrorListener
Callback interface that will be called when a network or other error is encountered while retrieving profile pictures. |
Nested classes/interfaces inherited from class android.widget.FrameLayout |
---|
FrameLayout.LayoutParams |
Nested classes/interfaces inherited from class android.view.ViewGroup |
---|
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener |
Field Summary | |
---|---|
static int |
CUSTOM
Indicates that the specific size of the View will be set via layout params. |
static int |
LARGE
Indicates that the profile image should fit in a LARGE X LARGE space, regardless of whether the cropped or un-cropped version is chosen. |
static int |
NORMAL
Indicates that the profile image should fit in a NORMAL X NORMAL space, regardless of whether the cropped or un-cropped version is chosen. |
static int |
SMALL
Indicates that the profile image should fit in a SMALL X SMALL space, regardless of whether the cropped or un-cropped version is chosen. |
static String |
TAG
Tag used when logging calls are made by ProfilePictureView |
Fields inherited from class android.view.ViewGroup |
---|
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE |
Constructor Summary | |
---|---|
ProfilePictureView(Context context)
Constructor |
|
ProfilePictureView(Context context,
AttributeSet attrs)
Constructor |
|
ProfilePictureView(Context context,
AttributeSet attrs,
int defStyle)
Constructor |
Method Summary | |
---|---|
ProfilePictureView.OnErrorListener |
getOnErrorListener()
Returns the current OnErrorListener for this instance of ProfilePictureView |
int |
getPresetSize()
Gets the current preset size type |
String |
getProfileId()
Returns the profile Id for the current profile photo |
boolean |
isCropped()
Indicates whether the cropped version of the profile photo has been chosen |
protected void |
onDetachedFromWindow()
|
protected void |
onLayout(boolean changed,
int left,
int top,
int right,
int bottom)
In addition to calling super.Layout(), we also attempt to get a new image that is properly size for the layout dimensions |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
Overriding onMeasure to handle the case where WRAP_CONTENT might be specified in the layout. |
protected void |
onRestoreInstanceState(Parcelable state)
If the passed in state is a Bundle, an attempt is made to restore from it. |
protected Parcelable |
onSaveInstanceState()
Some of the current state is returned as a Bundle to allow quick restoration of the ProfilePictureView object in scenarios like orientation changes. |
void |
setCropped(boolean showCroppedVersion)
Sets the profile photo to be the cropped version, or the original version |
void |
setOnErrorListener(ProfilePictureView.OnErrorListener onErrorListener)
Sets an OnErrorListener for this instance of ProfilePictureView to call into when certain exceptions occur. |
void |
setPresetSize(int sizeType)
Apply a preset size to this profile photo |
void |
setProfileId(String profileId)
Sets the profile Id for this profile photo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface android.view.ViewParent |
---|
createContextMenu, getParent, getParentForAccessibility, isLayoutRequested, requestFitSystemWindows, requestLayout |
Field Detail |
---|
public static final String TAG
public static final int CUSTOM
public static final int SMALL
public static final int NORMAL
public static final int LARGE
Constructor Detail |
---|
public ProfilePictureView(Context context)
context
- Context for this Viewpublic ProfilePictureView(Context context, AttributeSet attrs)
context
- Context for this Viewattrs
- AttributeSet for this View.
The attribute 'preset_size' is processed herepublic ProfilePictureView(Context context, AttributeSet attrs, int defStyle)
context
- Context for this Viewattrs
- AttributeSet for this View.
The attribute 'preset_size' is processed heredefStyle
- Default style for this ViewMethod Detail |
---|
public final int getPresetSize()
public final void setPresetSize(int sizeType)
sizeType
- The size type to apply: SMALL, NORMAL or LARGEpublic final boolean isCropped()
public final void setCropped(boolean showCroppedVersion)
showCroppedVersion
- True to select the cropped version
False to select the standard versionpublic final String getProfileId()
public final void setProfileId(String profileId)
profileId
- The profileId
NULL/Empty String will show the blank profile photopublic final ProfilePictureView.OnErrorListener getOnErrorListener()
public final void setOnErrorListener(ProfilePictureView.OnErrorListener onErrorListener)
onErrorListener
- The listener object to setprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
onMeasure
in class FrameLayout
protected void onLayout(boolean changed, int left, int top, int right, int bottom)
onLayout
in class FrameLayout
protected Parcelable onSaveInstanceState()
onSaveInstanceState
in class View
protected void onRestoreInstanceState(Parcelable state)
onRestoreInstanceState
in class View
state
- a Parcelable containing the current stateprotected void onDetachedFromWindow()
onDetachedFromWindow
in class View
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |