Interface RefreshComponent
-
- All Implemented Interfaces:
public interface RefreshComponentInternal refresh component.
-
-
Method Summary
Modifier and Type Method Description abstract ViewgetView()Get the actual view. abstract SpinnerStylegetSpinnerStyle()Get the spinner style SpinnerStyle. abstract voidsetPrimaryColors(Array<int> colors)[Framework internal only] Set the primary colors. abstract voidonInitialized(RefreshKernel kernel, int height, int maxDragHeight)[Framework internal only] Called when dimension measurement is complete (called once if height does not change; invoked in RefreshLayout#onMeasure). abstract voidonMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight)[Framework internal only] Called during finger drag (called continuously; isDragging replaces the old onPulling/onReleasing). abstract voidonReleased(RefreshLayout refreshLayout, int height, int maxDragHeight)[Framework internal only] Called at the moment of release (called once, triggers loading). abstract voidonStartAnimator(RefreshLayout refreshLayout, int height, int maxDragHeight)[Framework internal only] Called when animation starts. abstract intonFinish(RefreshLayout refreshLayout, boolean success)[Framework internal only] Called when animation ends. abstract voidonHorizontalDrag(float percentX, int offsetX, int offsetMax)[Framework internal only] Called during horizontal drag. abstract booleanisSupportHorizontalDrag()Whether horizontal drag is supported (affects onHorizontalDrag invocation). -
-
Method Detail
-
getView
abstract View getView()
Get the actual view.
- Returns:
The actual view
-
getSpinnerStyle
abstract SpinnerStyle getSpinnerStyle()
Get the spinner style SpinnerStyle. Must return non-null.
- Returns:
The spinner style
-
setPrimaryColors
abstract void setPrimaryColors(Array<int> colors)
[Framework internal only] Set the primary colors.
- Parameters:
colors- Corresponding to srlPrimaryColor and srlAccentColor in XML
-
onInitialized
abstract void onInitialized(RefreshKernel kernel, int height, int maxDragHeight)
[Framework internal only] Called when dimension measurement is complete (called once if height does not change; invoked in RefreshLayout#onMeasure).
- Parameters:
kernel- RefreshKernelheight- HeaderHeight or FooterHeightmaxDragHeight- Maximum drag height
-
onMoving
abstract void onMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight)
[Framework internal only] Called during finger drag (called continuously; isDragging replaces the old onPulling/onReleasing).
- Parameters:
isDragging- true if finger is dragging, false if rebound animationpercent- Pull percentage, value = offset/footerHeight (range: 0 to (footerHeight+maxDragHeight)/footerHeight)offset- Pixel offset of pull, range: 0 to (footerHeight+maxDragHeight)height- Height: HeaderHeight or FooterHeight (offset can exceed height, making percent >1)maxDragHeight- Maximum drag height.
-
onReleased
abstract void onReleased(RefreshLayout refreshLayout, int height, int maxDragHeight)
[Framework internal only] Called at the moment of release (called once, triggers loading).
- Parameters:
refreshLayout- RefreshLayoutheight- Height: HeaderHeight or FooterHeightmaxDragHeight- Maximum drag height
-
onStartAnimator
abstract void onStartAnimator(RefreshLayout refreshLayout, int height, int maxDragHeight)
[Framework internal only] Called when animation starts.
- Parameters:
refreshLayout- RefreshLayoutheight- HeaderHeight or FooterHeightmaxDragHeight- Maximum drag height
-
onFinish
abstract int onFinish(RefreshLayout refreshLayout, boolean success)
[Framework internal only] Called when animation ends.
- Parameters:
refreshLayout- RefreshLayoutsuccess- Whether data was refreshed or loaded successfully- Returns:
Time needed for finish animation. Returning Integer.MAX_VALUE cancels the finish event and keeps the current state
-
onHorizontalDrag
abstract void onHorizontalDrag(float percentX, int offsetX, int offsetMax)
[Framework internal only] Called during horizontal drag.
- Parameters:
percentX- Horizontal position percentage of finger relative to screen (0 to 1)offsetX- Horizontal pixel offset of finger relative to screen (0 to LayoutWidth)offsetMax- Maximum offset
-
isSupportHorizontalDrag
abstract boolean isSupportHorizontalDrag()
Whether horizontal drag is supported (affects onHorizontalDrag invocation).
- Returns:
Horizontal drag consumes more time and resources; return false if not supported
-
-
-
-