SmartRefreshLayout

public class SmartRefreshLayout

Constructors

Link copied to clipboard
public void SmartRefreshLayout(Context context)
public void SmartRefreshLayout(Context context, AttributeSet attrs)

Types

Link copied to clipboard
public class LayoutParams
Link copied to clipboard
public class RefreshKernelImpl
Core refresh layout interface.

Functions

Link copied to clipboard
public boolean autoLoadMore()
Display load more animation and trigger load more event.
public boolean autoLoadMore(int delayed)
Display load more animation and trigger load more event with delayed start.
public boolean autoLoadMore(int delayed, int duration, float dragRate, boolean animationOnly)
Display load more animation with multifunction options.
Link copied to clipboard
public boolean autoLoadMoreAnimationOnly()
Display load more animation without triggering events.
Link copied to clipboard
public boolean autoRefresh()
Display refresh animation and trigger refresh event.
public boolean autoRefresh(int delayed)
Display refresh animation and trigger refresh event with delayed start.
public boolean autoRefresh(int delayed, int duration, float dragRate, boolean animationOnly)
Display refresh animation with multifunction options.
Link copied to clipboard
public boolean autoRefreshAnimationOnly()
Display refresh animation without triggering events.
Link copied to clipboard
public RefreshLayout closeHeaderOrFooter()
Close the Header or Footer.
Link copied to clipboard
public void computeScroll()
Override computeScroll for smart-specific features: 1.
Link copied to clipboard
public boolean dispatchTouchEvent(MotionEvent e)
Event dispatch (gesture core): 1.
Link copied to clipboard
public RefreshLayout finishLoadMore()
public RefreshLayout finishLoadMore(boolean success)
public RefreshLayout finishLoadMore(int delayed)
public RefreshLayout finishLoadMore(int delayed, boolean success, boolean noMoreData)
Finish load more.
Link copied to clipboard
public RefreshLayout finishLoadMoreWithNoMoreData()
Finish load more and mark no more data.
Link copied to clipboard
public RefreshLayout finishRefresh()
public RefreshLayout finishRefresh(boolean success)
public RefreshLayout finishRefresh(int delayed)
public RefreshLayout finishRefresh(int delayed, boolean success, Boolean noMoreData)
Finish refresh.
Link copied to clipboard
public RefreshLayout finishRefreshWithNoMoreData()
Finish refresh and mark no more data.
Link copied to clipboard
public LayoutParams generateLayoutParams(AttributeSet attrs)
Link copied to clipboard
public ViewGroup getLayout()
Get the ViewGroup of RefreshLayout.
Link copied to clipboard
public int getNestedScrollAxes()
Link copied to clipboard
public RefreshFooter getRefreshFooter()
Get the current Footer of RefreshLayout.
Link copied to clipboard
public RefreshHeader getRefreshHeader()
Get the current Header of RefreshLayout.
Link copied to clipboard
public RefreshState getState()
Get the current state of RefreshLayout.
Link copied to clipboard
public boolean isLoading()
Whether currently loading
Link copied to clipboard
public boolean isNestedScrollingEnabled()
Link copied to clipboard
public boolean isRefreshing()
Whether currently refreshing
Link copied to clipboard
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed)
Link copied to clipboard
public boolean onNestedPreFling(View target, float velocityX, float velocityY)
Link copied to clipboard
public void onNestedPreScroll(View target, int dx, int dy, Array<int> consumed)
Link copied to clipboard
public void onNestedScroll(View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)
Link copied to clipboard
public void onNestedScrollAccepted(View child, View target, int axes)
Link copied to clipboard
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes)
Link copied to clipboard
public void onStopNestedScroll(View target)
Link copied to clipboard
public boolean performClick()
Link copied to clipboard
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
This code is from Google's official SwipeRefreshLayout, mainly to let older ListView scroll down smoothly by selectively blocking requestDisallowInterceptTouchEvent.
Link copied to clipboard
public RefreshLayout resetNoMoreData()
Restore the original state after finishLoadMoreWithNoMoreData.
Link copied to clipboard
public static void setDefaultRefreshFooterCreator(DefaultRefreshFooterCreator creator)
Set the default Footer creator.
Link copied to clipboard
public static void setDefaultRefreshHeaderCreator(DefaultRefreshHeaderCreator creator)
Set the default Header creator.
Link copied to clipboard
public static void setDefaultRefreshInitializer(DefaultRefreshInitializer initializer)
Set the default Refresh initializer.
Link copied to clipboard
public RefreshLayout setDisableContentWhenLoading(boolean disable)
Set whether to disable content interaction during loading.
Link copied to clipboard
public RefreshLayout setDisableContentWhenRefresh(boolean disable)
Set whether to disable content interaction during refresh.
Link copied to clipboard
public RefreshLayout setDragRate(float rate)
Set the damping effect.
Link copied to clipboard
public RefreshLayout setEnableAutoLoadMore(boolean enabled)
Sets whether to listen for the list to trigger a load event when scrolling to the bottom (default true).
Link copied to clipboard
public RefreshLayout setEnableClipFooterWhenFixedBehind(boolean enabled)
Set whether to clip footer when the Footer is in the FixedBehind state.
Link copied to clipboard
public RefreshLayout setEnableClipHeaderWhenFixedBehind(boolean enabled)
Set whether to clip header when the Header is in the FixedBehind state.
Link copied to clipboard
public RefreshLayout setEnableFooterFollowWhenNoMoreData(boolean enabled)
Set whether Footer follows the content after there is no more data.
Link copied to clipboard
public RefreshLayout setEnableFooterTranslationContent(boolean enabled)
Set whether to pull up the content while pulling up the footer.
Link copied to clipboard
public RefreshLayout setEnableHeaderTranslationContent(boolean enabled)
Whether to enable pull-down refresh (enabled by default).
Link copied to clipboard
public RefreshLayout setEnableLoadMore(boolean enabled)
Set whether to enable pull-up loading more (enabled by default).
Link copied to clipboard
public RefreshLayout setEnableLoadMoreWhenContentNotFull(boolean enabled)
Set whether to pull up and load more when the content is not full of one page.
Link copied to clipboard
public RefreshLayout setEnableNestedScroll(boolean enabled)
Setting whether nesting scrolling is enabled (default off + smart on).
Link copied to clipboard
public RefreshLayout setEnableOverScrollBounce(boolean enabled)
Set whether to enable the over-scroll bounce function.
Link copied to clipboard
public RefreshLayout setEnableOverScrollDrag(boolean enabled)
Set whether to enable over-scroll drag (imitation iPhone effect).
Link copied to clipboard
public RefreshLayout setEnablePureScrollMode(boolean enabled)
Set whether to enable pure scroll mode.
Link copied to clipboard
public RefreshLayout setEnableRefresh(boolean enabled)
Whether to enable pull-down refresh (enabled by default).
Link copied to clipboard
public RefreshLayout setEnableScrollContentWhenLoaded(boolean enabled)
Set whether to scroll the content to display new data after loading more complete.
Link copied to clipboard
public RefreshLayout setEnableScrollContentWhenRefreshed(boolean enabled)
Set whether to scroll the content to display new data after the refresh is complete.
Link copied to clipboard
public RefreshLayout setFixedFooterViewId(int id)
Set the View ID fixed above the Footer, which stays stationary when Header scrolls.
Link copied to clipboard
public RefreshLayout setFixedHeaderViewId(int id)
Set the View ID fixed below the Header, which stays stationary when Footer scrolls.
Link copied to clipboard
public RefreshLayout setFooterHeight(float heightDp)
Set the Footer's height.
Link copied to clipboard
public RefreshLayout setFooterHeightPx(int height)
Set the Footer height
Link copied to clipboard
public RefreshLayout setFooterInsetStart(float insetDp)
Set the Footer's start offset.
Link copied to clipboard
public RefreshLayout setFooterInsetStartPx(int insetPx)
Set the Footer's start offset.
Link copied to clipboard
public RefreshLayout setFooterMaxDragRate(float rate)
Set the ratio of the maximum height to drag footer.
Link copied to clipboard
public RefreshLayout setFooterTranslationViewId(int id)
Set the View ID that should scroll along with the Footer.
Link copied to clipboard
public RefreshLayout setFooterTriggerRate(float rate)
Set the ratio at which the load more is triggered.
Link copied to clipboard
public RefreshLayout setHeaderHeight(float heightDp)
Set the Header's height.
Link copied to clipboard
public RefreshLayout setHeaderHeightPx(int height)
Set the Header height
Link copied to clipboard
public RefreshLayout setHeaderInsetStart(float insetDp)
Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application).
Link copied to clipboard
public RefreshLayout setHeaderInsetStartPx(int insetPx)
Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application).
Link copied to clipboard
public RefreshLayout setHeaderMaxDragRate(float rate)
Set the ratio of the maximum height to drag header.
Link copied to clipboard
public RefreshLayout setHeaderTranslationViewId(int id)
Set the View ID that should scroll along with the Header.
Link copied to clipboard
public RefreshLayout setHeaderTriggerRate(float rate)
Set the ratio at which the refresh is triggered.
Link copied to clipboard
public void setNestedScrollingEnabled(boolean enabled)
Link copied to clipboard
public RefreshLayout setNoMoreData(boolean noMoreData)
Restore the original state after finishLoadMoreWithNoMoreData.
Link copied to clipboard
public RefreshLayout setOnLoadMoreListener(OnLoadMoreListener listener)
Set load more listener separately.
Link copied to clipboard
public RefreshLayout setOnMultiListener(OnMultiListener listener)
Set up a multi-function listener.
Link copied to clipboard
public RefreshLayout setOnRefreshListener(OnRefreshListener listener)
Set refresh listener separately.
Link copied to clipboard
public RefreshLayout setOnRefreshLoadMoreListener(OnRefreshLoadMoreListener listener)
Set refresh and load listeners at the same time.
Link copied to clipboard
public RefreshLayout setPrimaryColors(Array<int> primaryColors)
Set theme color int (primaryColor and accentColor).
Link copied to clipboard
public RefreshLayout setPrimaryColorsId(Array<int> primaryColorId)
Set theme color id (primaryColor and accentColor).
Link copied to clipboard
public RefreshLayout setReboundDuration(int duration)
Set the duration of the rebound animation.
Link copied to clipboard
public RefreshLayout setReboundInterpolator(Interpolator interpolator)
Set the rebound interpolator.
Link copied to clipboard
public RefreshLayout setRefreshContent(View content)
public RefreshLayout setRefreshContent(View content, int width, int height)
Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts).
Link copied to clipboard
public RefreshLayout setRefreshFooter(RefreshFooter footer)
public RefreshLayout setRefreshFooter(RefreshFooter footer, int width, int height)
Set the footer of RefreshLayout.
Link copied to clipboard
public RefreshLayout setRefreshHeader(RefreshHeader header)
public RefreshLayout setRefreshHeader(RefreshHeader header, int width, int height)
Set the header of RefreshLayout.
Link copied to clipboard
public RefreshLayout setScrollBoundaryDecider(ScrollBoundaryDecider boundary)
Set the scroll boundary Decider, Can customize when you can refresh.