Interface RefreshComponent
-
- All Implemented Interfaces:
-
ai.nexconn.chatui.widget.pullrefresh.listener.OnStateChangedListener
public interface RefreshComponent implements OnStateChangedListener
Internal refresh component.
-
-
Method Summary
Modifier and Type Method Description abstract ViewgetView()Get the actual view. abstract SpinnerStylegetSpinnerStyle()Get the spinner style SpinnerStyle. abstract voidsetPrimaryColors(@ColorInt() Array<int> colors)[Framework internal only] Set the primary colors. abstract voidonInitialized(@NonNull() 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(@NonNull() RefreshLayout refreshLayout, int height, int maxDragHeight)[Framework internal only] Called at the moment of release (called once, triggers loading). abstract voidonStartAnimator(@NonNull() RefreshLayout refreshLayout, int height, int maxDragHeight)[Framework internal only] Called when animation starts. abstract intonFinish(@NonNull() 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
@NonNull() abstract View getView()
Get the actual view.
- Returns:
The actual view
-
getSpinnerStyle
@NonNull() abstract SpinnerStyle getSpinnerStyle()
Get the spinner style SpinnerStyle. Must return non-null.
- Returns:
The spinner style
-
setPrimaryColors
@RestrictTo(value = {}) abstract void setPrimaryColors(@ColorInt() Array<int> colors)[Framework internal only] Set the primary colors.
- Parameters:
colors- Corresponding to srlPrimaryColor and srlAccentColor in XML
-
onInitialized
@RestrictTo(value = {}) abstract void onInitialized(@NonNull() 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
@RestrictTo(value = {}) 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
@RestrictTo(value = {}) abstract void onReleased(@NonNull() 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
@RestrictTo(value = {}) abstract void onStartAnimator(@NonNull() RefreshLayout refreshLayout, int height, int maxDragHeight)[Framework internal only] Called when animation starts.
- Parameters:
refreshLayout- RefreshLayoutheight- HeaderHeight or FooterHeightmaxDragHeight- Maximum drag height
-
onFinish
@RestrictTo(value = {}) abstract int onFinish(@NonNull() 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
@RestrictTo(value = {}) 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
-
-
-
-