public class BehaviorController<B extends AnimationOffsetBehavior> extends java.lang.Object implements AnimationOffsetBehavior.ScrollingListener, Refresher, Loader
| Modifier and Type | Field and Description |
|---|---|
protected B |
behavior |
protected java.util.List<OnLoadListener> |
mLoadListeners |
protected java.util.List<OnRefreshListener> |
mRefreshListeners |
protected java.util.List<OnScrollListener> |
mScrollListeners |
protected BehaviorController |
proxy |
| Constructor and Description |
|---|
BehaviorController(B behavior) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOnLoadListener(OnLoadListener listener) |
void |
addOnRefreshListener(OnRefreshListener listener) |
void |
addOnScrollListener(OnScrollListener listener) |
void |
copyRemainListeners() |
B |
getBehavior() |
BehaviorController |
getProxy() |
protected boolean |
hasOnLoadListeners() |
protected boolean |
hasOnRefreshListeners() |
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. |
void |
onPreScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int current,
int initial,
int trigger,
int min,
int max,
int type) |
void |
onScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int current,
int delta,
int initial,
int trigger,
int min,
int max,
int type) |
void |
onStartScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int initial,
int trigger,
int min,
int max,
int type) |
void |
onStopScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int current,
int initial,
int trigger,
int min,
int max,
int type) |
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. |
protected void |
runOnUiThread(java.lang.Runnable runnable) |
protected void |
runWithView(java.lang.Runnable runnable) |
void |
setBehavior(B behavior) |
void |
setProxy(BehaviorController proxy) |
protected BehaviorController proxy
protected B extends AnimationOffsetBehavior behavior
protected java.util.List<OnScrollListener> mScrollListeners
protected java.util.List<OnRefreshListener> mRefreshListeners
protected java.util.List<OnLoadListener> mLoadListeners
public BehaviorController(B behavior)
public void onStartScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int initial,
int trigger,
int min,
int max,
int type)
onStartScroll in interface AnimationOffsetBehavior.ScrollingListenerpublic void onPreScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int current,
int initial,
int trigger,
int min,
int max,
int type)
onPreScroll in interface AnimationOffsetBehavior.ScrollingListenerpublic void onScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int current,
int delta,
int initial,
int trigger,
int min,
int max,
int type)
onScroll in interface AnimationOffsetBehavior.ScrollingListenerpublic void onStopScroll(CoordinatorLayout coordinatorLayout,
android.view.View child,
int current,
int initial,
int trigger,
int min,
int max,
int type)
onStopScroll in interface AnimationOffsetBehavior.ScrollingListenerpublic 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.public BehaviorController getProxy()
public void setProxy(BehaviorController proxy)
public void copyRemainListeners()
public B getBehavior()
public void setBehavior(B behavior)
public void addOnScrollListener(OnScrollListener listener)
public void addOnRefreshListener(OnRefreshListener listener)
public void addOnLoadListener(OnLoadListener listener)
protected boolean hasOnLoadListeners()
protected boolean hasOnRefreshListeners()
protected void runWithView(java.lang.Runnable runnable)
protected void runOnUiThread(java.lang.Runnable runnable)