public class StateMachine extends java.lang.Object implements AnimationOffsetBehavior.ScrollingListener, Refresher
| Modifier and Type | Class and Description |
|---|---|
static interface |
StateMachine.StateHandler |
| Modifier and Type | Field and Description |
|---|---|
protected int |
mState |
static int |
STATE_CANCELLED |
static int |
STATE_COMPLETE |
static int |
STATE_IDLE |
static int |
STATE_READY |
static int |
STATE_REFRESH |
static int |
STATE_START |
| Constructor and Description |
|---|
StateMachine(StateMachine.StateHandler stateHandler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isRefreshing() |
protected boolean |
moveToState(int state)
Try to move to another state.
|
protected boolean |
moveToState(int state,
java.lang.Throwable throwable) |
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. |
public static final int STATE_IDLE
public static final int STATE_START
public static final int STATE_CANCELLED
public static final int STATE_READY
public static final int STATE_REFRESH
public static final int STATE_COMPLETE
protected int mState
public StateMachine(StateMachine.StateHandler stateHandler)
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.ScrollingListenerprotected boolean moveToState(int state,
java.lang.Throwable throwable)
protected boolean moveToState(int state)
state - the new state to which we are trying to movepublic boolean isRefreshing()
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}