public class SmartSwipeRefresh
extends java.lang.Object
Usage:
1. with global default header and footer via SmartSwipeRefresh.setDefaultRefreshViewCreator(creator)
1). SmartSwipeRefresh.drawerMode(view, false).setDataLoader(loader);
2). SmartSwipeRefresh.behindMode(view, false).setDataLoader(loader);
3). SmartSwipeRefresh.translateMode(view, false).setDataLoader(loader);
4). SmartSwipeRefresh.scaleMode(view, false).setDataLoader(loader);
2. with specified header and footer
1). SmartSwipeRefresh.drawerMode(view, false, false).setDataLoader(loader).setHeader(header).setFooter(footer);
2). SmartSwipeRefresh.behindMode(view, false, false).setDataLoader(loader).setHeader(header).setFooter(footer);
3). SmartSwipeRefresh.translateMode(view, false, false).setDataLoader(loader).setHeader(header).setFooter(footer);
4). SmartSwipeRefresh.scaleMode(view, false, false).setDataLoader(loader).setHeader(header).setFooter(footer);
3. more DrawerConsumer(SlidingConsumer extends DrawerConsumer) features
DrawerConsumer consumer = smartSwipeRefresh.getSwipeConsumer();
//behindMode or translateMode or scaleMode
SlidingConsumer consumer = smartSwipeRefresh.getSwipeConsumer().as(SlidingConsumer.class);
if| 限定符和类型 | 类和说明 |
|---|---|
static interface |
SmartSwipeRefresh.SmartSwipeRefreshDataLoader
The refresh data loader
When refresh or load more event emits, its methods will be called
|
static interface |
SmartSwipeRefresh.SmartSwipeRefreshFooter |
static interface |
SmartSwipeRefresh.SmartSwipeRefreshHeader |
static interface |
SmartSwipeRefresh.SmartSwipeRefreshViewCreator
|
| 构造器和说明 |
|---|
SmartSwipeRefresh() |
| 限定符和类型 | 方法和说明 |
|---|---|
static SmartSwipeRefresh |
behindMode(android.view.View contentView,
boolean horizontal)
header and footer show behind the contentView, and stay at its position while contentView is moving
|
static SmartSwipeRefresh |
behindMode(android.view.View contentView,
boolean horizontal,
boolean withDefaultHeaderAndFooter)
header and footer show behind the contentView, and stay at its position while contentView is moving
|
static SmartSwipeRefresh |
create(android.view.View contentView,
DrawerConsumer consumer,
boolean horizontal,
boolean withDefaultHeaderAndFooter) |
SmartSwipeRefresh |
disableLoadMore() |
SmartSwipeRefresh |
disableRefresh() |
static SmartSwipeRefresh |
drawerMode(android.view.View contentView,
boolean horizontal)
looks like drawer: header and footer show above the contentView
|
static SmartSwipeRefresh |
drawerMode(android.view.View contentView,
boolean horizontal,
boolean withDefaultHeaderAndFooter)
looks like drawer: header and footer show above the contentView
|
SmartSwipeRefresh |
finished(boolean success)
finish current drawer( header or footer)
|
SmartSwipeRefresh.SmartSwipeRefreshDataLoader |
getDataLoader() |
SmartSwipeRefresh.SmartSwipeRefreshFooter |
getFooter() |
SmartSwipeRefresh.SmartSwipeRefreshHeader |
getHeader() |
DrawerConsumer |
getSwipeConsumer() |
boolean |
isHorizontal() |
boolean |
isNoMoreData() |
static SmartSwipeRefresh |
scaleMode(android.view.View contentView,
boolean horizontal)
header and footer show behind the contentView
Always in the middle of the space left after the main view has moved
|
static SmartSwipeRefresh |
scaleMode(android.view.View contentView,
boolean horizontal,
boolean withDefaultHeaderAndFooter)
header and footer show behind the contentView
Always in the middle of the space left after the main view has moved
|
SmartSwipeRefresh |
setDataLoader(SmartSwipeRefresh.SmartSwipeRefreshDataLoader dataLoader)
set the data loader to do refresh and load more business
|
static void |
setDefaultRefreshViewCreator(SmartSwipeRefresh.SmartSwipeRefreshViewCreator creator) |
SmartSwipeRefresh |
setFooter(SmartSwipeRefresh.SmartSwipeRefreshFooter footer)
set the refresh footer
|
SmartSwipeRefresh |
setHeader(SmartSwipeRefresh.SmartSwipeRefreshHeader header)
set the refresh header
|
SmartSwipeRefresh |
setNoMoreData(boolean noMoreData)
mark footer there is no more data to load
|
static SmartSwipeRefresh |
slideMode(android.view.View contentView,
float relativeMoveFactor,
boolean horizontal,
boolean withDefaultHeaderAndFooter)
header and footer show behind the contentView, and there relative movement specified by relativeMoveFactor
|
SmartSwipeRefresh |
startLoadMore()
fake to load more without swipe motion event
|
SmartSwipeRefresh |
startRefresh()
fake to refresh without swipe motion event
|
static SmartSwipeRefresh |
translateMode(android.view.View contentView,
boolean horizontal)
header and footer show followed the contentView (moves pixel by pixel with contentView)
|
static SmartSwipeRefresh |
translateMode(android.view.View contentView,
boolean horizontal,
boolean withDefaultHeaderAndFooter)
header and footer show followed the contentView (moves pixel by pixel with contentView)
|
public static void setDefaultRefreshViewCreator(SmartSwipeRefresh.SmartSwipeRefreshViewCreator creator)
public static SmartSwipeRefresh drawerMode(android.view.View contentView, boolean horizontal)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notpublic static SmartSwipeRefresh drawerMode(android.view.View contentView, boolean horizontal, boolean withDefaultHeaderAndFooter)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notwithDefaultHeaderAndFooter - use default header and footer via setDefaultRefreshViewCreator(SmartSwipeRefreshViewCreator)drawerMode(View, boolean)public static SmartSwipeRefresh behindMode(android.view.View contentView, boolean horizontal)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notpublic static SmartSwipeRefresh behindMode(android.view.View contentView, boolean horizontal, boolean withDefaultHeaderAndFooter)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notwithDefaultHeaderAndFooter - use default header and footer via setDefaultRefreshViewCreator(SmartSwipeRefreshViewCreator)behindMode(View, boolean)public static SmartSwipeRefresh translateMode(android.view.View contentView, boolean horizontal)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notpublic static SmartSwipeRefresh translateMode(android.view.View contentView, boolean horizontal, boolean withDefaultHeaderAndFooter)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notwithDefaultHeaderAndFooter - use default header and footer via setDefaultRefreshViewCreator(SmartSwipeRefreshViewCreator)translateMode(View, boolean)public static SmartSwipeRefresh scaleMode(android.view.View contentView, boolean horizontal)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notpublic static SmartSwipeRefresh scaleMode(android.view.View contentView, boolean horizontal, boolean withDefaultHeaderAndFooter)
contentView - any view which needs to refresh and load morehorizontal - works horizontally or notwithDefaultHeaderAndFooter - use default header and footer via setDefaultRefreshViewCreator(SmartSwipeRefreshViewCreator)scaleMode(View, boolean)public static SmartSwipeRefresh slideMode(android.view.View contentView, float relativeMoveFactor, boolean horizontal, boolean withDefaultHeaderAndFooter)
contentView - contentView to refreshrelativeMoveFactor - the factor header and footer moves relative to contentViewhorizontal - is refresh horizontally(true) or vertically(false)withDefaultHeaderAndFooter - use default header and footer by SmartSwipeRefresh.SmartSwipeRefreshViewCreator (if set)
or ClassicHeader / ClassicFooter (if creator not set)SmartSwipeRefresh.SmartSwipeRefreshViewCreator,
ClassicHeader,
ClassicFooter,
SlidingConsumer.setRelativeMoveFactor(float)public static SmartSwipeRefresh create(android.view.View contentView, DrawerConsumer consumer, boolean horizontal, boolean withDefaultHeaderAndFooter)
public SmartSwipeRefresh disableRefresh()
public SmartSwipeRefresh disableLoadMore()
public SmartSwipeRefresh startRefresh()
public SmartSwipeRefresh startLoadMore()
public SmartSwipeRefresh finished(boolean success)
success - data load success or notpublic SmartSwipeRefresh.SmartSwipeRefreshDataLoader getDataLoader()
public SmartSwipeRefresh setDataLoader(SmartSwipeRefresh.SmartSwipeRefreshDataLoader dataLoader)
dataLoader - data loaderSmartSwipeRefresh.SmartSwipeRefreshDataLoaderpublic boolean isNoMoreData()
public SmartSwipeRefresh setNoMoreData(boolean noMoreData)
noMoreData - no more data or notpublic SmartSwipeRefresh.SmartSwipeRefreshHeader getHeader()
public SmartSwipeRefresh setHeader(SmartSwipeRefresh.SmartSwipeRefreshHeader header)
header - refresh headerpublic SmartSwipeRefresh.SmartSwipeRefreshFooter getFooter()
public SmartSwipeRefresh setFooter(SmartSwipeRefresh.SmartSwipeRefreshFooter footer)
footer - refresh footerpublic boolean isHorizontal()
public DrawerConsumer getSwipeConsumer()