public class SmartRefreshLayout extends android.view.ViewGroup implements RefreshLayout, android.support.v4.view.NestedScrollingParent
| 限定符和类型 | 类和说明 |
|---|---|
protected class |
SmartRefreshLayout.BounceRunnable |
protected class |
SmartRefreshLayout.FlingRunnable |
static class |
SmartRefreshLayout.LayoutParams |
class |
SmartRefreshLayout.RefreshKernelImpl
刷新布局核心功能接口
为功能复杂的 Header 或者 Footer 开放的接口
|
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener| 限定符和类型 | 字段和说明 |
|---|---|
protected java.lang.Runnable |
animationRunnable |
protected boolean |
mAttachedToWindow |
protected int |
mCurrentVelocity |
protected boolean |
mDisableContentWhenLoading |
protected boolean |
mDisableContentWhenRefresh |
protected char |
mDragDirection |
protected float |
mDragRate |
protected boolean |
mEnableAutoLoadMore |
protected boolean |
mEnableClipFooterWhenFixedBehind |
protected boolean |
mEnableClipHeaderWhenFixedBehind |
protected boolean |
mEnableDisallowIntercept |
protected boolean |
mEnableFooterFollowWhenNoMoreData |
protected boolean |
mEnableFooterTranslationContent |
protected boolean |
mEnableHeaderTranslationContent |
protected boolean |
mEnableLoadMore |
protected boolean |
mEnableLoadMoreWhenContentNotFull |
protected boolean |
mEnableNestedScrolling |
protected boolean |
mEnableOverScrollBounce |
protected boolean |
mEnableOverScrollDrag |
protected boolean |
mEnablePreviewInEditMode |
protected boolean |
mEnablePureScrollMode |
protected boolean |
mEnableRefresh |
protected boolean |
mEnableScrollContentWhenLoaded |
protected boolean |
mEnableScrollContentWhenRefreshed |
protected android.view.MotionEvent |
mFalsifyEvent |
protected int |
mFixedFooterViewId |
protected int |
mFixedHeaderViewId |
protected int |
mFloorDuration |
protected int |
mFooterBackgroundColor |
protected int |
mFooterHeight |
protected DimensionStatus |
mFooterHeightStatus |
protected int |
mFooterInsetStart |
protected boolean |
mFooterLocked |
protected float |
mFooterMaxDragRate |
protected boolean |
mFooterNeedTouchEventWhenLoading |
protected boolean |
mFooterNoMoreData |
protected boolean |
mFooterNoMoreDataEffective |
protected int |
mFooterTranslationViewId |
protected float |
mFooterTriggerRate |
protected android.os.Handler |
mHandler |
protected int |
mHeaderBackgroundColor |
protected int |
mHeaderHeight |
protected DimensionStatus |
mHeaderHeightStatus |
protected int |
mHeaderInsetStart |
protected float |
mHeaderMaxDragRate |
protected boolean |
mHeaderNeedTouchEventWhenRefreshing |
protected int |
mHeaderTranslationViewId |
protected float |
mHeaderTriggerRate |
protected boolean |
mIsBeingDragged |
protected RefreshKernel |
mKernel |
protected long |
mLastOpenTime |
protected int |
mLastSpinner |
protected float |
mLastTouchX |
protected float |
mLastTouchY |
protected OnLoadMoreListener |
mLoadMoreListener |
protected boolean |
mManualFooterTranslationContent |
protected boolean |
mManualHeaderTranslationContent |
protected boolean |
mManualLoadMore |
protected int |
mMaximumVelocity |
protected int |
mMinimumVelocity |
protected android.support.v4.view.NestedScrollingChildHelper |
mNestedChild |
protected boolean |
mNestedInProgress |
protected android.support.v4.view.NestedScrollingParentHelper |
mNestedParent |
protected OnMultiPurposeListener |
mOnMultiPurposeListener |
protected android.graphics.Paint |
mPaint |
protected int[] |
mParentOffsetInWindow |
protected int[] |
mPrimaryColors |
protected int |
mReboundDuration |
protected android.view.animation.Interpolator |
mReboundInterpolator |
protected RefreshContent |
mRefreshContent |
protected RefreshInternal |
mRefreshFooter |
protected RefreshInternal |
mRefreshHeader |
protected OnRefreshListener |
mRefreshListener |
protected int |
mScreenHeightPixels |
protected ScrollBoundaryDecider |
mScrollBoundaryDecider |
protected android.widget.Scroller |
mScroller |
protected int |
mSpinner |
protected RefreshState |
mState
【主要状态】
面对 SmartRefresh 外部的滚动状态
|
protected boolean |
mSuperDispatchTouchEvent |
protected int |
mTotalUnconsumed |
protected int |
mTouchSlop |
protected int |
mTouchSpinner |
protected float |
mTouchX |
protected float |
mTouchY |
protected android.view.VelocityTracker |
mVelocityTracker |
protected boolean |
mVerticalPermit |
protected RefreshState |
mViceState
【附加状态】
用于主状态 mState 为 Refreshing 或 Loading 时的滚动状态
1.mState=Refreshing|Loading 时 mViceState 有可能与 mState 不同
2.mState=None,开启越界拖动 时 mViceState 有可能与 mState 不同
3.其他状态时与主状态相等 mViceState=mState
4.SmartRefresh 外部无法察觉 mViceState
|
protected android.animation.ValueAnimator |
reboundAnimator |
protected static android.view.ViewGroup.MarginLayoutParams |
sDefaultMarginLP |
protected static DefaultRefreshFooterCreator |
sFooterCreator |
protected static DefaultRefreshHeaderCreator |
sHeaderCreator |
protected static DefaultRefreshInitializer |
sRefreshInitializer |
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHEACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z| 构造器和说明 |
|---|
SmartRefreshLayout(android.content.Context context) |
SmartRefreshLayout(android.content.Context context,
android.util.AttributeSet attrs) |
SmartRefreshLayout(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected android.animation.ValueAnimator |
animSpinner(int endSpinner,
int startDelay,
android.view.animation.Interpolator interpolator,
int duration)
执行回弹动画
|
protected void |
animSpinnerBounce(float velocity)
越界回弹动画
|
boolean |
autoLoadMore()
Display load more animation and trigger load more event.
|
boolean |
autoLoadMore(int delayed,
int duration,
float dragRate,
boolean animationOnly)
Display load more animation and trigger load more event, Delayed start.
|
boolean |
autoLoadMoreAnimationOnly()
Display load more animation without triggering events.
|
boolean |
autoRefresh()
Display refresh animation and trigger refresh event.
|
boolean |
autoRefresh(int delayed)
已过时。
|
boolean |
autoRefresh(int delayed,
int duration,
float dragRate,
boolean animationOnly)
Display refresh animation, Multifunction.
|
boolean |
autoRefreshAnimationOnly()
Display refresh animation without triggering events.
|
RefreshLayout |
closeHeaderOrFooter()
Close the Header or Footer, can't replace finishRefresh and finishLoadMore.
|
void |
computeScroll()
重写 computeScroll 来完成 smart 的特定功能
1.越界回弹
2.边界碰撞
|
boolean |
dispatchTouchEvent(android.view.MotionEvent e)
事件分发 (手势核心)
1.多点触摸
2.无缝衔接内容滚动
|
protected boolean |
drawChild(android.graphics.Canvas canvas,
android.view.View child,
long drawingTime)
重写 drawChild 来完成 smart 的特定功能
1.为 Header 和 Footer 绘制背景 (设置了背景才绘制)
2.为 Header 和 Footer 在 FixedBehind 样式时,做剪裁功能 (mEnableClipHeaderWhenFixedBehind=true 才做)
|
RefreshLayout |
finishLoadMore()
finish load more.
|
RefreshLayout |
finishLoadMore(boolean success)
finish load more.
|
RefreshLayout |
finishLoadMore(int delayed)
finish load more.
|
RefreshLayout |
finishLoadMore(int delayed,
boolean success,
boolean noMoreData)
finish load more.
|
RefreshLayout |
finishLoadMoreWithNoMoreData()
finish load more with no more data.
|
RefreshLayout |
finishRefresh()
finish refresh.
|
RefreshLayout |
finishRefresh(boolean success)
finish refresh.
|
RefreshLayout |
finishRefresh(int delayed)
finish refresh.
|
RefreshLayout |
finishRefresh(int delayed,
boolean success,
java.lang.Boolean noMoreData)
finish refresh.
|
RefreshLayout |
finishRefreshWithNoMoreData()
finish load more with no more data.
|
android.view.ViewGroup.LayoutParams |
generateLayoutParams(android.util.AttributeSet attrs) |
android.view.ViewGroup |
getLayout()
Get the ViewGroup of RefreshLayout
获取实体布局视图
|
int |
getNestedScrollAxes() |
RefreshFooter |
getRefreshFooter()
Get footer of RefreshLayout
获取当前 Footer
|
RefreshHeader |
getRefreshHeader()
Get header of RefreshLayout
获取当前 Header
|
RefreshState |
getState()
Get the current state of RefreshLayout
获取当前状态
|
protected boolean |
interceptAnimatorByAction(int action)
在动画执行时,触摸屏幕,打断动画,转为拖动状态
|
protected boolean |
isEnableRefreshOrLoadMore(boolean enable)
是否真正的 可以刷新或者加载(与 越界拖动 纯滚动模式区分开来)
判断时候可以 刷新 或者 加载(直接影响,Header,Footer 是否显示)
|
protected boolean |
isEnableTranslationContent(boolean enable,
RefreshInternal internal)
判断是否 下拉的时候 需要 移动内容
|
boolean |
isNestedScrollingEnabled() |
protected void |
moveSpinnerInfinitely(float spinner)
黏性移动 spinner
|
protected void |
notifyStateChanged(RefreshState state)
设置并通知状态改变 (setState)
|
protected void |
onAttachedToWindow()
重写 onAttachedToWindow 来完成 smart 的特定功能
1.添加默认或者全局设置的 Header 和 Footer (缺省情况下才会)
2.做 Content 为空时的 TextView 提示
3.智能开启 嵌套滚动 NestedScrollingEnabled
4.初始化 主题颜色 和 调整 Header Footer Content 的显示顺序
|
protected void |
onDetachedFromWindow()
重写 onDetachedFromWindow 来完成 smart 的特定功能
1.恢复原始状态
2.清除动画数据 (防止内存泄露)
|
void |
onFinishInflate()
重写 onFinishInflate 来完成 smart 的特定功能
1.智能寻找 Xml 中定义的 Content、Header、Footer
|
protected void |
onLayout(boolean changed,
int l,
int t,
int r,
int b)
布局 Header Footer Content
1.布局代码看起来相对简单,时因为测量的时候,已经做了复杂的计算,布局的时候,直接按照测量结果,布局就可以了
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
测量 Header Footer Content
1.测量代码看起来很复杂,时因为 Header Footer 有四种拉伸变换样式
SpinnerStyle,每一种样式有自己的测量方法
2.提供预览测量,可以在编辑 XML 的时候直接预览 (isInEditMode)
3.恢复水平触摸位置缓存 mLastTouchX 到屏幕中央 |
boolean |
onNestedFling(android.view.View target,
float velocityX,
float velocityY,
boolean consumed) |
boolean |
onNestedPreFling(android.view.View target,
float velocityX,
float velocityY) |
void |
onNestedPreScroll(android.view.View target,
int dx,
int dy,
int[] consumed) |
void |
onNestedScroll(android.view.View target,
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed) |
void |
onNestedScrollAccepted(android.view.View child,
android.view.View target,
int axes) |
boolean |
onStartNestedScroll(android.view.View child,
android.view.View target,
int nestedScrollAxes) |
void |
onStopNestedScroll(android.view.View target) |
protected void |
overSpinner()
手势拖动结束
开始执行回弹动画
|
void |
requestDisallowInterceptTouchEvent(boolean disallowIntercept) |
RefreshLayout |
resetNoMoreData()
Restore the original state after finishLoadMoreWithNoMoreData.
|
static void |
setDefaultRefreshFooterCreator(DefaultRefreshFooterCreator creator)
设置默认 Footer 构建器
|
static void |
setDefaultRefreshHeaderCreator(DefaultRefreshHeaderCreator creator)
设置默认 Header 构建器
|
static void |
setDefaultRefreshInitializer(DefaultRefreshInitializer initializer)
设置默认 Refresh 初始化器
|
RefreshLayout |
setDisableContentWhenLoading(boolean disable)
Set whether to enable the action content view when loading.
|
RefreshLayout |
setDisableContentWhenRefresh(boolean disable)
Set whether to enable the action content view when refreshing.
|
RefreshLayout |
setDragRate(float rate)
Set the damping effect.
|
RefreshLayout |
setEnableAutoLoadMore(boolean enabled)
Sets whether to listen for the list to trigger a load event when scrolling to the bottom (default true).
|
RefreshLayout |
setEnableClipFooterWhenFixedBehind(boolean enabled)
Set whether to clip footer when the Footer is in the FixedBehind state.
|
RefreshLayout |
setEnableClipHeaderWhenFixedBehind(boolean enabled)
Set whether to clip header when the Header is in the FixedBehind state.
|
RefreshLayout |
setEnableFooterFollowWhenLoadFinished(boolean enabled)
|
RefreshLayout |
setEnableFooterFollowWhenNoMoreData(boolean enabled)
Set whether or not Footer follows the content after there is no more data.
|
RefreshLayout |
setEnableFooterTranslationContent(boolean enabled)
Set whether to pull up the content while pulling up the header.
|
RefreshLayout |
setEnableHeaderTranslationContent(boolean enabled)
Whether to enable pull-down refresh (enabled by default).
|
RefreshLayout |
setEnableLoadMore(boolean enabled)
Set whether to enable pull-up loading more (enabled by default).
|
RefreshLayout |
setEnableLoadMoreWhenContentNotFull(boolean enabled)
Set whether to pull up and load more when the content is not full of one page.
|
RefreshLayout |
setEnableNestedScroll(boolean enabled)
Setting whether nesting scrolling is enabled (default off + smart on).
|
RefreshLayout |
setEnableOverScrollBounce(boolean enabled)
Set whether to enable cross-border rebound function.
|
RefreshLayout |
setEnableOverScrollDrag(boolean enabled)
Set whether to enable cross-border drag (imitation iphone effect).
|
RefreshLayout |
setEnablePureScrollMode(boolean enabled)
Set whether to enable the pure scroll mode.
|
RefreshLayout |
setEnableRefresh(boolean enabled)
是否启用下拉刷新(默认启用)
|
RefreshLayout |
setEnableScrollContentWhenLoaded(boolean enabled)
Set whether to scroll the content to display new data after loading more complete.
|
RefreshLayout |
setEnableScrollContentWhenRefreshed(boolean enabled)
Set whether to scroll the content to display new data after the refresh is complete.
|
RefreshLayout |
setFooterHeight(float heightDp)
Set the Footer's height.
|
RefreshLayout |
setFooterInsetStart(float insetDp)
Set the Header's start offset.
|
RefreshLayout |
setFooterMaxDragRate(float rate)
Set the ratio of the maximum height to drag footer.
|
RefreshLayout |
setFooterTriggerRate(float rate)
Set the ratio at which the load more is triggered.
|
RefreshLayout |
setHeaderHeight(float heightDp)
Set the Header's height.
|
RefreshLayout |
setHeaderInsetStart(float insetDp)
Set the Header's start offset(see srlHeaderInsetStart in the RepastPracticeActivity XML in demo-app for the practical application).
|
RefreshLayout |
setHeaderMaxDragRate(float rate)
Set the ratio of the maximum height to drag header.
|
RefreshLayout |
setHeaderTriggerRate(float rate)
Set the ratio at which the refresh is triggered.
|
void |
setNestedScrollingEnabled(boolean enabled) |
RefreshLayout |
setNoMoreData(boolean noMoreData)
Restore the original state after finishLoadMoreWithNoMoreData.
|
RefreshLayout |
setOnLoadMoreListener(OnLoadMoreListener listener)
Set load more listener separately.
|
RefreshLayout |
setOnMultiPurposeListener(OnMultiPurposeListener listener)
Set up a multi-function listener.
|
RefreshLayout |
setOnRefreshListener(OnRefreshListener listener)
Set refresh listener separately.
|
RefreshLayout |
setOnRefreshLoadMoreListener(OnRefreshLoadMoreListener listener)
Set refresh and load listeners at the same time.
|
RefreshLayout |
setPrimaryColors(int... primaryColors)
Set theme color int (primaryColor and accentColor).
|
RefreshLayout |
setPrimaryColorsId(int... primaryColorId)
Set theme color id (primaryColor and accentColor).
|
RefreshLayout |
setReboundDuration(int duration)
Set the duration of the rebound animation.
|
RefreshLayout |
setReboundInterpolator(android.view.animation.Interpolator interpolator)
Set the rebound interpolator.
|
RefreshLayout |
setRefreshContent(android.view.View content)
Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts)。
|
RefreshLayout |
setRefreshContent(android.view.View content,
int width,
int height)
Set the content of RefreshLayout(Suitable for non-XML pages, not suitable for replacing empty layouts).
|
RefreshLayout |
setRefreshFooter(RefreshFooter footer)
Set the footer of RefreshLayout.
|
RefreshLayout |
setRefreshFooter(RefreshFooter footer,
int width,
int height)
Set the footer of RefreshLayout.
|
RefreshLayout |
setRefreshHeader(RefreshHeader header)
Set the header of RefreshLayout.
|
RefreshLayout |
setRefreshHeader(RefreshHeader header,
int width,
int height)
Set the header of RefreshLayout.
|
RefreshLayout |
setScrollBoundaryDecider(ScrollBoundaryDecider boundary)
Set the scroll boundary Decider, Can customize when you can refresh.
|
protected void |
setStateDirectLoading(boolean triggerLoadMoreEvent)
直接将状态设置为 Loading 正在加载
|
protected void |
setStateLoading(boolean notify)
设置状态为 Loading 正在加载
|
protected void |
setStateRefreshing(boolean notify)
设置状态为 Refreshing 正在刷新
|
protected void |
setViceState(RefreshState state)
设置 副状态
|
protected boolean |
startFlingIfNeed(float flingVelocity)
在必要的时候 开始 Fling 模式
|
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, checkLayoutParams, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, getAccessibilityClassName, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onCreateDrawableState, onDescendantInvalidated, onInterceptHoverEvent, onInterceptTouchEvent, onNestedPrePerformAccessibilityAction, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, shouldDelayChildPressedState, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayoutaddExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, dispatchStartTemporaryDetach, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayoutprotected int mTouchSlop
protected int mSpinner
protected int mLastSpinner
protected int mTouchSpinner
protected int mFloorDuration
protected int mReboundDuration
protected int mScreenHeightPixels
protected float mTouchX
protected float mTouchY
protected float mLastTouchX
protected float mLastTouchY
protected float mDragRate
protected char mDragDirection
protected boolean mIsBeingDragged
protected boolean mSuperDispatchTouchEvent
protected int mFixedHeaderViewId
protected int mFixedFooterViewId
protected int mHeaderTranslationViewId
protected int mFooterTranslationViewId
protected int mMinimumVelocity
protected int mMaximumVelocity
protected int mCurrentVelocity
protected android.widget.Scroller mScroller
protected android.view.VelocityTracker mVelocityTracker
protected android.view.animation.Interpolator mReboundInterpolator
protected int[] mPrimaryColors
protected boolean mEnableRefresh
protected boolean mEnableLoadMore
protected boolean mEnableClipHeaderWhenFixedBehind
protected boolean mEnableClipFooterWhenFixedBehind
protected boolean mEnableHeaderTranslationContent
protected boolean mEnableFooterTranslationContent
protected boolean mEnableFooterFollowWhenNoMoreData
protected boolean mEnablePreviewInEditMode
protected boolean mEnableOverScrollBounce
protected boolean mEnableOverScrollDrag
protected boolean mEnableAutoLoadMore
protected boolean mEnablePureScrollMode
protected boolean mEnableScrollContentWhenLoaded
protected boolean mEnableScrollContentWhenRefreshed
protected boolean mEnableLoadMoreWhenContentNotFull
protected boolean mEnableNestedScrolling
protected boolean mDisableContentWhenRefresh
protected boolean mDisableContentWhenLoading
protected boolean mFooterNoMoreData
protected boolean mFooterNoMoreDataEffective
protected boolean mManualLoadMore
protected boolean mManualHeaderTranslationContent
protected boolean mManualFooterTranslationContent
protected OnRefreshListener mRefreshListener
protected OnLoadMoreListener mLoadMoreListener
protected OnMultiPurposeListener mOnMultiPurposeListener
protected ScrollBoundaryDecider mScrollBoundaryDecider
protected int mTotalUnconsumed
protected boolean mNestedInProgress
protected int[] mParentOffsetInWindow
protected android.support.v4.view.NestedScrollingChildHelper mNestedChild
protected android.support.v4.view.NestedScrollingParentHelper mNestedParent
protected int mHeaderHeight
protected DimensionStatus mHeaderHeightStatus
protected int mFooterHeight
protected DimensionStatus mFooterHeightStatus
protected int mHeaderInsetStart
protected int mFooterInsetStart
protected float mHeaderMaxDragRate
protected float mFooterMaxDragRate
protected float mHeaderTriggerRate
protected float mFooterTriggerRate
protected RefreshInternal mRefreshHeader
protected RefreshInternal mRefreshFooter
protected RefreshContent mRefreshContent
protected android.graphics.Paint mPaint
protected android.os.Handler mHandler
protected RefreshKernel mKernel
protected RefreshState mState
protected RefreshState mViceState
protected long mLastOpenTime
protected int mHeaderBackgroundColor
protected int mFooterBackgroundColor
protected boolean mHeaderNeedTouchEventWhenRefreshing
protected boolean mFooterNeedTouchEventWhenLoading
protected boolean mAttachedToWindow
protected boolean mEnableDisallowIntercept
protected boolean mFooterLocked
protected static DefaultRefreshFooterCreator sFooterCreator
protected static DefaultRefreshHeaderCreator sHeaderCreator
protected static DefaultRefreshInitializer sRefreshInitializer
protected static android.view.ViewGroup.MarginLayoutParams sDefaultMarginLP
protected boolean mVerticalPermit
protected android.view.MotionEvent mFalsifyEvent
protected java.lang.Runnable animationRunnable
protected android.animation.ValueAnimator reboundAnimator
public SmartRefreshLayout(android.content.Context context)
public SmartRefreshLayout(android.content.Context context,
android.util.AttributeSet attrs)
public SmartRefreshLayout(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public void onFinishInflate()
onFinishInflate 在类中 android.view.Viewprotected void onAttachedToWindow()
onAttachedToWindow 在类中 android.view.ViewGroupprotected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
SpinnerStyle,每一种样式有自己的测量方法
2.提供预览测量,可以在编辑 XML 的时候直接预览 (isInEditMode)
3.恢复水平触摸位置缓存 mLastTouchX 到屏幕中央onMeasure 在类中 android.view.ViewwidthMeasureSpec - 水平测量参数heightMeasureSpec - 竖直测量参数protected void onLayout(boolean changed,
int l,
int t,
int r,
int b)
onLayout 在类中 android.view.ViewGroupchanged - 是否改变l - 左t - 上r - 右b - 下protected void onDetachedFromWindow()
onDetachedFromWindow 在类中 android.view.ViewGroupprotected boolean drawChild(android.graphics.Canvas canvas,
android.view.View child,
long drawingTime)
drawChild 在类中 android.view.ViewGroupcanvas - 绘制发布child - 需要绘制的子ViewdrawingTime - 绘制耗时public void computeScroll()
computeScroll 在类中 android.view.Viewpublic boolean dispatchTouchEvent(android.view.MotionEvent e)
dispatchTouchEvent 在类中 android.view.ViewGroupe - 事件protected boolean startFlingIfNeed(float flingVelocity)
flingVelocity - 速度protected boolean interceptAnimatorByAction(int action)
action - MotionEventpublic void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
requestDisallowInterceptTouchEvent 在接口中 android.view.ViewParentrequestDisallowInterceptTouchEvent 在类中 android.view.ViewGroupprotected void notifyStateChanged(RefreshState state)
state - 状态protected void setStateDirectLoading(boolean triggerLoadMoreEvent)
triggerLoadMoreEvent - 是否触发加载回调protected void setStateLoading(boolean notify)
notify - 是否触发通知事件protected void setStateRefreshing(boolean notify)
notify - 是否触发通知事件protected void setViceState(RefreshState state)
state - 状态protected boolean isEnableTranslationContent(boolean enable,
RefreshInternal internal)
enable - mEnableHeaderTranslationContent or mEnableFooterTranslationContentinternal - mRefreshHeader or mRefreshFooterprotected boolean isEnableRefreshOrLoadMore(boolean enable)
enable - mEnableRefresh or mEnableLoadMoreprotected android.animation.ValueAnimator animSpinner(int endSpinner,
int startDelay,
android.view.animation.Interpolator interpolator,
int duration)
endSpinner - 目标值startDelay - 延时参数interpolator - 加速器duration - 时长protected void animSpinnerBounce(float velocity)
velocity - 速度protected void overSpinner()
protected void moveSpinnerInfinitely(float spinner)
spinner - 偏移量public android.view.ViewGroup.LayoutParams generateLayoutParams(android.util.AttributeSet attrs)
generateLayoutParams 在类中 android.view.ViewGrouppublic int getNestedScrollAxes()
getNestedScrollAxes 在接口中 android.support.v4.view.NestedScrollingParentgetNestedScrollAxes 在类中 android.view.ViewGrouppublic boolean onStartNestedScroll(@NonNull
android.view.View child,
@NonNull
android.view.View target,
int nestedScrollAxes)
onStartNestedScroll 在接口中 android.support.v4.view.NestedScrollingParentonStartNestedScroll 在接口中 android.view.ViewParentonStartNestedScroll 在类中 android.view.ViewGrouppublic void onNestedScrollAccepted(@NonNull
android.view.View child,
@NonNull
android.view.View target,
int axes)
onNestedScrollAccepted 在接口中 android.support.v4.view.NestedScrollingParentonNestedScrollAccepted 在接口中 android.view.ViewParentonNestedScrollAccepted 在类中 android.view.ViewGrouppublic void onNestedPreScroll(@NonNull
android.view.View target,
int dx,
int dy,
@NonNull
int[] consumed)
onNestedPreScroll 在接口中 android.support.v4.view.NestedScrollingParentonNestedPreScroll 在接口中 android.view.ViewParentonNestedPreScroll 在类中 android.view.ViewGrouppublic void onNestedScroll(@NonNull
android.view.View target,
int dxConsumed,
int dyConsumed,
int dxUnconsumed,
int dyUnconsumed)
onNestedScroll 在接口中 android.support.v4.view.NestedScrollingParentonNestedScroll 在接口中 android.view.ViewParentonNestedScroll 在类中 android.view.ViewGrouppublic boolean onNestedPreFling(@NonNull
android.view.View target,
float velocityX,
float velocityY)
onNestedPreFling 在接口中 android.support.v4.view.NestedScrollingParentonNestedPreFling 在接口中 android.view.ViewParentonNestedPreFling 在类中 android.view.ViewGrouppublic boolean onNestedFling(@NonNull
android.view.View target,
float velocityX,
float velocityY,
boolean consumed)
onNestedFling 在接口中 android.support.v4.view.NestedScrollingParentonNestedFling 在接口中 android.view.ViewParentonNestedFling 在类中 android.view.ViewGrouppublic void onStopNestedScroll(@NonNull
android.view.View target)
onStopNestedScroll 在接口中 android.support.v4.view.NestedScrollingParentonStopNestedScroll 在接口中 android.view.ViewParentonStopNestedScroll 在类中 android.view.ViewGrouppublic void setNestedScrollingEnabled(boolean enabled)
setNestedScrollingEnabled 在类中 android.view.Viewpublic boolean isNestedScrollingEnabled()
isNestedScrollingEnabled 在类中 android.view.Viewpublic RefreshLayout setFooterHeight(float heightDp)
setFooterHeight 在接口中 RefreshLayoutheightDp - Density-independent Pixels 虚拟像素(px需要调用px2dp转换)public RefreshLayout setHeaderHeight(float heightDp)
setHeaderHeight 在接口中 RefreshLayoutheightDp - Density-independent Pixels 虚拟像素(px需要调用px2dp转换)public RefreshLayout setHeaderInsetStart(float insetDp)
setHeaderInsetStart 在接口中 RefreshLayoutinsetDp - Density-independent Pixels 虚拟像素(px需要调用px2dp转换)public RefreshLayout setFooterInsetStart(float insetDp)
setFooterInsetStart 在接口中 RefreshLayoutinsetDp - Density-independent Pixels 虚拟像素(px需要调用px2dp转换)RefreshLayout.setHeaderInsetStart(float)public RefreshLayout setDragRate(float rate)
setDragRate 在接口中 RefreshLayoutrate - ratio = (The drag height of the view)/(The actual drag height of the finger)
比率 = 视图拖动高度 / 手指拖动高度public RefreshLayout setHeaderMaxDragRate(float rate)
setHeaderMaxDragRate 在接口中 RefreshLayoutrate - ratio = (the maximum height to drag header)/(the height of header)
比率 = 下拉最大高度 / Header的高度public RefreshLayout setFooterMaxDragRate(float rate)
setFooterMaxDragRate 在接口中 RefreshLayoutrate - ratio = (the maximum height to drag footer)/(the height of footer)
比率 = 下拉最大高度 / Footer的高度public RefreshLayout setHeaderTriggerRate(float rate)
setHeaderTriggerRate 在接口中 RefreshLayoutrate - 触发刷新距离 与 HeaderHeight 的比率public RefreshLayout setFooterTriggerRate(float rate)
setFooterTriggerRate 在接口中 RefreshLayoutrate - 触发加载距离 与 FooterHeight 的比率public RefreshLayout setReboundInterpolator(@NonNull android.view.animation.Interpolator interpolator)
setReboundInterpolator 在接口中 RefreshLayoutinterpolator - 动画插值器public RefreshLayout setReboundDuration(int duration)
setReboundDuration 在接口中 RefreshLayoutduration - 时长public RefreshLayout setEnableLoadMore(boolean enabled)
setEnableLoadMore 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableRefresh(boolean enabled)
setEnableRefresh 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableHeaderTranslationContent(boolean enabled)
setEnableHeaderTranslationContent 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableFooterTranslationContent(boolean enabled)
setEnableFooterTranslationContent 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableAutoLoadMore(boolean enabled)
setEnableAutoLoadMore 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableOverScrollBounce(boolean enabled)
setEnableOverScrollBounce 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnablePureScrollMode(boolean enabled)
setEnablePureScrollMode 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableScrollContentWhenLoaded(boolean enabled)
setEnableScrollContentWhenLoaded 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableScrollContentWhenRefreshed(boolean enabled)
setEnableScrollContentWhenRefreshed 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableLoadMoreWhenContentNotFull(boolean enabled)
setEnableLoadMoreWhenContentNotFull 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableOverScrollDrag(boolean enabled)
setEnableOverScrollDrag 在接口中 RefreshLayoutenabled - 是否启用@Deprecated public RefreshLayout setEnableFooterFollowWhenLoadFinished(boolean enabled)
setEnableFooterFollowWhenLoadFinished 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableFooterFollowWhenNoMoreData(boolean enabled)
setEnableFooterFollowWhenNoMoreData 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableClipHeaderWhenFixedBehind(boolean enabled)
setEnableClipHeaderWhenFixedBehind 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableClipFooterWhenFixedBehind(boolean enabled)
setEnableClipFooterWhenFixedBehind 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setEnableNestedScroll(boolean enabled)
setEnableNestedScroll 在接口中 RefreshLayoutenabled - 是否启用public RefreshLayout setDisableContentWhenRefresh(boolean disable)
setDisableContentWhenRefresh 在接口中 RefreshLayoutdisable - 是否禁止public RefreshLayout setDisableContentWhenLoading(boolean disable)
setDisableContentWhenLoading 在接口中 RefreshLayoutdisable - 是否禁止public RefreshLayout setRefreshHeader(@NonNull RefreshHeader header)
setRefreshHeader 在接口中 RefreshLayoutheader - RefreshHeader 刷新头public RefreshLayout setRefreshHeader(@NonNull RefreshHeader header, int width, int height)
setRefreshHeader 在接口中 RefreshLayoutheader - RefreshHeader 刷新头width - the width in px, can use MATCH_PARENT and WRAP_CONTENT.
宽度 可以使用 MATCH_PARENT, WRAP_CONTENTheight - the height in px, can use MATCH_PARENT and WRAP_CONTENT.
高度 可以使用 MATCH_PARENT, WRAP_CONTENTpublic RefreshLayout setRefreshFooter(@NonNull RefreshFooter footer)
setRefreshFooter 在接口中 RefreshLayoutfooter - RefreshFooter 刷新尾巴public RefreshLayout setRefreshFooter(@NonNull RefreshFooter footer, int width, int height)
setRefreshFooter 在接口中 RefreshLayoutfooter - RefreshFooter 刷新尾巴width - the width in px, can use MATCH_PARENT and WRAP_CONTENT.
宽度 可以使用 MATCH_PARENT, WRAP_CONTENTheight - the height in px, can use MATCH_PARENT and WRAP_CONTENT.
高度 可以使用 MATCH_PARENT, WRAP_CONTENTpublic RefreshLayout setRefreshContent(@NonNull android.view.View content)
setRefreshContent 在接口中 RefreshLayoutcontent - View 内容视图public RefreshLayout setRefreshContent(@NonNull android.view.View content, int width, int height)
setRefreshContent 在接口中 RefreshLayoutcontent - View 内容视图width - the width in px, can use MATCH_PARENT and WRAP_CONTENT.
宽度 可以使用 MATCH_PARENT, WRAP_CONTENTheight - the height in px, can use MATCH_PARENT and WRAP_CONTENT.
高度 可以使用 MATCH_PARENT, WRAP_CONTENT@Nullable public RefreshFooter getRefreshFooter()
getRefreshFooter 在接口中 RefreshLayout@Nullable public RefreshHeader getRefreshHeader()
getRefreshHeader 在接口中 RefreshLayout@NonNull public RefreshState getState()
getState 在接口中 RefreshLayout@NonNull public android.view.ViewGroup getLayout()
getLayout 在接口中 RefreshLayoutpublic RefreshLayout setOnRefreshListener(OnRefreshListener listener)
setOnRefreshListener 在接口中 RefreshLayoutlistener - OnRefreshListener 刷新监听器public RefreshLayout setOnLoadMoreListener(OnLoadMoreListener listener)
setOnLoadMoreListener 在接口中 RefreshLayoutlistener - OnLoadMoreListener 加载监听器public RefreshLayout setOnRefreshLoadMoreListener(OnRefreshLoadMoreListener listener)
setOnRefreshLoadMoreListener 在接口中 RefreshLayoutlistener - OnRefreshLoadMoreListener 刷新加载监听器public RefreshLayout setOnMultiPurposeListener(OnMultiPurposeListener listener)
SimpleMultiPurposeListener
设置多功能监听器
建议使用 SimpleMultiPurposeListenersetOnMultiPurposeListener 在接口中 RefreshLayoutlistener - OnMultiPurposeListener 多功能监听器public RefreshLayout setPrimaryColors(int... primaryColors)
setPrimaryColors 在接口中 RefreshLayoutprimaryColors - ColorInt 主题颜色public RefreshLayout setPrimaryColorsId(@ColorRes int... primaryColorId)
setPrimaryColorsId 在接口中 RefreshLayoutprimaryColorId - ColorRes 主题颜色IDpublic RefreshLayout setScrollBoundaryDecider(ScrollBoundaryDecider boundary)
ScrollBoundaryDeciderAdapter
设置滚动边界判断器
建议使用 ScrollBoundaryDeciderAdaptersetScrollBoundaryDecider 在接口中 RefreshLayoutboundary - ScrollBoundaryDecider 判断器public RefreshLayout setNoMoreData(boolean noMoreData)
setNoMoreData 在接口中 RefreshLayoutnoMoreData - 是否有更多数据public RefreshLayout resetNoMoreData()
resetNoMoreData 在接口中 RefreshLayoutpublic RefreshLayout finishRefresh()
finishRefresh 在接口中 RefreshLayoutpublic RefreshLayout finishLoadMore()
finishLoadMore 在接口中 RefreshLayoutpublic RefreshLayout finishRefresh(int delayed)
finishRefresh 在接口中 RefreshLayoutdelayed - 开始延时public RefreshLayout finishRefresh(boolean success)
finishRefresh 在接口中 RefreshLayoutsuccess - 数据是否成功刷新 (会影响到上次更新时间的改变)public RefreshLayout finishRefresh(int delayed, boolean success, java.lang.Boolean noMoreData)
finishRefresh 在接口中 RefreshLayoutdelayed - 开始延时success - 数据是否成功刷新 (会影响到上次更新时间的改变)noMoreData - 是否有更多数据public RefreshLayout finishRefreshWithNoMoreData()
finishRefreshWithNoMoreData 在接口中 RefreshLayoutpublic RefreshLayout finishLoadMore(int delayed)
finishLoadMore 在接口中 RefreshLayoutdelayed - 开始延时public RefreshLayout finishLoadMore(boolean success)
finishLoadMore 在接口中 RefreshLayoutsuccess - 数据是否成功public RefreshLayout finishLoadMore(int delayed, boolean success, boolean noMoreData)
finishLoadMore 在接口中 RefreshLayoutdelayed - 开始延时success - 数据是否成功noMoreData - 是否有更多数据public RefreshLayout finishLoadMoreWithNoMoreData()
finishLoadMoreWithNoMoreData 在接口中 RefreshLayoutpublic RefreshLayout closeHeaderOrFooter()
closeHeaderOrFooter 在接口中 RefreshLayoutpublic boolean autoRefresh()
autoRefresh 在接口中 RefreshLayout@Deprecated public boolean autoRefresh(int delayed)
autoRefresh 在接口中 RefreshLayoutdelayed - 开始延时public boolean autoRefreshAnimationOnly()
autoRefreshAnimationOnly 在接口中 RefreshLayoutpublic boolean autoRefresh(int delayed,
int duration,
float dragRate,
boolean animationOnly)
autoRefresh 在接口中 RefreshLayoutdelayed - 开始延时duration - 拖拽动画持续时间dragRate - 拉拽的高度比率(要求 ≥ 1 )animationOnly - animation only 只有动画public boolean autoLoadMore()
autoLoadMore 在接口中 RefreshLayoutpublic boolean autoLoadMoreAnimationOnly()
autoLoadMoreAnimationOnly 在接口中 RefreshLayoutpublic boolean autoLoadMore(int delayed,
int duration,
float dragRate,
boolean animationOnly)
autoLoadMore 在接口中 RefreshLayoutdelayed - 开始延时duration - 拖拽动画持续时间dragRate - 拉拽的高度比率(要求 ≥ 1 )animationOnly - 是否只是显示动画,不回调public static void setDefaultRefreshHeaderCreator(@NonNull
DefaultRefreshHeaderCreator creator)
creator - Header构建器public static void setDefaultRefreshFooterCreator(@NonNull
DefaultRefreshFooterCreator creator)
creator - Footer构建器public static void setDefaultRefreshInitializer(@NonNull
DefaultRefreshInitializer initializer)
initializer - 全局初始化器