public class RefreshContentBehavior<V extends android.view.View> extends ScrollingContentBehavior<V> implements Refresher, Loader
This behavior is the pivot of header and footer behavior, without it the other behaviors can not work. All the offset and state changes come from it, so it can be used standalone.
For now, the nested scrolling view supported by CoordinatorLayout are
android.support.v4.widget.NestedScrollView, android.support.v7.widget.RecyclerView
which implement android.support.v4.view.NestedScrollingChild.
Use other parent view to wrap these scrollable child is OK, cause the ViewGroup
and View already implement the nested scrolling event dispatch contract, but the nested
scrolling child itself must exist in the view hierarchy.
The view to which this behavior is attached must be a direct child of CoordinatorLayout.
ScrollingContentBehavior.SavedStateAnimationOffsetBehavior.ScrollingListenerconfiguration, controller, GOLDEN_RATIO, handler, mChild, mListeners, mParent, progressBase, TYPE_UNKNOWN| Constructor and Description |
|---|
RefreshContentBehavior(android.content.Context context) |
RefreshContentBehavior(android.content.Context context,
android.util.AttributeSet attrs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOnLoadListener(OnLoadListener listener) |
void |
addOnRefreshListener(OnRefreshListener listener) |
void |
addOnScrollListener(OnScrollListener listener) |
void |
load()
Begin loading.
|
void |
loadComplete()
Loading complete, it will reset the loading state of footer behavior.
|
void |
loadError(java.lang.Throwable throwable)
The same as
Loader.loadComplete(), in addition it can report exceptions to the loader
listeners. |
protected float |
onConsumeOffset(int current,
int max,
int delta) |
void |
refresh()
Start a refreshing.
|
void |
refreshComplete()
Refreshing complete, which will reset the header behavior's refreshing state.
|
void |
refreshError(java.lang.Throwable throwable)
The same as
Refresher.refreshComplete(), in addition it can report exceptions to the
refreshing listeners. |
createIndicatorConfig, getController, getFooterConfig, getHeaderConfig, isMinOffsetReached, onLayoutChild, onMeasureChild, onNestedPreFling, onNestedPreScroll, onNestedScroll, onRestoreInstanceState, onSaveInstanceState, onStartNestedScroll, onStopNestedScroll, refreshFooter, refreshHeader, reset, setContentTopAndBottomOffset, setFooterConfig, setHeaderConfig, showFooter, showHeader, stopScrolladdScrollListener, animateOffsetDeltaWithDuration, animateOffsetWithDuration, cancelAnimation, enqueuePendingActions, executePendingActions, getChild, getConfiguration, getParent, handleMessage, onAttachedToLayoutParams, onDetachedFromLayoutParams, removeScrollListener, requestLayout, runOnUiThread, runWithView, setConfigurationgetLeftAndRightOffset, getTopAndBottomOffset, layoutChild, setLeftAndRightOffset, setTopAndBottomOffsetpublic RefreshContentBehavior(android.content.Context context)
public RefreshContentBehavior(android.content.Context context,
android.util.AttributeSet attrs)
public void addOnScrollListener(OnScrollListener listener)
public void addOnRefreshListener(OnRefreshListener listener)
public void addOnLoadListener(OnLoadListener listener)
public void refresh()
Refresherpublic void refreshComplete()
RefresherrefreshComplete in interface Refresherpublic void refreshError(java.lang.Throwable throwable)
RefresherRefresher.refreshComplete(), in addition it can report exceptions to the
refreshing listeners.refreshError in interface RefresherOnRefreshListener}public void load()
Loaderpublic void loadComplete()
LoaderloadComplete in interface Loaderpublic void loadError(java.lang.Throwable throwable)
LoaderLoader.loadComplete(), in addition it can report exceptions to the loader
listeners.protected float onConsumeOffset(int current,
int max,
int delta)
onConsumeOffset in class ScrollingContentBehavior<V extends android.view.View>