Class SmartRefreshLayout
-
- All Implemented Interfaces:
public class SmartRefreshLayout
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSmartRefreshLayout.LayoutParamspublic classSmartRefreshLayout.RefreshKernelImplCore refresh layout interface. Opens APIs for complex Headers or Footers.
-
Constructor Summary
Constructors Constructor Description SmartRefreshLayout(Context context)SmartRefreshLayout(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description voidcomputeScroll()Override computeScroll for smart-specific features: 1. booleandispatchTouchEvent(MotionEvent e)Event dispatch (gesture core): 1. voidrequestDisallowInterceptTouchEvent(boolean disallowIntercept)This code is from Google's official SwipeRefreshLayout, mainly to let older ListView scroll down smoothly by selectively blocking requestDisallowInterceptTouchEvent. LayoutParamsgenerateLayoutParams(AttributeSet attrs)intgetNestedScrollAxes()booleanonStartNestedScroll(View child, View target, int nestedScrollAxes)voidonNestedScrollAccepted(View child, View target, int axes)voidonNestedPreScroll(View target, int dx, int dy, Array<int> consumed)voidonNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)booleanonNestedPreFling(View target, float velocityX, float velocityY)booleanonNestedFling(View target, float velocityX, float velocityY, boolean consumed)voidonStopNestedScroll(View target)voidsetNestedScrollingEnabled(boolean enabled)booleanisNestedScrollingEnabled()RefreshLayoutsetHeaderHeight(float heightDp)Set the Header's height. RefreshLayoutsetHeaderHeightPx(int height)Set the Header height RefreshLayoutsetFooterHeight(float heightDp)Set the Footer's height. RefreshLayoutsetFooterHeightPx(int height)Set the Footer height RefreshLayoutsetHeaderInsetStart(float insetDp)Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application). RefreshLayoutsetHeaderInsetStartPx(int insetPx)Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application). RefreshLayoutsetFooterInsetStart(float insetDp)Set the Footer's start offset. RefreshLayoutsetFooterInsetStartPx(int insetPx)Set the Footer's start offset. RefreshLayoutsetDragRate(float rate)Set the damping effect. RefreshLayoutsetHeaderMaxDragRate(float rate)Set the ratio of the maximum height to drag header. RefreshLayoutsetFooterMaxDragRate(float rate)Set the ratio of the maximum height to drag footer. RefreshLayoutsetHeaderTriggerRate(float rate)Set the ratio at which the refresh is triggered. RefreshLayoutsetFooterTriggerRate(float rate)Set the ratio at which the load more is triggered. RefreshLayoutsetReboundInterpolator(Interpolator interpolator)Set the rebound interpolator. RefreshLayoutsetReboundDuration(int duration)Set the duration of the rebound animation. RefreshLayoutsetEnableLoadMore(boolean enabled)Set whether to enable pull-up loading more (enabled by default). RefreshLayoutsetEnableRefresh(boolean enabled)Whether to enable pull-down refresh (enabled by default). RefreshLayoutsetEnableHeaderTranslationContent(boolean enabled)Whether to enable pull-down refresh (enabled by default). RefreshLayoutsetEnableFooterTranslationContent(boolean enabled)Set whether to pull up the content while pulling up the footer. RefreshLayoutsetEnableAutoLoadMore(boolean enabled)Sets whether to listen for the list to trigger a load event when scrolling to the bottom (default true). RefreshLayoutsetEnableOverScrollBounce(boolean enabled)Set whether to enable the over-scroll bounce function. RefreshLayoutsetEnablePureScrollMode(boolean enabled)Set whether to enable pure scroll mode. RefreshLayoutsetEnableScrollContentWhenLoaded(boolean enabled)Set whether to scroll the content to display new data after loading more complete. RefreshLayoutsetEnableScrollContentWhenRefreshed(boolean enabled)Set whether to scroll the content to display new data after the refresh is complete. RefreshLayoutsetEnableLoadMoreWhenContentNotFull(boolean enabled)Set whether to pull up and load more when the content is not full of one page. RefreshLayoutsetEnableOverScrollDrag(boolean enabled)Set whether to enable over-scroll drag (imitation iPhone effect). RefreshLayoutsetEnableFooterFollowWhenNoMoreData(boolean enabled)Set whether Footer follows the content after there is no more data. RefreshLayoutsetEnableClipHeaderWhenFixedBehind(boolean enabled)Set whether to clip header when the Header is in the FixedBehind state. RefreshLayoutsetEnableClipFooterWhenFixedBehind(boolean enabled)Set whether to clip footer when the Footer is in the FixedBehind state. RefreshLayoutsetEnableNestedScroll(boolean enabled)Setting whether nesting scrolling is enabled (default off + smart on). RefreshLayoutsetFixedHeaderViewId(int id)Set the View ID fixed below the Header, which stays stationary when Footer scrolls. RefreshLayoutsetFixedFooterViewId(int id)Set the View ID fixed above the Footer, which stays stationary when Header scrolls. RefreshLayoutsetHeaderTranslationViewId(int id)Set the View ID that should scroll along with the Header. RefreshLayoutsetFooterTranslationViewId(int id)Set the View ID that should scroll along with the Footer. RefreshLayoutsetDisableContentWhenRefresh(boolean disable)Set whether to disable content interaction during refresh. RefreshLayoutsetDisableContentWhenLoading(boolean disable)Set whether to disable content interaction during loading. RefreshLayoutsetRefreshHeader(RefreshHeader header)Set the header of RefreshLayout. RefreshLayoutsetRefreshHeader(RefreshHeader header, int width, int height)Set the header of RefreshLayout. RefreshLayoutsetRefreshFooter(RefreshFooter footer)Set the footer of RefreshLayout. RefreshLayoutsetRefreshFooter(RefreshFooter footer, int width, int height)Set the footer of RefreshLayout. RefreshLayoutsetRefreshContent(View content)Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts). RefreshLayoutsetRefreshContent(View content, int width, int height)Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts). RefreshFootergetRefreshFooter()Get the current Footer of RefreshLayout. RefreshHeadergetRefreshHeader()Get the current Header of RefreshLayout. RefreshStategetState()Get the current state of RefreshLayout. ViewGroupgetLayout()Get the ViewGroup of RefreshLayout. RefreshLayoutsetOnRefreshListener(OnRefreshListener listener)Set refresh listener separately. RefreshLayoutsetOnLoadMoreListener(OnLoadMoreListener listener)Set load more listener separately. RefreshLayoutsetOnRefreshLoadMoreListener(OnRefreshLoadMoreListener listener)Set refresh and load listeners at the same time. RefreshLayoutsetOnMultiListener(OnMultiListener listener)Set up a multi-function listener. RefreshLayoutsetPrimaryColors(Array<int> primaryColors)Set theme color int (primaryColor and accentColor). RefreshLayoutsetPrimaryColorsId(Array<int> primaryColorId)Set theme color id (primaryColor and accentColor). RefreshLayoutsetScrollBoundaryDecider(ScrollBoundaryDecider boundary)Set the scroll boundary Decider, Can customize when you can refresh. RefreshLayoutsetNoMoreData(boolean noMoreData)Restore the original state after finishLoadMoreWithNoMoreData. RefreshLayoutresetNoMoreData()Restore the original state after finishLoadMoreWithNoMoreData. RefreshLayoutfinishRefresh()Finish refresh. RefreshLayoutfinishLoadMore()Finish load more. RefreshLayoutfinishRefresh(int delayed)Finish refresh. RefreshLayoutfinishRefresh(boolean success)Finish refresh. RefreshLayoutfinishRefresh(int delayed, boolean success, Boolean noMoreData)Finish refresh. RefreshLayoutfinishRefreshWithNoMoreData()Finish refresh and mark no more data. RefreshLayoutfinishLoadMore(int delayed)Finish load more. RefreshLayoutfinishLoadMore(boolean success)Finish load more. RefreshLayoutfinishLoadMore(int delayed, boolean success, boolean noMoreData)Finish load more. RefreshLayoutfinishLoadMoreWithNoMoreData()Finish load more and mark no more data. RefreshLayoutcloseHeaderOrFooter()Close the Header or Footer. booleanautoRefresh()Display refresh animation and trigger refresh event. booleanautoRefresh(int delayed)Display refresh animation and trigger refresh event with delayed start. booleanautoRefreshAnimationOnly()Display refresh animation without triggering events. booleanautoRefresh(int delayed, int duration, float dragRate, boolean animationOnly)Display refresh animation with multifunction options. booleanautoLoadMore()Display load more animation and trigger load more event. booleanautoLoadMore(int delayed)Display load more animation and trigger load more event with delayed start. booleanautoLoadMoreAnimationOnly()Display load more animation without triggering events. booleanautoLoadMore(int delayed, int duration, float dragRate, boolean animationOnly)Display load more animation with multifunction options. static voidsetDefaultRefreshHeaderCreator(DefaultRefreshHeaderCreator creator)Set the default Header creator. static voidsetDefaultRefreshFooterCreator(DefaultRefreshFooterCreator creator)Set the default Footer creator. static voidsetDefaultRefreshInitializer(DefaultRefreshInitializer initializer)Set the default Refresh initializer. booleanisRefreshing()Whether currently refreshing booleanisLoading()Whether currently loading booleanperformClick()-
-
Method Detail
-
computeScroll
void computeScroll()
Override computeScroll for smart-specific features: 1. Over-scroll bounce. 2. Boundary collision.
-
dispatchTouchEvent
boolean dispatchTouchEvent(MotionEvent e)
Event dispatch (gesture core): 1. Multi-touch support. 2. Seamless content scrolling.
- Parameters:
e- Touch event
-
requestDisallowInterceptTouchEvent
void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
This code is from Google's official SwipeRefreshLayout, mainly to let older ListView scroll down smoothly by selectively blocking requestDisallowInterceptTouchEvent. Most third-party refresh libraries retain this code
-
generateLayoutParams
LayoutParams generateLayoutParams(AttributeSet attrs)
-
getNestedScrollAxes
int getNestedScrollAxes()
-
onStartNestedScroll
boolean onStartNestedScroll(View child, View target, int nestedScrollAxes)
-
onNestedScrollAccepted
void onNestedScrollAccepted(View child, View target, int axes)
-
onNestedPreScroll
void onNestedPreScroll(View target, int dx, int dy, Array<int> consumed)
-
onNestedScroll
void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)
-
onNestedPreFling
boolean onNestedPreFling(View target, float velocityX, float velocityY)
-
onNestedFling
boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed)
-
onStopNestedScroll
void onStopNestedScroll(View target)
-
setNestedScrollingEnabled
void setNestedScrollingEnabled(boolean enabled)
-
isNestedScrollingEnabled
boolean isNestedScrollingEnabled()
-
setHeaderHeight
RefreshLayout setHeaderHeight(float heightDp)
Set the Header's height.
- Parameters:
heightDp- Density-independent Pixels Density-independent pixels (use px2dp for pixel conversion)- Returns:
RefreshLayout
-
setHeaderHeightPx
RefreshLayout setHeaderHeightPx(int height)
Set the Header height
- Parameters:
height- Pixels- Returns:
RefreshLayout
-
setFooterHeight
RefreshLayout setFooterHeight(float heightDp)
Set the Footer's height.
- Parameters:
heightDp- Density-independent Pixels Density-independent pixels (use px2dp for pixel conversion)- Returns:
RefreshLayout
-
setFooterHeightPx
RefreshLayout setFooterHeightPx(int height)
Set the Footer height
- Parameters:
height- Pixels- Returns:
RefreshLayout
-
setHeaderInsetStart
RefreshLayout setHeaderInsetStart(float insetDp)
Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application).
- Parameters:
insetDp- Density-independent Pixels Density-independent pixels (use px2dp for pixel conversion)- Returns:
RefreshLayout
-
setHeaderInsetStartPx
RefreshLayout setHeaderInsetStartPx(int insetPx)
Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application).
- Parameters:
insetPx- Pixels- Returns:
RefreshLayout
-
setFooterInsetStart
RefreshLayout setFooterInsetStart(float insetDp)
Set the Footer's start offset.
- Parameters:
insetDp- Density-independent Pixels Density-independent pixels (use px2dp for pixel conversion)- Returns:
RefreshLayout
-
setFooterInsetStartPx
RefreshLayout setFooterInsetStartPx(int insetPx)
Set the Footer's start offset.
- Parameters:
insetPx- Pixels- Returns:
RefreshLayout
-
setDragRate
RefreshLayout setDragRate(float rate)
Set the damping effect. Ratio of displayed drag height to actual drag height (default 0.5).
- Parameters:
rate- ratio = (The drag height of the view)/(The actual drag height of the finger) Ratio = view drag height / finger drag height- Returns:
RefreshLayout
-
setHeaderMaxDragRate
RefreshLayout setHeaderMaxDragRate(float rate)
Set the ratio of the maximum height to drag header.
- Parameters:
rate- ratio = (the maximum height to drag header)/(the height of header) Ratio = max pull-down height / Header height- Returns:
RefreshLayout
-
setFooterMaxDragRate
RefreshLayout setFooterMaxDragRate(float rate)
Set the ratio of the maximum height to drag footer.
- Parameters:
rate- ratio = (the maximum height to drag footer)/(the height of footer) Ratio = max pull-up height / Footer height- Returns:
RefreshLayout
-
setHeaderTriggerRate
RefreshLayout setHeaderTriggerRate(float rate)
Set the ratio at which the refresh is triggered.
- Parameters:
rate- Ratio of trigger refresh distance to HeaderHeight- Returns:
RefreshLayout
-
setFooterTriggerRate
RefreshLayout setFooterTriggerRate(float rate)
Set the ratio at which the load more is triggered.
- Parameters:
rate- Ratio of trigger load distance to FooterHeight- Returns:
RefreshLayout
-
setReboundInterpolator
RefreshLayout setReboundInterpolator(Interpolator interpolator)
Set the rebound interpolator.
- Parameters:
interpolator- Animation interpolator- Returns:
RefreshLayout
-
setReboundDuration
RefreshLayout setReboundDuration(int duration)
Set the duration of the rebound animation.
- Parameters:
duration- Duration- Returns:
RefreshLayout
-
setEnableLoadMore
RefreshLayout setEnableLoadMore(boolean enabled)
Set whether to enable pull-up loading more (enabled by default).
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableRefresh
RefreshLayout setEnableRefresh(boolean enabled)
Whether to enable pull-down refresh (enabled by default).
- Parameters:
enabled- Whether to enable- Returns:
SmartRefreshLayout
-
setEnableHeaderTranslationContent
RefreshLayout setEnableHeaderTranslationContent(boolean enabled)
Whether to enable pull-down refresh (enabled by default).
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableFooterTranslationContent
RefreshLayout setEnableFooterTranslationContent(boolean enabled)
Set whether to pull up the content while pulling up the footer.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableAutoLoadMore
RefreshLayout setEnableAutoLoadMore(boolean enabled)
Sets whether to listen for the list to trigger a load event when scrolling to the bottom (default true).
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableOverScrollBounce
RefreshLayout setEnableOverScrollBounce(boolean enabled)
Set whether to enable the over-scroll bounce function.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnablePureScrollMode
RefreshLayout setEnablePureScrollMode(boolean enabled)
Set whether to enable pure scroll mode.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableScrollContentWhenLoaded
RefreshLayout setEnableScrollContentWhenLoaded(boolean enabled)
Set whether to scroll the content to display new data after loading more complete. Whether to scroll content to show new data after load more.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableScrollContentWhenRefreshed
RefreshLayout setEnableScrollContentWhenRefreshed(boolean enabled)
Set whether to scroll the content to display new data after the refresh is complete. Whether to scroll content to show new data after refresh
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableLoadMoreWhenContentNotFull
RefreshLayout setEnableLoadMoreWhenContentNotFull(boolean enabled)
Set whether to pull up and load more when the content is not full of one page. Whether to allow pull-up load more when content is less than one page.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableOverScrollDrag
RefreshLayout setEnableOverScrollDrag(boolean enabled)
Set whether to enable over-scroll drag (imitation iPhone effect).
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableFooterFollowWhenNoMoreData
RefreshLayout setEnableFooterFollowWhenNoMoreData(boolean enabled)
Set whether Footer follows the content after there is no more data.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableClipHeaderWhenFixedBehind
RefreshLayout setEnableClipHeaderWhenFixedBehind(boolean enabled)
Set whether to clip header when the Header is in the FixedBehind state.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableClipFooterWhenFixedBehind
RefreshLayout setEnableClipFooterWhenFixedBehind(boolean enabled)
Set whether to clip footer when the Footer is in the FixedBehind state.
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setEnableNestedScroll
RefreshLayout setEnableNestedScroll(boolean enabled)
Setting whether nesting scrolling is enabled (default off + smart on). Set whether to enable nested scrolling (default off, smart auto-enable).
- Parameters:
enabled- Whether to enable- Returns:
RefreshLayout
-
setFixedHeaderViewId
RefreshLayout setFixedHeaderViewId(int id)
Set the View ID fixed below the Header, which stays stationary when Footer scrolls.
- Parameters:
id- View ID fixed at header- Returns:
RefreshLayout
-
setFixedFooterViewId
RefreshLayout setFixedFooterViewId(int id)
Set the View ID fixed above the Footer, which stays stationary when Header scrolls.
- Parameters:
id- View ID fixed at footer- Returns:
RefreshLayout
-
setHeaderTranslationViewId
RefreshLayout setHeaderTranslationViewId(int id)
Set the View ID that should scroll along with the Header. Defaults to the entire Content view.
- Parameters:
id- View ID fixed at header- Returns:
RefreshLayout
-
setFooterTranslationViewId
RefreshLayout setFooterTranslationViewId(int id)
Set the View ID that should scroll along with the Footer. Defaults to the entire Content view.
- Parameters:
id- View ID fixed at header- Returns:
RefreshLayout
-
setDisableContentWhenRefresh
RefreshLayout setDisableContentWhenRefresh(boolean disable)
Set whether to disable content interaction during refresh.
- Parameters:
disable- Whether to disable- Returns:
RefreshLayout
-
setDisableContentWhenLoading
RefreshLayout setDisableContentWhenLoading(boolean disable)
Set whether to disable content interaction during loading.
- Parameters:
disable- Whether to disable- Returns:
RefreshLayout
-
setRefreshHeader
RefreshLayout setRefreshHeader(RefreshHeader header)
Set the header of RefreshLayout.
- Parameters:
header- RefreshHeader refresh header- Returns:
RefreshLayout
-
setRefreshHeader
RefreshLayout setRefreshHeader(RefreshHeader header, int width, int height)
Set the header of RefreshLayout.
- Parameters:
header- RefreshHeader refresh headerwidth- the width in px, can use MATCH_PARENT and WRAP_CONTENT.height- the height in px, can use MATCH_PARENT and WRAP_CONTENT.- Returns:
RefreshLayout
-
setRefreshFooter
RefreshLayout setRefreshFooter(RefreshFooter footer)
Set the footer of RefreshLayout.
- Parameters:
footer- RefreshFooter refresh footer- Returns:
RefreshLayout
-
setRefreshFooter
RefreshLayout setRefreshFooter(RefreshFooter footer, int width, int height)
Set the footer of RefreshLayout.
- Parameters:
footer- RefreshFooter refresh footerwidth- the width in px, can use MATCH_PARENT and WRAP_CONTENT.height- the height in px, can use MATCH_PARENT and WRAP_CONTENT.- Returns:
RefreshLayout
-
setRefreshContent
RefreshLayout setRefreshContent(View content)
Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts).
- Parameters:
content- View content view- Returns:
RefreshLayout
-
setRefreshContent
RefreshLayout setRefreshContent(View content, int width, int height)
Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts).
- Parameters:
content- View content viewwidth- the width in px, can use MATCH_PARENT and WRAP_CONTENT.height- the height in px, can use MATCH_PARENT and WRAP_CONTENT.- Returns:
RefreshLayout
-
getRefreshFooter
RefreshFooter getRefreshFooter()
Get the current Footer of RefreshLayout.
- Returns:
RefreshLayout
-
getRefreshHeader
RefreshHeader getRefreshHeader()
Get the current Header of RefreshLayout.
- Returns:
RefreshLayout
-
getState
RefreshState getState()
Get the current state of RefreshLayout.
- Returns:
RefreshLayout
-
getLayout
ViewGroup getLayout()
Get the ViewGroup of RefreshLayout.
- Returns:
ViewGroup
-
setOnRefreshListener
RefreshLayout setOnRefreshListener(OnRefreshListener listener)
Set refresh listener separately.
- Parameters:
listener- OnRefreshListener refresh listener- Returns:
RefreshLayout
-
setOnLoadMoreListener
RefreshLayout setOnLoadMoreListener(OnLoadMoreListener listener)
Set load more listener separately.
- Parameters:
listener- OnLoadMoreListener load more listener- Returns:
RefreshLayout
-
setOnRefreshLoadMoreListener
RefreshLayout setOnRefreshLoadMoreListener(OnRefreshLoadMoreListener listener)
Set refresh and load listeners at the same time.
- Parameters:
listener- OnRefreshLoadMoreListener refresh and load more listener- Returns:
RefreshLayout
-
setOnMultiListener
RefreshLayout setOnMultiListener(OnMultiListener listener)
Set up a multi-function listener. Recommended: SimpleBoundaryDecider.
- Parameters:
listener- OnMultiListener multi-purpose listener- Returns:
RefreshLayout
-
setPrimaryColors
RefreshLayout setPrimaryColors(Array<int> primaryColors)
Set theme color int (primaryColor and accentColor).
- Parameters:
primaryColors- ColorInt theme colors- Returns:
RefreshLayout
-
setPrimaryColorsId
RefreshLayout setPrimaryColorsId(Array<int> primaryColorId)
Set theme color id (primaryColor and accentColor).
- Parameters:
primaryColorId- ColorRes theme color resource IDs- Returns:
RefreshLayout
-
setScrollBoundaryDecider
RefreshLayout setScrollBoundaryDecider(ScrollBoundaryDecider boundary)
Set the scroll boundary Decider, Can customize when you can refresh. Recommended .
- Parameters:
boundary- ScrollBoundaryDecider scroll boundary decider- Returns:
RefreshLayout
-
setNoMoreData
RefreshLayout setNoMoreData(boolean noMoreData)
Restore the original state after finishLoadMoreWithNoMoreData.
- Parameters:
noMoreData- Whether there is more data- Returns:
RefreshLayout
-
resetNoMoreData
RefreshLayout resetNoMoreData()
Restore the original state after finishLoadMoreWithNoMoreData.
- Returns:
RefreshLayout
-
finishRefresh
RefreshLayout finishRefresh()
Finish refresh.
- Returns:
RefreshLayout
-
finishLoadMore
RefreshLayout finishLoadMore()
Finish load more.
- Returns:
RefreshLayout
-
finishRefresh
RefreshLayout finishRefresh(int delayed)
Finish refresh.
- Parameters:
delayed- Start delay- Returns:
RefreshLayout
-
finishRefresh
RefreshLayout finishRefresh(boolean success)
Finish refresh.
- Parameters:
success- Whether data was refreshed successfully (affects last update time)- Returns:
RefreshLayout
-
finishRefresh
RefreshLayout finishRefresh(int delayed, boolean success, Boolean noMoreData)
Finish refresh.
- Parameters:
delayed- Start delaysuccess- Whether data was refreshed successfully (affects last update time)- Returns:
RefreshLayout
-
finishRefreshWithNoMoreData
RefreshLayout finishRefreshWithNoMoreData()
Finish refresh and mark no more data.
- Returns:
RefreshLayout
-
finishLoadMore
RefreshLayout finishLoadMore(int delayed)
Finish load more.
- Parameters:
delayed- Start delay- Returns:
RefreshLayout
-
finishLoadMore
RefreshLayout finishLoadMore(boolean success)
Finish load more.
- Parameters:
success- Whether data was successful- Returns:
RefreshLayout
-
finishLoadMore
RefreshLayout finishLoadMore(int delayed, boolean success, boolean noMoreData)
Finish load more.
- Parameters:
delayed- Start delaysuccess- Whether data was successfulnoMoreData- Whether there is more data- Returns:
RefreshLayout
-
finishLoadMoreWithNoMoreData
RefreshLayout finishLoadMoreWithNoMoreData()
Finish load more and mark no more data.
- Returns:
RefreshLayout
-
closeHeaderOrFooter
RefreshLayout closeHeaderOrFooter()
Close the Header or Footer. Note: this cannot replace finishRefresh and finishLoadMore. 1. closeHeaderOrFooter can close header/footer at any time in any state. 2. finishRefresh and finishLoadMore can only close during refresh or load respectively.
- Returns:
RefreshLayout
-
autoRefresh
boolean autoRefresh()
Display refresh animation and trigger refresh event.
- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoRefresh
boolean autoRefresh(int delayed)
Display refresh animation and trigger refresh event with delayed start.
- Parameters:
delayed- Start delay- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoRefreshAnimationOnly
boolean autoRefreshAnimationOnly()
Display refresh animation without triggering events.
- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoRefresh
boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly)
Display refresh animation with multifunction options.
- Parameters:
delayed- Start delayduration- Drag animation durationdragRate- Drag height ratioanimationOnly- Animation only- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoLoadMore
boolean autoLoadMore()
Display load more animation and trigger load more event.
- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoLoadMore
boolean autoLoadMore(int delayed)
Display load more animation and trigger load more event with delayed start.
- Parameters:
delayed- Start delay- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoLoadMoreAnimationOnly
boolean autoLoadMoreAnimationOnly()
Display load more animation without triggering events.
- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
autoLoadMore
boolean autoLoadMore(int delayed, int duration, float dragRate, boolean animationOnly)
Display load more animation with multifunction options.
- Parameters:
delayed- Start delayduration- Drag animation durationdragRate- Drag height ratio- Returns:
true or false, Status non-compliance will fail. true if successful (fails if state is non-compliant)
-
setDefaultRefreshHeaderCreator
static void setDefaultRefreshHeaderCreator(DefaultRefreshHeaderCreator creator)
Set the default Header creator.
- Parameters:
creator- Header creator
-
setDefaultRefreshFooterCreator
static void setDefaultRefreshFooterCreator(DefaultRefreshFooterCreator creator)
Set the default Footer creator.
- Parameters:
creator- Footer creator
-
setDefaultRefreshInitializer
static void setDefaultRefreshInitializer(DefaultRefreshInitializer initializer)
Set the default Refresh initializer.
- Parameters:
initializer- Global initializer
-
isRefreshing
boolean isRefreshing()
Whether currently refreshing
- Returns:
Whether currently refreshing
-
isLoading
boolean isLoading()
Whether currently loading
- Returns:
Whether currently loading
-
performClick
boolean performClick()
-
-
-
-