Interface RefreshComponent

  • All Implemented Interfaces:
    ai.nexconn.chatui.widget.pullrefresh.listener.OnStateChangedListener

    
    public interface RefreshComponent
     implements OnStateChangedListener
                        

    Internal refresh component.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract View getView() Get the actual view.
      abstract SpinnerStyle getSpinnerStyle() Get the spinner style SpinnerStyle.
      abstract void setPrimaryColors(@ColorInt() Array<int> colors) [Framework internal only] Set the primary colors.
      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).
      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).
      abstract void onReleased(@NonNull() RefreshLayout refreshLayout, int height, int maxDragHeight) [Framework internal only] Called at the moment of release (called once, triggers loading).
      abstract void onStartAnimator(@NonNull() RefreshLayout refreshLayout, int height, int maxDragHeight) [Framework internal only] Called when animation starts.
      abstract int onFinish(@NonNull() RefreshLayout refreshLayout, boolean success) [Framework internal only] Called when animation ends.
      abstract void onHorizontalDrag(float percentX, int offsetX, int offsetMax) [Framework internal only] Called during horizontal drag.
      abstract boolean isSupportHorizontalDrag() Whether horizontal drag is supported (affects onHorizontalDrag invocation).
      • Methods inherited from class ai.nexconn.chatui.widget.pullrefresh.listener.OnStateChangedListener

        onStateChanged
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getView

        @NonNull() abstract View getView()

        Get the actual view.

        Returns:

        The actual view

      • 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 - RefreshKernel
        height - HeaderHeight or FooterHeight
        maxDragHeight - 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 animation
        percent - 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 - RefreshLayout
        height - Height: HeaderHeight or FooterHeight
        maxDragHeight - 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 - RefreshLayout
        height - HeaderHeight or FooterHeight
        maxDragHeight - Maximum drag height
      • onFinish

        @RestrictTo(value = {}) abstract int onFinish(@NonNull() RefreshLayout refreshLayout, boolean success)

        [Framework internal only] Called when animation ends.

        Parameters:
        refreshLayout - RefreshLayout
        success - 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