Interface RefreshComponent

  • All Implemented Interfaces:

    
    public interface RefreshComponent
    
                        

    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(Array<int> colors) [Framework internal only] Set the primary colors.
      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).
      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(RefreshLayout refreshLayout, int height, int maxDragHeight) [Framework internal only] Called at the moment of release (called once, triggers loading).
      abstract void onStartAnimator(RefreshLayout refreshLayout, int height, int maxDragHeight) [Framework internal only] Called when animation starts.
      abstract int onFinish(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 java.lang.Object

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

    • 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 - RefreshKernel
        height - HeaderHeight or FooterHeight
        maxDragHeight - 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 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

         abstract void onReleased(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

         abstract void onStartAnimator(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

         abstract int onFinish(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

         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